Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::ModuleManager Class Reference

#include <modulemanager.h>

Public Member Functions

 ModuleManager (InviwoApplication *app)
 
 ModuleManager (const ModuleManager &rhs)=delete
 
ModuleManageroperator= (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 (std::vector< ModuleContainer > moduleFactories)
 
void registerModules (RuntimeModuleLoading, std::function< bool(std::string_view)> filter=ModuleManager::getEnabledFilter())
 Load modules from dynamic library files in the specified search paths.
 
std::vector< ModuleContainerfindRuntimeModules (std::span< const std::filesystem::path > searchPaths)
 
std::vector< ModuleContainerfindRuntimeModules (std::span< const std::filesystem::path > searchPaths, std::function< bool(std::string_view)> filter)
 
std::vector< ModuleContainerfindRuntimeModules (std::span< const std::filesystem::path > searchPaths, std::function< bool(std::string_view)> filter, bool runtimeReloading)
 
auto getInviwoModules ()
 
auto getInviwoModules () const
 
auto getFactoryObjects ()
 
size_t size () const
 
template<class T >
T * getModuleByType () const
 
InviwoModulegetModuleByIdentifier (std::string_view identifier) const
 
InviwoModulegetModuleByIndex (size_t index) const
 
std::vector< InviwoModule * > getModulesByAlias (std::string_view alias) const
 
InviwoModuleFactoryObjectgetFactoryObject (std::string_view identifier) const
 
std::vector< std::string > findDependentModules (std::string_view 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.
 
void reloadModules ()
 
void setModuleLocator (std::function< std::filesystem::path(const InviwoModule &)> moduleLocator)
 
std::filesystem::path locateModule (const InviwoModule &) const
 

Static Public Member Functions

static std::function< bool(std::string_view)> getEnabledFilter ()
 

Detailed Description

Manages finding, loading, unloading, reloading of Inviwo modules

Member Function Documentation

◆ registerModules()

void inviwo::ModuleManager::registerModules ( RuntimeModuleLoading ,
std::function< bool(std::string_view)> filter = ModuleManager::getEnabledFilter() )

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.

Note
Which modules to load can be specified by creating a file (application_name-enabled-modules.txt) containing the names of the modules to load.

The documentation for this class was generated from the following file: