Typedef mir::UniqueModulePtr¶
Defined in File module_deleter.h
Typedef Documentation¶
-
template<typename T>
using mir::UniqueModulePtr = std::unique_ptr<T, ModuleDeleter<T>>¶ Use UniqueModulePtr to ensure that your loadable library outlives instances created within it.
Use mir::make_module_ptr(…) or pass a function from your library to the constructor, to increase the lifetime of your library:
mir::UniqueModulePtr<ExampleInterface> library_entry_point() { return mir::UniqueModulePtr<SomeInterface>(new Implementation, &library_entry_point); }
The default constructor will not try to infer the dynamic library.