Chaste
Release::3.4
|
#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.
|
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 | ) |
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(), and AbstractCardiacTissue< SPACE_DIM >::LoadCardiacCells().
DynamicCellModelLoaderPtr DynamicModelLoaderRegistry::GetLoader | ( | const FileFinder & | rFileFinder | ) |
rFileFinder | finder for the .so file |
Definition at line 71 of file DynamicModelLoaderRegistry.cpp.
References FileFinder::GetAbsolutePath(), and GetLoader().
|
static |
Definition at line 39 of file DynamicModelLoaderRegistry.cpp.
References DynamicModelLoaderRegistry(), and mpInstance.
Referenced by CellMLToSharedLibraryConverter::Convert(), AbstractDynamicallyLoadableEntity::load(), AbstractCardiacTissue< SPACE_DIM >::LoadCardiacCells(), 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().
|
private |
Loaders to be deleted before creating any new ones.
Definition at line 91 of file DynamicModelLoaderRegistry.hpp.
Referenced by ScheduleForDeletion().
|
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().
|
staticprivate |
The single instance of this class.
The loader registry instance
Definition at line 94 of file DynamicModelLoaderRegistry.hpp.
Referenced by Instance().