Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
|
#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::shared_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 FileFinder & | rFileFinder | ) |
rFileFinder | finder for the .so file |
Definition at line 71 of file DynamicModelLoaderRegistry.cpp.
References FileFinder::GetAbsolutePath(), and GetLoader().
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< ELEMENT_DIM, SPACE_DIM >::LoadCardiacCells().
|
static |
Definition at line 39 of file DynamicModelLoaderRegistry.cpp.
References DynamicModelLoaderRegistry(), and mpInstance.
Referenced by AbstractDynamicallyLoadableEntity::~AbstractDynamicallyLoadableEntity(), CellMLToSharedLibraryConverter::Convert(), AbstractDynamicallyLoadableEntity::load(), and AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::LoadCardiacCells().
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 AbstractDynamicallyLoadableEntity::~AbstractDynamicallyLoadableEntity(), and GetLoader().
|
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().