Chaste Release::3.1
|
#include <DynamicModelLoaderRegistry.hpp>
Public Member Functions | |
DynamicCellModelLoaderPtr | GetLoader (const std::string &rPath) |
DynamicCellModelLoaderPtr | GetLoader (const FileFinder &rFileFinder) |
void | ScheduleForDeletion (DynamicCellModelLoaderPtr pLoader) |
Static Public Member Functions | |
static DynamicModelLoaderRegistry * | Instance () |
Private Member Functions | |
DynamicModelLoaderRegistry () | |
Private Attributes | |
std::map< std::string, DynamicCellModelLoaderWeakPtr > | mLoaders |
std::set < DynamicCellModelLoaderPtr > | mDeletableLoaders |
Static Private Attributes | |
static std::auto_ptr < DynamicModelLoaderRegistry > | mpInstance |
This class provides a static registry to keep track of the cell model loaders used, hence ensuring that we don't have a given .so loaded more than once at any given point.
Definition at line 54 of file DynamicModelLoaderRegistry.hpp.
DynamicModelLoaderRegistry::DynamicModelLoaderRegistry | ( | ) | [private] |
Private constructor; all access should be via Instance().
Definition at line 81 of file DynamicModelLoaderRegistry.cpp.
Referenced by Instance().
DynamicCellModelLoaderPtr DynamicModelLoaderRegistry::GetLoader | ( | const std::string & | rPath | ) |
Get the loader for the given .so file.
rPath | absolute path to the .so |
Definition at line 48 of file DynamicModelLoaderRegistry.cpp.
References DynamicCellModelLoader::Create(), mLoaders, and ScheduleForDeletion().
Referenced by CellMLToSharedLibraryConverter::Convert(), GetLoader(), AbstractCardiacTissue< SPACE_DIM >::LoadCardiacCells(), and ExtendedBidomainTissue< DIM >::LoadExtendedBidomainCells().
DynamicCellModelLoaderPtr DynamicModelLoaderRegistry::GetLoader | ( | const FileFinder & | rFileFinder | ) |
Get the loader for the given .so file.
rFileFinder | finder for the .so file |
Definition at line 71 of file DynamicModelLoaderRegistry.cpp.
References FileFinder::GetAbsolutePath(), and GetLoader().
DynamicModelLoaderRegistry * DynamicModelLoaderRegistry::Instance | ( | ) | [static] |
Get the single instance of the registry.
Definition at line 39 of file DynamicModelLoaderRegistry.cpp.
References DynamicModelLoaderRegistry(), and mpInstance.
Referenced by CellMLToSharedLibraryConverter::Convert(), AbstractDynamicallyLoadableEntity::load(), AbstractCardiacTissue< SPACE_DIM >::LoadCardiacCells(), ExtendedBidomainTissue< DIM >::LoadExtendedBidomainCells(), and AbstractDynamicallyLoadableEntity::~AbstractDynamicallyLoadableEntity().
void DynamicModelLoaderRegistry::ScheduleForDeletion | ( | DynamicCellModelLoaderPtr | pLoader | ) |
Schedule the given loader for deletion prior to loading any new .so.
pLoader | the loader to schedule for deletion |
Definition at line 76 of file DynamicModelLoaderRegistry.cpp.
References mDeletableLoaders.
Referenced by GetLoader(), and AbstractDynamicallyLoadableEntity::~AbstractDynamicallyLoadableEntity().
std::set<DynamicCellModelLoaderPtr> DynamicModelLoaderRegistry::mDeletableLoaders [private] |
Loaders to be deleted before creating any new ones.
Definition at line 91 of file DynamicModelLoaderRegistry.hpp.
Referenced by ScheduleForDeletion().
std::map<std::string, DynamicCellModelLoaderWeakPtr> DynamicModelLoaderRegistry::mLoaders [private] |
Loaders for shared-library cell models. Weak pointers are used so that the registry doesn't keep loaders alive when all cells created from them have been destroyed. Map is from absolute path of the library, to loader object.
Definition at line 88 of file DynamicModelLoaderRegistry.hpp.
Referenced by GetLoader().
std::auto_ptr< DynamicModelLoaderRegistry > DynamicModelLoaderRegistry::mpInstance [static, private] |
The single instance of this class.
The loader registry instance
Definition at line 94 of file DynamicModelLoaderRegistry.hpp.
Referenced by Instance().