OpenWalnut 1.3.1
|
Loads module prototypes from shared objects in a given directory and injects it into the module factory. More...
#include <WModuleLoader.h>
Public Member Functions | |
WModuleLoader () | |
Constructor. | |
~WModuleLoader () | |
Destructor, closes all handles to shared libraries. | |
void | load (WSharedAssociativeContainer< std::set< boost::shared_ptr< WModule > > >::WriteTicket ticket) |
Load the module prototypes from the shared libraries. | |
Static Public Member Functions | |
static std::string | getModulePrefix () |
Returns the prefix of a shared module library filename. | |
Private Member Functions | |
void | load (WSharedAssociativeContainer< std::set< boost::shared_ptr< WModule > > >::WriteTicket ticket, boost::filesystem::path dir, unsigned int level=0) |
Load the module prototypes from the shared libraries from the specified directory. | |
Private Attributes | |
std::vector< boost::shared_ptr < WSharedLib > > | m_libs |
All the loaded shared libraries. |
Loads module prototypes from shared objects in a given directory and injects it into the module factory.
Definition at line 44 of file WModuleLoader.h.
WModuleLoader::WModuleLoader | ( | ) | [explicit] |
Constructor.
It does not load any files. Use load to do this.
Definition at line 39 of file WModuleLoader.cpp.
WModuleLoader::~WModuleLoader | ( | ) |
Destructor, closes all handles to shared libraries.
Definition at line 44 of file WModuleLoader.cpp.
References m_libs.
std::string WModuleLoader::getModulePrefix | ( | ) | [static] |
Returns the prefix of a shared module library filename.
Definition at line 165 of file WModuleLoader.cpp.
References WSharedLib::getSystemPrefix().
Referenced by load().
void WModuleLoader::load | ( | WSharedAssociativeContainer< std::set< boost::shared_ptr< WModule > > >::WriteTicket | ticket, |
boost::filesystem::path | dir, | ||
unsigned int | level = 0 |
||
) | [private] |
Load the module prototypes from the shared libraries from the specified directory.
It traverses the subdirectories and searches there. Traversion depth is 1.
ticket | A write ticket to a shared container. |
dir | the directory to load |
level | the traversion level |
Definition at line 50 of file WModuleLoader.cpp.
References WLogger::addLogMessage(), wlog::debug(), WLogger::getLogger(), getModulePrefix(), WPathHelper::getModuleResourcePath(), WSharedLib::getSystemSuffix(), load(), m_libs, and WException::what().
void WModuleLoader::load | ( | WSharedAssociativeContainer< std::set< boost::shared_ptr< WModule > > >::WriteTicket | ticket | ) |
Load the module prototypes from the shared libraries.
ticket | A write ticket to a shared container. |
Definition at line 141 of file WModuleLoader.cpp.
References WLogger::addLogMessage(), WPathHelper::getAllModulePaths(), and WLogger::getLogger().
Referenced by load(), and WModuleFactory::load().
std::vector< boost::shared_ptr< WSharedLib > > WModuleLoader::m_libs [private] |
All the loaded shared libraries.
Get freed on destruction. So do NOT free this instance while the libs are used.
Definition at line 76 of file WModuleLoader.h.
Referenced by load(), and ~WModuleLoader().