![]() |
Chaste
Build::
|
#include <ParameterInstance.hpp>
Inheritance diagram for ParameterInstance< UNIT >:
Collaboration diagram for ParameterInstance< UNIT >:Public Member Functions | |
| ParameterInstance () | |
| ParameterInstance (units::quantity< UNIT > value, const std::string &rName, const std::string &rShortDescription, const std::string &rSymbol, const std::string &rBibliographicInfromation) | |
| virtual | ~ParameterInstance () |
| virtual std::string | GetValueAsString () |
| units::quantity< UNIT > | GetValue (const std::string &rCallingClass="User", bool addToCollection=true) |
| void | SetValue (units::quantity< UNIT > value) |
Public Member Functions inherited from BaseParameterInstance | |
| BaseParameterInstance () | |
| BaseParameterInstance (const std::string &rName, const std::string &rShortDescription, const std::string &rSymbol, const std::string &rBibliographicInfromation) | |
| virtual | ~BaseParameterInstance () |
| std::string | GetName () |
| std::string | GetBibliographicInformation () |
| std::string | GetShortDescription () |
| std::string | GetSymbol () |
| void | RegisterWithCollection (const std::string &rCallingClass) |
| void | SetBibliographicInformation (const std::string &rSourceInformation) |
| void | SetName (const std::string &rName) |
| void | SetShortDescription (const std::string &rShortDescription) |
| void | SetSymbol (const std::string &rSymbol) |
Static Public Member Functions | |
| static boost::shared_ptr< ParameterInstance< UNIT > > | Create () |
| static boost::shared_ptr< ParameterInstance< UNIT > > | Create (units::quantity< UNIT > value, const std::string &rName, const std::string &rShortDescription, const std::string &rSymbol, const std::string &rBibliographicInfromation) |
Static Public Member Functions inherited from BaseParameterInstance | |
| static boost::shared_ptr< BaseParameterInstance > | Create () |
Private Member Functions | |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
Private Attributes | |
| units::quantity< UNIT > | mValue |
Friends | |
| class | boost::serialization::access |
This is a concrete class for storing parameters. It inherits from BaseParameterInstance to allow a heterogenous collection of parameters to be stored in the ParameterCollection. When GetValue is called a class instance will be added to the ParameterCollection singleton. It should also be supplied with a descriptive name for where it is being called from, e.g. by "User" or with a class name.
Definition at line 53 of file ParameterInstance.hpp.
| ParameterInstance< UNIT >::ParameterInstance | ( | ) |
Constructor
Definition at line 39 of file ParameterInstance.cpp.
| ParameterInstance< UNIT >::ParameterInstance | ( | units::quantity< UNIT > | value, |
| const std::string & | rName, | ||
| const std::string & | rShortDescription, | ||
| const std::string & | rSymbol, | ||
| const std::string & | rBibliographicInfromation | ||
| ) |
Constructor with some present values
| value | the quantity form the parameter |
| rName | the named by which it will be keyed in the ParameterCollection |
| rShortDescription | a short description of the parameter |
| rSymbol | a symbol, as it may appear in the literature |
| rBibliographicInfromation | a Bibtex formatted literature source. |
Definition at line 47 of file ParameterInstance.cpp.
|
virtual |
Destructor
Definition at line 59 of file ParameterInstance.cpp.
|
static |
Factory constructor method
Definition at line 65 of file ParameterInstance.cpp.
|
static |
Factory constructor method
| value | the quantity form the parameter |
| rName | the named by which it will be keyed in the ParameterCollection |
| rShortDescription | a short description of the parameter |
| rSymbol | a symbol, as it may appear in the literature |
| rBibliographicInfromation | a Bibtex formatted literature source. |
Definition at line 72 of file ParameterInstance.cpp.
| units::quantity< UNIT > ParameterInstance< UNIT >::GetValue | ( | const std::string & | rCallingClass = "User", |
| bool | addToCollection = true |
||
| ) |
Get the value of the parameter. IMPORTANT. This call is expensive as the instance will try to add itself automatically to the ParameterCollection by default. This requires a map lookup and insert. This should be called once per 'scope' to get the value of the parameter into a temporary.
| rCallingClass | the name of the class calling this method, or "User" if it is being called directly in a test or main(). |
| addToCollection | whether to add self to the parameter collection. |
Definition at line 83 of file ParameterInstance.cpp.
References ParameterInstance< UNIT >::mValue, and BaseParameterInstance::RegisterWithCollection().
|
virtual |
Over-ridden method to get the value of the parameter as a "Value Unit" string (e.g. "2.0 kg"). It is used in the ParameterCollection which only stores BaseParameterInstance pointers.
Reimplemented from BaseParameterInstance.
Definition at line 95 of file ParameterInstance.cpp.
References ParameterInstance< UNIT >::mValue.
|
inlineprivate |
Do the serialize
| ar | the archive |
| version | the archive version number |
Definition at line 66 of file ParameterInstance.hpp.
References ParameterInstance< UNIT >::mValue.
| void ParameterInstance< UNIT >::SetValue | ( | units::quantity< UNIT > | value | ) |
Set the value of the parameter
| value | the value of the parameter |
Definition at line 103 of file ParameterInstance.cpp.
References ParameterInstance< UNIT >::mValue.
|
friend |
Archiving
Definition at line 58 of file ParameterInstance.hpp.
|
private |
The value of the parameter
Definition at line 75 of file ParameterInstance.hpp.
Referenced by ParameterInstance< UNIT >::GetValue(), ParameterInstance< UNIT >::GetValueAsString(), ParameterInstance< UNIT >::serialize(), and ParameterInstance< UNIT >::SetValue().