Chaste Release::3.1
DynamicCellModelLoader Class Reference

#include <DynamicCellModelLoader.hpp>

Inheritance diagram for DynamicCellModelLoader:
Collaboration diagram for DynamicCellModelLoader:

List of all members.

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 111 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

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 
)

Create a new 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

Absolute path to the .so file we have loaded.

Definition at line 118 of file DynamicCellModelLoader.hpp.

Referenced by GetLoadableModulePath().

Our cell creation function

Definition at line 115 of file DynamicCellModelLoader.hpp.

Referenced by DynamicCellModelLoader().

Handle for the loaded .so file

Definition at line 104 of file DynamicCellModelLoader.hpp.

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


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