Chaste
Build::
|
#include <ParameterCollection.hpp>
Public Member Functions | |
void | AddParameter (boost::shared_ptr< BaseParameterInstance > pParameter, const std::string &rFirstInstantiated) |
void | DumpToFile (const std::string &rFilename) |
boost::shared_ptr< BaseParameterInstance > | GetParameter (const std::string &rName) |
Static Public Member Functions | |
static ParameterCollection * | Instance () |
static boost::shared_ptr< ParameterCollection > | SharedInstance () |
static void | Destroy () |
Protected Member Functions | |
ParameterCollection () | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
Private Attributes | |
std::map< std::string, std::pair< std::string, boost::shared_ptr< BaseParameterInstance > > > | mParameters |
Static Private Attributes | |
static boost::shared_ptr< ParameterCollection > | mpInstance = boost::shared_ptr<ParameterCollection>() |
Friends | |
class | boost::serialization::access |
This singleton holds parameter values used in a simulation. It allows the value of parameters used in a simulation to be dumped to file on completion. New parameters can be added at run-time, which can hold meta-data on parameter sources.
Definition at line 54 of file ParameterCollection.hpp.
|
protected |
Default constructor
Sets up an initial parameter collection on construction
Definition at line 66 of file ParameterCollection.cpp.
References mpInstance.
Referenced by Instance(), and SharedInstance().
void ParameterCollection::AddParameter | ( | boost::shared_ptr< BaseParameterInstance > | pParameter, |
const std::string & | rFirstInstantiated | ||
) |
Add a parameter
pParameter | the parameter to add, note it is a base class pointer |
rFirstInstantiated | the class where it is first instantiated |
Definition at line 101 of file ParameterCollection.cpp.
References mParameters.
Referenced by BaseParameterInstance::RegisterWithCollection().
|
static |
Destroy the current ParameterCollection instance.
Definition at line 115 of file ParameterCollection.cpp.
References mpInstance.
Referenced by Instance(), and SharedInstance().
void ParameterCollection::DumpToFile | ( | const std::string & | rFilename | ) |
Dump the parameters to file
rFilename | the file to dump to |
Definition at line 74 of file ParameterCollection.cpp.
References mParameters.
boost::shared_ptr< BaseParameterInstance > ParameterCollection::GetParameter | ( | const std::string & | rName | ) |
Return a parameter, note it is returned as a base class pointer. It may need to be cast to an expected class type.
rName | the name of the parameter to return. |
Definition at line 96 of file ParameterCollection.cpp.
References mParameters.
|
static |
Definition at line 46 of file ParameterCollection.cpp.
References Destroy(), mpInstance, and ParameterCollection().
Referenced by BaseParameterInstance::RegisterWithCollection().
|
inlineprivate |
Serialization of a ParameterCollection object must be done with care. Do not serialize this singleton directly. Instead, serialize the object returned by GetSerializationWrapper.
archive | the archive |
version | the current version of this class |
Definition at line 130 of file ParameterCollection.hpp.
References mParameters.
|
static |
Definition at line 56 of file ParameterCollection.cpp.
References Destroy(), mpInstance, and ParameterCollection().
|
friend |
Needed for serialization.
Definition at line 119 of file ParameterCollection.hpp.
|
private |
Parameter Collection
Definition at line 64 of file ParameterCollection.hpp.
Referenced by AddParameter(), DumpToFile(), GetParameter(), and serialize().
|
staticprivate |
A pointer to the singleton instance of this class.
Pointer to the single instance
Definition at line 59 of file ParameterCollection.hpp.
Referenced by Destroy(), Instance(), ParameterCollection(), and SharedInstance().