NOX Development
Loading...
Searching...
No Matches
LOCA::Parameter::Library Class Reference

Class to provide a centralized library for setting/retrieving numerical parameter values in application codes. More...

#include <LOCA_Parameter_Library.H>

Public Member Functions

 Library ()
 Default constructor.
 ~Library ()
 Destructor.
template<class ValueType>
void setValue (const std::string &name, const ValueType &value)
 Set parameter given by name to value value.
template<class ValueType>
ValueType getValue (const std::string &name) const
 Get parameter given by name.
template<class ObjectType, class ValueType>
bool addParameterEntry (const std::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 std::string &name, FunctorType *fctr)
 Add a new parameter to library using functor setting mechanism.
template<class ValueType>
bool addParameterEntry (const std::string &name, Entry< ValueType > *entry)
 Add a new parameter using custom entry.
template<class ValueType>
LOCA::Parameter::Entry< ValueType > & getEntry (const std::string &name)
template<class ValueType>
const LOCA::Parameter::Entry< ValueType > & getEntry (const std::string &name) const

Protected Member Functions

 Library (const Library &l)
 Copy constructor.
Libraryoperator= (const Library &l)
 Assignment operator.
ParameterMapIterator getEntryMapIterator (const std::string &name)
 Finds the set of entries corresponding to parameter name and sets the iterator it to point to it.
ParameterMapConstIterator getEntryMapIterator (const std::string &name) const
 Finds the set of entries corresponding to parameter name and sets the iterator it to point to it.
ValueTypeMapIterator getEntryIterator (const std::string &valueTypeString, const ParameterMapIterator &paramIterator)
 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 std::string &valueTypeString, const ParameterMapConstIterator &paramIterator) 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 std::string &name)
 Gets the entry corresponding to parameter name name and type ValueType.
template<class ValueType>
const Entry< ValueType > & getEntry (const std::string &name) const
 Gets the entry corresponding to parameter name name and type ValueType.
template<class ValueType>
std::string getTypeName () const
 Returns a std::string representation of type ValueType.

Protected Attributes

ParameterMap library
 Library of Entries.

Detailed Description

Class to provide a centralized library for setting/retrieving numerical parameter values in application codes.

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.

Constructor & Destructor Documentation

◆ Library() [1/2]

LOCA::Parameter::Library::Library ( )
inline

Default constructor.

References library.

◆ ~Library()

LOCA::Parameter::Library::~Library ( )

Destructor.

References library.

◆ Library() [2/2]

LOCA::Parameter::Library::Library ( const Library & l)
protected

Copy constructor.

References library.

Member Function Documentation

◆ addParameterEntry() [1/3]

template<class ValueType>
bool LOCA::Parameter::Library::addParameterEntry ( const std::string & name,
Entry< ValueType > * entry )

Add a new parameter using custom entry.

Returns true if successful in adding entry to library, false otherwise.

References getEntryIterator(), getEntryMapIterator(), getTypeName(), library, and LOCA::Parameter::Entry< ValueType >::setIsInLibrary().

◆ addParameterEntry() [2/3]

template<class FunctorType, class ValueType>
bool LOCA::Parameter::Library::addParameterEntry ( const std::string & name,
FunctorType * fctr )

Add a new parameter to library using functor setting mechanism.

Returns true if successful in adding entry to library, false otherwise.

References addParameterEntry().

◆ addParameterEntry() [3/3]

template<class ObjectType, class ValueType>
bool LOCA::Parameter::Library::addParameterEntry ( const std::string & name,
ObjectType & object,
ValueType ObjectType::* object_val_ptr )

Add a new parameter to library using the default setting mechanism.

Returns true if successful in adding entry to library, false otherwise.

References addParameterEntry().

Referenced by addParameterEntry(), and addParameterEntry().

◆ getEntry() [1/2]

template<class ValueType>
Entry< ValueType > & LOCA::Parameter::Library::getEntry ( const std::string & name)
protected

Gets the entry corresponding to parameter name name and type ValueType.

Referenced by getValue(), and setValue().

◆ getEntry() [2/2]

template<class ValueType>
const Entry< ValueType > & LOCA::Parameter::Library::getEntry ( const std::string & name) const
protected

Gets the entry corresponding to parameter name name and type ValueType.

References getTypeName().

◆ getEntryIterator()

LOCA::Parameter::Library::ValueTypeMapIterator LOCA::Parameter::Library::getEntryIterator ( const std::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.

Referenced by addParameterEntry().

◆ getEntryMapIterator() [1/2]

LOCA::Parameter::Library::ParameterMapIterator LOCA::Parameter::Library::getEntryMapIterator ( const std::string & name)
protected

Finds the set of entries corresponding to parameter name and sets the iterator it to point to it.

References library.

Referenced by addParameterEntry().

◆ getEntryMapIterator() [2/2]

LOCA::Parameter::Library::ParameterMapConstIterator LOCA::Parameter::Library::getEntryMapIterator ( const std::string & name) const
protected

Finds the set of entries corresponding to parameter name and sets the iterator it to point to it.

References library.

◆ getTypeName()

template<class ValueType>
std::string LOCA::Parameter::Library::getTypeName ( ) const
protected

Returns a std::string representation of type ValueType.

Referenced by addParameterEntry(), and getEntry().

◆ getValue()

template<class ValueType>
ValueType LOCA::Parameter::Library::getValue ( const std::string & name) const

Get parameter given by name.

References getEntry(), and LOCA::Parameter::Entry< ValueType >::getValue().

◆ operator=()

LOCA::Parameter::Library & LOCA::Parameter::Library::operator= ( const Library & l)
protected

Assignment operator.

References library.

◆ setValue()

template<class ValueType>
void LOCA::Parameter::Library::setValue ( const std::string & name,
const ValueType & value )

Set parameter given by name to value value.

References getEntry(), and LOCA::Parameter::Entry< ValueType >::setValue().

Member Data Documentation

◆ library

ParameterMap LOCA::Parameter::Library::library
protected

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