Chaste  Release::2018.1
DynamicCellModelLoader Class Reference

#include <DynamicCellModelLoader.hpp>

+ Inheritance diagram for DynamicCellModelLoader:
+ Collaboration diagram for DynamicCellModelLoader:

Public Member Functions

 ~DynamicCellModelLoader ()
 
AbstractCardiacCellInterfaceCreateCell (boost::shared_ptr< AbstractIvpOdeSolver > pSolver, boost::shared_ptr< AbstractStimulusFunction > pStimulus)
 
const std::string GetLoadableModulePath () const
 

Static Public Member Functions

static DynamicCellModelLoaderPtr Create (const std::string &rLoadableModulePath)
 

Private Types

typedef
AbstractCardiacCellInterface
CellCreationFunctionType (boost::shared_ptr< AbstractIvpOdeSolver > pSolver, boost::shared_ptr< AbstractStimulusFunction > pStimulus)
 

Private Member Functions

 DynamicCellModelLoader (const std::string &rLoadableModulePath)
 

Private Attributes

void * mpDynamicModule
 
CellCreationFunctionTypempCreationFunction
 
std::string mLoadableModulePath
 

Detailed Description

This class takes care of loading cell models at run-time from .so files.

Instantiate it using the factory function Create with the path of a suitable .so file, then call CreateCell to create individual cells.

Definition at line 59 of file DynamicCellModelLoader.hpp.

Member Typedef Documentation

typedef AbstractCardiacCellInterface* DynamicCellModelLoader::CellCreationFunctionType(boost::shared_ptr< AbstractIvpOdeSolver > pSolver, boost::shared_ptr< AbstractStimulusFunction > pStimulus)
private

Type of the cell creation function in the .so files

Parameters
pSolverODE solver used to simulate the cell
pStimulusintracellular stimulus

Definition at line 112 of file DynamicCellModelLoader.hpp.

Constructor & Destructor Documentation

DynamicCellModelLoader::~DynamicCellModelLoader ( )

Destructor. Closes the .so file.

Definition at line 75 of file DynamicCellModelLoader.cpp.

References mpDynamicModule.

DynamicCellModelLoader::DynamicCellModelLoader ( const std::string &  rLoadableModulePath)
private

Private constructor to ensure we're always stored in a shared pointer.

Parameters
rLoadableModulePathpath to .so file

Definition at line 51 of file DynamicCellModelLoader.cpp.

References EXCEPTION, mpCreationFunction, and mpDynamicModule.

Referenced by Create().

Member Function Documentation

DynamicCellModelLoaderPtr DynamicCellModelLoader::Create ( const std::string &  rLoadableModulePath)
static

Create a cell model loader by opening a loadable module (.so file) containing a cell model.

Note
The loader object must remain alive for as long as you want to use cells created with it, or you'll get a segfault. Hence the constructor is private, and this factory function must be used to create a loader.
Parameters
rLoadableModulePathpath to .so file
Returns
loader object

Definition at line 44 of file DynamicCellModelLoader.cpp.

References DynamicCellModelLoader().

Referenced by DynamicModelLoaderRegistry::GetLoader().

AbstractCardiacCellInterface * DynamicCellModelLoader::CreateCell ( boost::shared_ptr< AbstractIvpOdeSolver pSolver,
boost::shared_ptr< AbstractStimulusFunction pStimulus 
)
Returns
a newly created cardiac cell from this dynamic module.

The caller takes responsibility for deleting the cell when it's finished with.

Parameters
pSolverODE solver used to simulate the cell
pStimulusintracellular stimulus

Definition at line 83 of file DynamicCellModelLoader.cpp.

const std::string DynamicCellModelLoader::GetLoadableModulePath ( ) const
Returns
the absolute path to the .so file we have loaded

Definition at line 95 of file DynamicCellModelLoader.cpp.

References mLoadableModulePath.

Member Data Documentation

std::string DynamicCellModelLoader::mLoadableModulePath
private

Absolute path to the .so file we have loaded.

Definition at line 119 of file DynamicCellModelLoader.hpp.

Referenced by GetLoadableModulePath().

CellCreationFunctionType* DynamicCellModelLoader::mpCreationFunction
private

Our cell creation function

Definition at line 116 of file DynamicCellModelLoader.hpp.

Referenced by DynamicCellModelLoader().

void* DynamicCellModelLoader::mpDynamicModule
private

Handle for the loaded .so file

Definition at line 105 of file DynamicCellModelLoader.hpp.

Referenced by DynamicCellModelLoader(), and ~DynamicCellModelLoader().


The documentation for this class was generated from the following files: