Chaste  Build::
BaseParameterInstance Class Reference

#include <BaseParameterInstance.hpp>

+ Inheritance diagram for BaseParameterInstance:
+ Collaboration diagram for BaseParameterInstance:

Public Member Functions

 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 ()
 
virtual std::string GetValueAsString ()
 
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< BaseParameterInstanceCreate ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::string mName
 
std::string mShortDescription
 
std::string mSourceInformation
 
std::string mSymbol
 
units::quantity< unit::dimensionless > mBaseValue
 

Friends

class boost::serialization::access
 
std::ostream & operator<< (std::ostream &stream, const boost::shared_ptr< BaseParameterInstance > &rParameter)
 

Detailed Description

This is a class for storing often used parameters and their metadata, such as a short textual description, bib information from a paper and units. It is templated over unit type. Specific parameter values can inherit from this class, with hard-coded metadata. The main purpose of this class is to allow storage of many derived classes in the same map in a ParameterCollection.

Definition at line 52 of file BaseParameterInstance.hpp.

Constructor & Destructor Documentation

BaseParameterInstance::BaseParameterInstance ( )

Constructor

Definition at line 39 of file BaseParameterInstance.cpp.

BaseParameterInstance::BaseParameterInstance ( const std::string &  rName,
const std::string &  rShortDescription,
const std::string &  rSymbol,
const std::string &  rBibliographicInfromation 
)

Constructor

Parameters
rNamethe named by which it will be keyed in the ParameterCollection
rShortDescriptiona short description of the parameter
rSymbola symbol, as it may appear in the literature
rBibliographicInfromationa Bibtex formatted literature source.

Definition at line 49 of file BaseParameterInstance.cpp.

BaseParameterInstance::~BaseParameterInstance ( )
virtual

Destructor

Definition at line 62 of file BaseParameterInstance.cpp.

Member Function Documentation

boost::shared_ptr< BaseParameterInstance > BaseParameterInstance::Create ( )
static

Factory constructor method

Returns
a shared pointer to a new instance

Definition at line 67 of file BaseParameterInstance.cpp.

std::string BaseParameterInstance::GetBibliographicInformation ( )

Return the bibliographic information

Returns
the bibliographic information

Definition at line 85 of file BaseParameterInstance.cpp.

References mSourceInformation.

std::string BaseParameterInstance::GetName ( )

Return the parameter name

Returns
the parameter name as a string

Definition at line 90 of file BaseParameterInstance.cpp.

References mName.

std::string BaseParameterInstance::GetShortDescription ( )

Return the short description

Returns
the short description

Definition at line 100 of file BaseParameterInstance.cpp.

References mShortDescription.

std::string BaseParameterInstance::GetSymbol ( )

Return the parameter symbol

Returns
the parameter symbol

Definition at line 95 of file BaseParameterInstance.cpp.

References mSymbol.

std::string BaseParameterInstance::GetValueAsString ( )
virtual

Return the value of the parameter as a string, with units

Returns
the value of the parameter

Reimplemented in ParameterInstance< UNIT >.

Definition at line 78 of file BaseParameterInstance.cpp.

References mBaseValue.

void BaseParameterInstance::RegisterWithCollection ( const std::string &  rCallingClass)

Register the parameter with a ParameterCollection

Parameters
rCallingClassthe name of the class calling this method.

Definition at line 73 of file BaseParameterInstance.cpp.

References ParameterCollection::AddParameter(), and ParameterCollection::Instance().

Referenced by ParameterInstance< UNIT >::GetValue().

template<class Archive >
void BaseParameterInstance::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

Do the serialize

Parameters
arthe archive
versionthe archive version number

Definition at line 65 of file BaseParameterInstance.hpp.

References mName, mShortDescription, and mSourceInformation.

void BaseParameterInstance::SetBibliographicInformation ( const std::string &  rSourceInformation)

Set the bibliographic information

Parameters
rSourceInformationthe bibliographic information

Definition at line 105 of file BaseParameterInstance.cpp.

References mSourceInformation.

void BaseParameterInstance::SetName ( const std::string &  rName)

Set the parameter name, this is used to distinguish it in the ParameterCollection map

Parameters
rNamethe short description

Definition at line 110 of file BaseParameterInstance.cpp.

References mName.

void BaseParameterInstance::SetShortDescription ( const std::string &  rShortDescription)

Set the short description of the parameter

Parameters
rShortDescriptionthe short description

Definition at line 115 of file BaseParameterInstance.cpp.

References mShortDescription.

void BaseParameterInstance::SetSymbol ( const std::string &  rSymbol)

Set the sybmol for the parameter

Parameters
rSymbolthe symbol

Definition at line 120 of file BaseParameterInstance.cpp.

References mSymbol.

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Archiving

Definition at line 57 of file BaseParameterInstance.hpp.

std::ostream& operator<< ( std::ostream &  stream,
const boost::shared_ptr< BaseParameterInstance > &  rParameter 
)
friend

Override for nicer printing

Parameters
streamthe input stream
rParameterthe class instance
Returns
the output stream

Definition at line 125 of file BaseParameterInstance.cpp.

Member Data Documentation

units::quantity<unit::dimensionless> BaseParameterInstance::mBaseValue
private

A dimensionless parameter value.

Definition at line 95 of file BaseParameterInstance.hpp.

Referenced by GetValueAsString().

std::string BaseParameterInstance::mName
private

A name to distinguish it in a ParameterCollection

Definition at line 75 of file BaseParameterInstance.hpp.

Referenced by GetName(), serialize(), and SetName().

std::string BaseParameterInstance::mShortDescription
private

A short string based description

Definition at line 80 of file BaseParameterInstance.hpp.

Referenced by GetShortDescription(), serialize(), and SetShortDescription().

std::string BaseParameterInstance::mSourceInformation
private

Information on the parameter source, such as bibliographic information

Definition at line 85 of file BaseParameterInstance.hpp.

Referenced by GetBibliographicInformation(), serialize(), and SetBibliographicInformation().

std::string BaseParameterInstance::mSymbol
private

A symbol, as it might appear with a literature source

Definition at line 90 of file BaseParameterInstance.hpp.

Referenced by GetSymbol(), and SetSymbol().


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