#include <LOCA_Parameter_Library.H>
Public Member Functions | |
Library () | |
Default constructor. | |
~Library () | |
Destructor. | |
template<class ValueType > | |
void | setValue (const string &name, const ValueType &value) |
Set parameter given by name to value value. | |
template<class ValueType > | |
ValueType | getValue (const string &name) const |
Get parameter given by name. | |
template<class ObjectType , class ValueType > | |
bool | addParameterEntry (const string &name, ObjectType &object, ValueType ObjectType::*object_val_ptr) |
Add a new parameter to library using the default setting mechanism. | |
template<class FunctorType , class ValueType > | |
bool | addParameterEntry (const string &name, FunctorType *fctr) |
Add a new parameter to library using functor setting mechanism. | |
template<class ValueType > | |
bool | addParameterEntry (const string &name, Entry< ValueType > *entry) |
Add a new parameter using custom entry. | |
Protected Member Functions | |
Library (const Library &l) | |
Copy constructor. | |
Library & | operator= (const Library &l) |
Assignment operator. | |
ParameterMapIterator | getEntryMapIterator (const string &name) |
Finds the set of entries corresponding to parameter name and sets the iterator it to point to it. | |
ParameterMapConstIterator | getEntryMapIterator (const string &name) const |
Finds the set of entries corresponding to parameter name and sets the iterator it to point to it. | |
ValueTypeMapIterator | getEntryIterator (const string &valueTypeString, const ParameterMapIterator ¶mIterator) |
Finds the entry corresponding to entry valueTypeString for parameter corresponding to paramIterator and sets the iterator valueIterator to point to it. Returns false if there is no entry for type given by valueTypeString. | |
ValueTypeMapConstIterator | getEntryIterator (const string &valueTypeString, const ParameterMapConstIterator ¶mIterator) const |
Finds the entry corresponding to entry valueTypeString for parameter corresponding to paramIterator and sets the iterator valueIterator to point to it. Returns false if there is no entry for type given by valueTypeString. | |
template<class ValueType > | |
Entry< ValueType > & | getEntry (const string &name) |
Gets the entry corresponding to parameter name name and type ValueType. | |
template<class ValueType > | |
const Entry< ValueType > & | getEntry (const string &name) const |
Gets the entry corresponding to parameter name name and type ValueType. | |
template<class ValueType > | |
string | getTypeName () const |
Returns a string representation of type ValueType. | |
Protected Attributes | |
ParameterMap | library |
Library of Entries. | |
Private Types | |
typedef map< string, AbstractEntry * > | ValueTypeMap |
Map of entries for a parameter name. | |
typedef ValueTypeMap::const_iterator | ValueTypeMapConstIterator |
Const iterator for ValueTypeMap. | |
typedef ValueTypeMap::iterator | ValueTypeMapIterator |
Iterator for ValueTypeMap. | |
typedef map< string, ValueTypeMap * > | ParameterMap |
Map of maps for all parameter names. | |
typedef ParameterMap::const_iterator | ParameterMapConstIterator |
Const iterator for ParameterMap. | |
typedef ParameterMap::iterator | ParameterMapIterator |
Iterator for ParameterMap. |
This class provides a mechanism for setting and retrieving arbitrary numerical parameter values throughout an application code. Parameters can be material properties, coefficients in source functions, etc. The purpose of this class is to allow external libraries to set and retrieve parameters values to perform, for example, numerical continuation and optimization.
This class in currently under development and is far from complete.
Definition at line 76 of file LOCA_Parameter_Library.H.
typedef map<string, AbstractEntry*> LOCA::Parameter::Library::ValueTypeMap [private] |
typedef ValueTypeMap::const_iterator LOCA::Parameter::Library::ValueTypeMapConstIterator [private] |
typedef ValueTypeMap::iterator LOCA::Parameter::Library::ValueTypeMapIterator [private] |
typedef map<string, ValueTypeMap*> LOCA::Parameter::Library::ParameterMap [private] |
typedef ParameterMap::const_iterator LOCA::Parameter::Library::ParameterMapConstIterator [private] |
typedef ParameterMap::iterator LOCA::Parameter::Library::ParameterMapIterator [private] |
LOCA::Parameter::Library::Library | ( | ) | [inline] |
LOCA::Parameter::Library::~Library | ( | ) |
LOCA::Parameter::Library::Library | ( | const Library & | l | ) | [protected] |
void LOCA::Parameter::Library::setValue | ( | const string & | name, | |
const ValueType & | value | |||
) | [inline] |
Set parameter given by name to value value.
Definition at line 50 of file LOCA_Parameter_LibraryT.H.
References LOCA::Parameter::Entry< ValueType >::setValue().
ValueType LOCA::Parameter::Library::getValue | ( | const string & | name | ) | const [inline] |
Get parameter given by name.
Definition at line 61 of file LOCA_Parameter_LibraryT.H.
References LOCA::Parameter::Entry< ValueType >::getValue().
bool LOCA::Parameter::Library::addParameterEntry | ( | const string & | name, | |
ObjectType & | object, | |||
ValueType ObjectType::* | object_val_ptr | |||
) | [inline] |
Add a new parameter to library using the default setting mechanism.
Returns true if successful in adding entry to library, false otherwise.
Definition at line 72 of file LOCA_Parameter_LibraryT.H.
Referenced by addParameterEntry().
bool LOCA::Parameter::Library::addParameterEntry | ( | const string & | name, | |
FunctorType * | fctr | |||
) | [inline] |
Add a new parameter to library using functor setting mechanism.
Returns true if successful in adding entry to library, false otherwise.
Definition at line 100 of file LOCA_Parameter_LibraryT.H.
References addParameterEntry().
bool LOCA::Parameter::Library::addParameterEntry | ( | const string & | name, | |
Entry< ValueType > * | entry | |||
) | [inline] |
Add a new parameter using custom entry.
Returns true if successful in adding entry to library, false otherwise.
Definition at line 119 of file LOCA_Parameter_LibraryT.H.
References getEntryIterator(), getEntryMapIterator(), library, and LOCA::Parameter::Entry< ValueType >::setIsInLibrary().
LOCA::Parameter::Library & LOCA::Parameter::Library::operator= | ( | const Library & | l | ) | [protected] |
LOCA::Parameter::Library::ParameterMapIterator LOCA::Parameter::Library::getEntryMapIterator | ( | const string & | name | ) | [protected] |
Finds the set of entries corresponding to parameter name and sets the iterator it to point to it.
Definition at line 78 of file LOCA_Parameter_Library.C.
References library.
Referenced by addParameterEntry(), and getEntry().
LOCA::Parameter::Library::ParameterMapConstIterator LOCA::Parameter::Library::getEntryMapIterator | ( | const string & | name | ) | const [protected] |
Finds the set of entries corresponding to parameter name and sets the iterator it to point to it.
Definition at line 83 of file LOCA_Parameter_Library.C.
References library.
LOCA::Parameter::Library::ValueTypeMapIterator LOCA::Parameter::Library::getEntryIterator | ( | const string & | valueTypeString, | |
const ParameterMapIterator & | paramIterator | |||
) | [protected] |
Finds the entry corresponding to entry valueTypeString for parameter corresponding to paramIterator and sets the iterator valueIterator to point to it. Returns false if there is no entry for type given by valueTypeString.
Definition at line 88 of file LOCA_Parameter_Library.C.
Referenced by addParameterEntry(), and getEntry().
LOCA::Parameter::Library::ValueTypeMapConstIterator LOCA::Parameter::Library::getEntryIterator | ( | const string & | valueTypeString, | |
const ParameterMapConstIterator & | paramIterator | |||
) | const [protected] |
Finds the entry corresponding to entry valueTypeString for parameter corresponding to paramIterator and sets the iterator valueIterator to point to it. Returns false if there is no entry for type given by valueTypeString.
Definition at line 95 of file LOCA_Parameter_Library.C.
LOCA::Parameter::Entry< ValueType > & LOCA::Parameter::Library::getEntry | ( | const string & | name | ) | [inline, protected] |
Gets the entry corresponding to parameter name name and type ValueType.
Definition at line 166 of file LOCA_Parameter_LibraryT.H.
References getEntryIterator(), getEntryMapIterator(), and library.
const LOCA::Parameter::Entry< ValueType > & LOCA::Parameter::Library::getEntry | ( | const string & | name | ) | const [inline, protected] |
Gets the entry corresponding to parameter name name and type ValueType.
Definition at line 202 of file LOCA_Parameter_LibraryT.H.
References getEntryIterator(), getEntryMapIterator(), and library.
string LOCA::Parameter::Library::getTypeName | ( | ) | const [inline, protected] |
Returns a string representation of type ValueType.
Definition at line 160 of file LOCA_Parameter_LibraryT.H.
ParameterMap LOCA::Parameter::Library::library [protected] |
Library of Entries.
Definition at line 201 of file LOCA_Parameter_Library.H.
Referenced by addParameterEntry(), getEntry(), getEntryMapIterator(), operator=(), and ~Library().