Inviwo
0.9.10.1
Inviwo documentation
|
#include <modulemanager.h>
Public Types | |
using | IdSet = std::set< std::string, CaseInsensitiveCompare > |
Public Member Functions | |
ModuleManager (InviwoApplication *app) | |
ModuleManager (const ModuleManager &rhs)=delete | |
ModuleManager & | operator= (const ModuleManager &that)=delete |
bool | isRuntimeModuleReloadingEnabled () |
void | registerModules (std::vector< std::unique_ptr< InviwoModuleFactoryObject >> moduleFactories) |
Registers modules from factories and takes ownership of input module factories. Module is registered if dependencies exist and they have correct version. | |
void | registerModules (RuntimeModuleLoading) |
Load modules from dynamic library files in the specified search paths. More... | |
void | unregisterModules () |
Removes all modules not marked as protected by the application. More... | |
const std::vector< std::unique_ptr< InviwoModule > > & | getModules () const |
const std::vector< std::unique_ptr< InviwoModuleFactoryObject > > & | getModuleFactoryObjects () const |
template<class T > | |
T * | getModuleByType () const |
InviwoModule * | getModuleByIdentifier (const std::string &identifier) const |
std::vector< InviwoModule * > | getModulesByAlias (const std::string &alias) const |
InviwoModuleFactoryObject * | getFactoryObject (const std::string &identifier) const |
std::vector< std::string > | findDependentModules (const std::string &module) const |
std::shared_ptr< std::function< void()> > | onModulesDidRegister (std::function< void()> callback) |
Register callback for monitoring when modules have been registered. Invoked in registerModules. | |
std::shared_ptr< std::function< void()> > | onModulesWillUnregister (std::function< void()> callback) |
Register callback for monitoring when modules have been registered. Invoked in unregisterModules. | |
const IdSet & | getProtectedModuleIdentifiers () const |
List of modules to keep during runtime library reloading. More... | |
bool | isProtected (const std::string &module) const |
void | addProtectedIdentifier (const std::string &id) |
void | reloadModules () |
Static Public Member Functions | |
static std::function< bool(const std::string &)> | getEnabledFilter () |
Manages finding, loading, unloading, reloading of Inviwo modules
const std::set< std::string, CaseInsensitiveCompare > & inviwo::ModuleManager::getProtectedModuleIdentifiers | ( | ) | const |
List of modules to keep during runtime library reloading.
Some modules such as Core can cause errors if unloaded. Append them to this list in your application to prevent them from being unloaded.
void inviwo::ModuleManager::registerModules | ( | RuntimeModuleLoading | ) |
Load modules from dynamic library files in the specified search paths.
Will recursively search for all dll/so/dylib/bundle files in the specified search paths. The library filename must contain "inviwo-module" to be loaded.
void inviwo::ModuleManager::unregisterModules | ( | ) |
Removes all modules not marked as protected by the application.
Use this function with care since all modules will be destroyed.