#include <DynamicModelLoaderRegistry.hpp>
Public Member Functions | |
DynamicCellModelLoader * | GetLoader (const std::string &rPath) |
DynamicCellModelLoader * | GetLoader (const FileFinder &rFileFinder) |
~DynamicModelLoaderRegistry () | |
Static Public Member Functions | |
static DynamicModelLoaderRegistry * | Instance () |
Private Member Functions | |
DynamicModelLoaderRegistry () | |
DynamicModelLoaderRegistry (const DynamicModelLoaderRegistry &) | |
DynamicModelLoaderRegistry & | operator= (const DynamicModelLoaderRegistry &) |
Private Attributes | |
std::map< std::string, DynamicCellModelLoader * > | mLoaders |
Static Private Attributes | |
static std::auto_ptr < DynamicModelLoaderRegistry > | mpInstance |
When loading cell models dynamically, the loader object needs to be alive for as long as cells created by it are alive. Unfortunately, the HeartConfigRelatedCellFactory is typically destroyed as soon as the cells have been created, prior to the simulation. Hence, this class provides a static registry to keep track of the model loaders used. It also ensures we don't load a given .so more than once.
Definition at line 45 of file DynamicModelLoaderRegistry.hpp.
DynamicModelLoaderRegistry::~DynamicModelLoaderRegistry | ( | ) |
Destructor closes all loaded .so files.
Definition at line 58 of file DynamicModelLoaderRegistry.cpp.
References mLoaders.
DynamicModelLoaderRegistry::DynamicModelLoaderRegistry | ( | ) | [private] |
Private constructor; all access should be via Instance().
Definition at line 69 of file DynamicModelLoaderRegistry.cpp.
Referenced by Instance().
DynamicModelLoaderRegistry::DynamicModelLoaderRegistry | ( | const DynamicModelLoaderRegistry & | ) | [private] |
Copy constructor.
DynamicCellModelLoader * DynamicModelLoaderRegistry::GetLoader | ( | const FileFinder & | rFileFinder | ) |
Get the loader for the given .so file.
rFileFinder | finder for the .so file |
Definition at line 53 of file DynamicModelLoaderRegistry.cpp.
References FileFinder::GetAbsolutePath(), and GetLoader().
DynamicCellModelLoader * DynamicModelLoaderRegistry::GetLoader | ( | const std::string & | rPath | ) |
Get the loader for the given .so file.
rPath | absolute path to the .so |
Definition at line 41 of file DynamicModelLoaderRegistry.cpp.
References mLoaders.
Referenced by CellMLToSharedLibraryConverter::Convert(), GetLoader(), AbstractCardiacTissue< SPACE_DIM >::LoadCardiacCells(), and ExtendedBidomainTissue< DIM >::LoadExtendedBidomainCells().
DynamicModelLoaderRegistry * DynamicModelLoaderRegistry::Instance | ( | ) | [static] |
Get the single instance of the registry.
Definition at line 32 of file DynamicModelLoaderRegistry.cpp.
References DynamicModelLoaderRegistry(), and mpInstance.
Referenced by CellMLToSharedLibraryConverter::Convert(), AbstractDynamicallyLoadableEntity::load(), AbstractCardiacTissue< SPACE_DIM >::LoadCardiacCells(), and ExtendedBidomainTissue< DIM >::LoadExtendedBidomainCells().
DynamicModelLoaderRegistry& DynamicModelLoaderRegistry::operator= | ( | const DynamicModelLoaderRegistry & | ) | [private] |
Overloaded assignment operator.
std::map<std::string, DynamicCellModelLoader*> DynamicModelLoaderRegistry::mLoaders [private] |
Loaders for shared-library cell models. Map is from absolute path of the library, to loader object.
Definition at line 75 of file DynamicModelLoaderRegistry.hpp.
Referenced by GetLoader(), and ~DynamicModelLoaderRegistry().
std::auto_ptr< DynamicModelLoaderRegistry > DynamicModelLoaderRegistry::mpInstance [static, private] |
The single instance of this class.
The loader registry instance
Definition at line 78 of file DynamicModelLoaderRegistry.hpp.
Referenced by Instance().