#include <Teuchos_ParameterList.hpp>
Public Types | |
Public types | |
| typedef Map::const_iterator | ConstIterator |
| Parameter container const iterator typedef. | |
Public Member Functions | |
Constructors/Destructor. | |
| ParameterList () | |
| Constructor. | |
| ParameterList (const std::string &name) | |
| Constructor. | |
| ParameterList (const ParameterList &source) | |
| Copy Constructor. | |
| virtual | ~ParameterList () |
| Deconstructor. | |
Set Functions | |
| ParameterList & | setName (const std::string &name) |
Set the name of *this list. | |
| ParameterList & | operator= (const ParameterList &source) |
| ParameterList & | setParameters (const ParameterList &source) |
| ParameterList & | setParametersNotAlreadySet (const ParameterList &source) |
| ParameterList & | disableRecursiveValidation () |
| template<typename T> | |
| ParameterList & | set (std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null) |
| Sets different types of parameters. The type depends on the second entry. | |
| ParameterList & | set (std::string const &name, char value[], std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null) |
| Template specialization for the case when a user sets the parameter with a character std::string in parenthesis. | |
| ParameterList & | set (std::string const &name, const char value[], std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null) |
| Template specialization for the case when a user sets the parameter with a character std::string in parenthesis. | |
| ParameterList & | set (std::string const &name, ParameterList const &value, std::string const &docString="") |
| Template specialization for the case when a user sets the parameter with a ParameterList. | |
| ParameterList & | setEntry (const std::string &name, const ParameterEntry &entry) |
| Set a parameter directly as a ParameterEntry. | |
Get Functions | |
| template<typename T> | |
| T & | get (const std::string &name, T def_value) |
Retrieves parameter name of type T from list, if it exists, else the def_value is used to enter a new parameter into the list. | |
| std::string & | get (const std::string &name, char def_value[]) |
| Template specialization of get, where the nominal value is a character std::string in parenthesis. Both char* and std::string are stored as strings and return std::string values. | |
| std::string & | get (const std::string &name, const char def_value[]) |
| Template specialization of get, where the nominal value is a character std::string in parenthesis. Both char* and std::string are stored as strings and return std::string values. | |
| template<typename T> | |
| T & | get (const std::string &name) |
Retrieves parameter name of type T from a list, an Exceptions::InvalidParameter std::exception is thrown if this parameter doesn't exist (Exceptions::InvalidParameterName) or is the wrong type (Exceptions::InvalidParameterName). | |
| template<typename T> | |
| const T & | get (const std::string &name) const |
Retrieves parameter name of type T from a constant list, an Exceptions::InvalidParameter std::exception is thrown if this parameter doesn't exist (Exceptions::InvalidParameterName) or is the wrong type (Exceptions::InvalidParameterName). | |
| template<typename T> | |
| T * | getPtr (const std::string &name) |
Retrieves the pointer for parameter name of type T from a list. A null pointer is returned if this parameter doesn't exist or is the wrong type. | |
| template<typename T> | |
| const T * | getPtr (const std::string &name) const |
Retrieves the pointer for parameter name of type T from a constant list. A null pointer is returned if this parameter doesn't exist or is the wrong type. | |
| ParameterEntry & | getEntry (const std::string &name) |
Retrieves an entry with the name name. | |
| const ParameterEntry & | getEntry (const std::string &name) const |
Retrieves a const entry with the name name. | |
| ParameterEntry * | getEntryPtr (const std::string &name) |
Retrieves the pointer for an entry with the name name if it exists. | |
| const ParameterEntry * | getEntryPtr (const std::string &name) const |
Retrieves the pointer for a constant entry with the name name if it exists. | |
Parameter removal functions | |
| bool | remove (std::string const &name, bool throwIfNotExists=true) |
| Remove a parameter (does not depend on the type of the parameter). | |
Sublist Functions | |
| ParameterList & | sublist (const std::string &name, bool mustAlreadyExist=false, const std::string &docString="") |
Creates an empty sublist and returns a reference to the sublist name. If the list already exists, returns reference to that sublist. If the name exists but is not a sublist, an std::exception is thrown. | |
| const ParameterList & | sublist (const std::string &name) const |
Return a const reference to an existing sublist name. If the list does not already exist or the name exists but is not a sublist, an std::exception is thrown. | |
Attribute Functions | |
| const std::string & | name () const |
| Query the name of this parameter list. | |
| bool | isParameter (const std::string &name) const |
| Query the existence of a parameter. | |
| bool | isSublist (const std::string &name) const |
| Query the existence of a parameter and whether it is a parameter list. | |
| template<typename T> | |
| bool | isType (const std::string &name) const |
| Query the existence and type of a parameter. | |
I/O Functions | |
| std::ostream & | print (std::ostream &os, const PrintOptions &printOptions) const |
| Printing method for parameter lists which takes an print options object. | |
| std::ostream & | print (std::ostream &os, int indent=0, bool showTypes=false, bool showFlags=true) const |
| Printing method for parameter lists. Indenting is used to indicate parameter list hierarchies. | |
| void | unused (std::ostream &os) const |
| Print out unused parameters in the ParameterList. | |
| std::string | currentParametersString () const |
| Create a single formated std::string of all of the zero-level parameters in this list. | |
Read-only access to the iterator | |
| ConstIterator | begin () const |
| An iterator pointing to the first entry. | |
| ConstIterator | end () const |
| An iterator pointing beyond the last entry. | |
| const ParameterEntry & | entry (ConstIterator i) const |
| Access to ParameterEntry (i.e., returns i->second). | |
| const std::string & | name (ConstIterator i) const |
| Access to name (i.e., returns i->first). | |
Validation Functions | |
| void | validateParameters (ParameterList const &validParamList, int const depth=1000, EValidateUsed const validateUsed=VALIDATE_USED_ENABLED, EValidateDefaults const validateDefaults=VALIDATE_DEFAULTS_ENABLED) const |
| Validate the parameters in this list given valid selections in the input list. | |
| void | validateParametersAndSetDefaults (ParameterList const &validParamList, int const depth=1000) |
| Validate the parameters in this list given valid selections in the input list and set defaults for those not set. | |
Related Functions | |
| (Note that these are not member functions.) | |
| bool | operator== (const ParameterList &list1, const ParameterList &list2) |
| Returns true if two parameter lists are the same. | |
| bool | operator!= (const ParameterList &list1, const ParameterList &list2) |
| Returns true if two parameter lists are not the same. | |
| bool | haveSameValues (const ParameterList &list1, const ParameterList &list2) |
| Returns true if two parameter lists have the same values. | |
| template<typename T> | |
| T & | getParameter (ParameterList &l, const std::string &name) |
| A templated helper function for getting a parameter from a non-const list. This helper function prevents the need for giving a nominal value of the specific template type. | |
| template<typename T> | |
| T & | get (ParameterList &l, const std::string &name) |
A shorter name for getParameter(). | |
| template<typename T> | |
| const T & | getParameter (const ParameterList &l, const std::string &name) |
| A templated helper function for getting a parameter from a const list. This helper function prevents the need for giving a nominal value of the specific template type. | |
| template<typename T> | |
| T * | getParameterPtr (ParameterList &l, const std::string &name) |
| A templated helper function for getting a pointer to a parameter from a non-const list, if it exists. This helper function prevents the need for giving a nominal value of the specific template type. | |
| template<typename T> | |
| const T * | getParameterPtr (const ParameterList &l, const std::string &name) |
| A templated helper function for getting a pointer to a parameter from a non-const list, if it exists. This helper function prevents the need for giving a nominal value of the specific template type. | |
| template<typename T> | |
| bool | isParameterType (ParameterList &l, const std::string &name) |
| A templated helper function for determining the type of a parameter entry for a non-const list. This helper function avoids the need for giving a nominal value of the specific template type. | |
| template<typename T> | |
| bool | isParameterType (const ParameterList &l, const std::string &name) |
| A templated helper function for determining the type of a parameter entry for a const list. This helper function avoids the need for giving a nominal value of the specific template type. | |
| template<typename T> | |
| void | setStringParameterFromArray (const std::string ¶mName, const Array< T > &array, ParameterList *paramList) |
| Set a std::string parameter representation of an array. | |
| template<typename T> | |
| Array< T > | getArrayFromStringParameter (const ParameterList ¶mList, const std::string ¶mName, const int arrayDim=-1, const bool mustExist=true) |
Get an Array object (with entries of type T) from a parameter holding a std::string representation of the array. | |
| RCP< ParameterList > | sublist (const RCP< ParameterList > ¶mList, const std::string &name, bool mustAlreadyExist=false) |
| Return a RCP to a sublist in another RCP-ed parameter list. | |
| RCP< const ParameterList > | sublist (const RCP< const ParameterList > ¶mList, const std::string &name) |
| Return a RCP to a sublist in another RCP-ed parameter list. | |
| std::ostream & | operator<< (std::ostream &os, const ParameterList &l) |
| Output stream operator for handling the printing of the parameter list. | |
| template<class IntegralType> | |
| void | setStringToIntegralParameter (std::string const ¶mName, std::string const &defaultValue, std::string const &docString, Array< std::string > const &strings, ParameterList *paramList) |
| Set up a std::string parameter that will use an embedded validator to allow the extraction of an integral value. | |
| template<class IntegralType> | |
| void | setStringToIntegralParameter (std::string const ¶mName, std::string const &defaultValue, std::string const &docString, Array< std::string > const &strings, Array< IntegralType > const &integralValues, ParameterList *paramList) |
| Set up a std::string parameter that will use an embedded validator to allow the extraction of an integral value from a list of integral values. | |
| template<class IntegralType> | |
| void | setStringToIntegralParameter (std::string const ¶mName, std::string const &defaultValue, std::string const &docString, Array< std::string > const &strings, Array< std::string > const &stringsDocs, Array< IntegralType > const &integralValues, ParameterList *paramList) |
| Set up a std::string parameter with documentation strings for each valid value that will use an embedded validator to allow the extraction of an integral value from a list of integral values. | |
| template<class IntegralType> | |
| IntegralType | getIntegralValue (ParameterList const ¶mList, std::string const ¶mName) |
| Get an integral value for a parameter that is assumed to already be set. | |
| template<class IntegralType> | |
| std::string | getStringValue (ParameterList const ¶mList, std::string const ¶mName) |
| Get a std::string value for a parameter that is assumed to already be set. | |
| void | setIntParameter (std::string const ¶mName, int const value, std::string const &docString, ParameterList *paramList, AnyNumberParameterEntryValidator::AcceptedTypes const &acceptedTypes=AnyNumberParameterEntryValidator::AcceptedTypes()) |
| Set an integer parameter that allows for (nearly) any input parameter type that is convertible to an int. | |
| void | setDoubleParameter (std::string const ¶mName, double const &value, std::string const &docString, ParameterList *paramList, AnyNumberParameterEntryValidator::AcceptedTypes const &acceptedTypes=AnyNumberParameterEntryValidator::AcceptedTypes()) |
| Set an double parameter that allows for (nearly) any input parameter type that is convertible to a double. | |
| void | setNumericStringParameter (std::string const ¶mName, std::string const &value, std::string const &docString, ParameterList *paramList, AnyNumberParameterEntryValidator::AcceptedTypes const &acceptedTypes=AnyNumberParameterEntryValidator::AcceptedTypes()) |
| Set an numeric parameter preferred as a std::string that allows for (nearly) any input parameter type that is convertible to a std::string. | |
| int | getIntParameter (ParameterList const ¶mList, std::string const ¶mName) |
| Get an integer parameter. | |
| double | getDoubleParameter (ParameterList const ¶mList, std::string const ¶mName) |
| Get double integer parameter. | |
| std::string | getNumericStringParameter (ParameterList const ¶mList, std::string const ¶mName) |
| Get std::string numeric parameter. | |
Parameters can be added and retreived with the templated "get" and "set" functions. These parameters can any data type which uses value sementics (e.g. double, float, int, *double, *float, *int, ...) which includes other parameter lists, allowing for a hierarchy of parameter lists. These parameters can also be pointers to vectors or functions.
Definition at line 87 of file Teuchos_ParameterList.hpp.
|
|
Parameter container const iterator typedef.
Definition at line 101 of file Teuchos_ParameterList.hpp. |
|
|
Constructor.
Definition at line 67 of file Teuchos_ParameterList.cpp. |
|
|
Constructor.
Definition at line 71 of file Teuchos_ParameterList.cpp. |
|
|
Copy Constructor.
Definition at line 75 of file Teuchos_ParameterList.cpp. |
|
|
Deconstructor.
Definition at line 139 of file Teuchos_ParameterList.cpp. |
|
|
Set the name of
Definition at line 629 of file Teuchos_ParameterList.hpp. |
|
|
Replace the current parameter list with
Definition at line 82 of file Teuchos_ParameterList.cpp. |
|
|
Set the parameters in
Note, this function will set the parameters and sublists from Definition at line 92 of file Teuchos_ParameterList.cpp. |
|
|
Set the parameters in
Note, this function will set the parameters and sublists from Definition at line 109 of file Teuchos_ParameterList.cpp. |
|
|
Disallow recusive validation when this sublist is used in a valid parameter list. This function should be called when setting a sublist in a valid parameter list which is broken off to be passed to another object. The other object should validate its own list. Definition at line 133 of file Teuchos_ParameterList.cpp. |
|
||||||||||||||||||||||||
|
Sets different types of parameters. The type depends on the second entry.
Definition at line 639 of file Teuchos_ParameterList.hpp. |
|
||||||||||||||||||||
|
Template specialization for the case when a user sets the parameter with a character std::string in parenthesis.
Definition at line 654 of file Teuchos_ParameterList.hpp. |
|
||||||||||||||||||||
|
Template specialization for the case when a user sets the parameter with a character std::string in parenthesis.
|
|
||||||||||||||||
|
Template specialization for the case when a user sets the parameter with a ParameterList.
Definition at line 668 of file Teuchos_ParameterList.hpp. |
|
||||||||||||
|
Set a parameter directly as a ParameterEntry.
Definition at line 677 of file Teuchos_ParameterList.hpp. |
|
||||||||||||||||
|
Retrieves parameter
Definition at line 686 of file Teuchos_ParameterList.hpp. |
|
||||||||||||
|
Template specialization of get, where the nominal value is a character std::string in parenthesis. Both char* and std::string are stored as strings and return std::string values.
Definition at line 704 of file Teuchos_ParameterList.hpp. |
|
||||||||||||
|
Template specialization of get, where the nominal value is a character std::string in parenthesis. Both char* and std::string are stored as strings and return std::string values.
|
|
||||||||||
|
Retrieves parameter
Definition at line 712 of file Teuchos_ParameterList.hpp. |
|
||||||||||
|
Retrieves parameter
Definition at line 721 of file Teuchos_ParameterList.hpp. |
|
||||||||||
|
Retrieves the pointer for parameter
Definition at line 731 of file Teuchos_ParameterList.hpp. |
|
||||||||||
|
Retrieves the pointer for parameter
Definition at line 741 of file Teuchos_ParameterList.hpp. |
|
|
Retrieves an entry with the name
Throws Definition at line 750 of file Teuchos_ParameterList.hpp. |
|
|
Retrieves a const entry with the name
Throws Definition at line 758 of file Teuchos_ParameterList.hpp. |
|
|
Retrieves the pointer for an entry with the name
Definition at line 767 of file Teuchos_ParameterList.hpp. |
|
|
Retrieves the pointer for a constant entry with the name
Definition at line 777 of file Teuchos_ParameterList.hpp. |
|
||||||||||||
|
Remove a parameter (does not depend on the type of the parameter).
Definition at line 182 of file Teuchos_ParameterList.cpp. |
|
||||||||||||||||
|
Creates an empty sublist and returns a reference to the sublist
Definition at line 198 of file Teuchos_ParameterList.cpp. |
|
|
Return a const reference to an existing sublist
Definition at line 255 of file Teuchos_ParameterList.cpp. |
|
|
Query the name of this parameter list.
Definition at line 788 of file Teuchos_ParameterList.hpp. |
|
|
Query the existence of a parameter.
Definition at line 177 of file Teuchos_ParameterList.cpp. |
|
|
Query the existence of a parameter and whether it is a parameter list.
Definition at line 169 of file Teuchos_ParameterList.cpp. |
|
||||||||||
|
Query the existence and type of a parameter.
Definition at line 806 of file Teuchos_ParameterList.hpp. |
|
||||||||||||
|
Printing method for parameter lists which takes an print options object.
Definition at line 280 of file Teuchos_ParameterList.cpp. |
|
||||||||||||||||||||
|
Printing method for parameter lists. Indenting is used to indicate parameter list hierarchies.
Definition at line 275 of file Teuchos_ParameterList.cpp. |
|
|
Print out unused parameters in the ParameterList.
Definition at line 142 of file Teuchos_ParameterList.cpp. |
|
|
Create a single formated std::string of all of the zero-level parameters in this list.
Definition at line 152 of file Teuchos_ParameterList.cpp. |
|
|
An iterator pointing to the first entry.
Definition at line 335 of file Teuchos_ParameterList.cpp. |
|
|
An iterator pointing beyond the last entry.
Definition at line 340 of file Teuchos_ParameterList.cpp. |
|
|
Access to ParameterEntry (i.e., returns i->second).
Definition at line 374 of file Teuchos_ParameterList.cpp. |
|
|
Access to name (i.e., returns i->first).
Definition at line 364 of file Teuchos_ParameterList.cpp. |
|
||||||||||||||||||||
|
Validate the parameters in this list given valid selections in the input list.
*this is not found in validParamList then an std::exception of type Exceptions::InvalidParameterName will be thrown which will contain an excellent error message returned by excpt.what(). If the parameter exists but has the wrong type, then an std::exception type Exceptions::InvalidParameterType will be thrown. If the parameter exists and has the right type, but the value is not valid then an std::exception type Exceptions::InvalidParameterValue will be thrown.Recursive validation stops when:
A breath-first search is performed to validate all of the parameters in one sublist before moving into nested subslist. Definition at line 382 of file Teuchos_ParameterList.cpp. |
|
||||||||||||
|
Validate the parameters in this list given valid selections in the input list and set defaults for those not set.
*this is not found in validParamList then an std::exception of type Exceptions::InvalidParameterName will be thrown which will contain an excellent error message returned by excpt.what(). If the parameter exists but has the wrong type, then an std::exception type Exceptions::InvalidParameterType will be thrown. If the parameter exists and has the right type, but the value is not valid then an std::exception type Exceptions::InvalidParameterValue will be thrown. If a parameter in validParamList does not exist in *this, then it will be set at its default value as determined by validParamList.Recursive validation stops when:
A breath-first search is performed to validate all of the parameters in one sublist before moving into nested subslist. Definition at line 483 of file Teuchos_ParameterList.cpp. |
|
||||||||||||
|
Returns true if two parameter lists are the same.
|
|
||||||||||||
|
Returns true if two parameter lists are not the same.
Definition at line 610 of file Teuchos_ParameterList.hpp. |
|
||||||||||||
|
Returns true if two parameter lists have the same values. Two parameter lists may have the same values but may not be identical. For example, two parameters can have the same values but not have the same documentation strings or the same validators. |
|
||||||||||||||||
|
A templated helper function for getting a parameter from a non-const list. This helper function prevents the need for giving a nominal value of the specific template type.
Definition at line 853 of file Teuchos_ParameterList.hpp. |
|
||||||||||||||||
|
A shorter name for
Definition at line 865 of file Teuchos_ParameterList.hpp. |
|
||||||||||||||||
|
A templated helper function for getting a parameter from a const list. This helper function prevents the need for giving a nominal value of the specific template type.
Definition at line 877 of file Teuchos_ParameterList.hpp. |
|
||||||||||||||||
|
A templated helper function for getting a pointer to a parameter from a non-const list, if it exists. This helper function prevents the need for giving a nominal value of the specific template type.
Definition at line 891 of file Teuchos_ParameterList.hpp. |
|
||||||||||||||||
|
A templated helper function for getting a pointer to a parameter from a non-const list, if it exists. This helper function prevents the need for giving a nominal value of the specific template type.
Definition at line 905 of file Teuchos_ParameterList.hpp. |
|
||||||||||||||||
|
A templated helper function for determining the type of a parameter entry for a non-const list. This helper function avoids the need for giving a nominal value of the specific template type.
Definition at line 918 of file Teuchos_ParameterList.hpp. |
|
||||||||||||||||
|
A templated helper function for determining the type of a parameter entry for a const list. This helper function avoids the need for giving a nominal value of the specific template type. < |