|
Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
|
Standard implementation of a ParameterEntryValidator that maps from a list of strings to some integral type value. More...
#include <Teuchos_StandardParameterEntryValidators.hpp>

Private Types | |
| typedef std::map< std::string, IntegralType > | map_t |
Private Member Functions | |
| void | setValidValues (ArrayView< const std::string > const &strings, ArrayView< const std::string > const *stringsDocs=NULL) |
| StringToIntegralParameterEntryValidator () | |
Private Attributes | |
| std::string | defaultParameterName_ |
| std::string | validValues_ |
| ValidStringsList | validStringValues_ |
| ValidStringsList | validStringValuesDocs_ |
| map_t | map_ |
Related Functions | |
(Note that these are not member functions.) | |
| template<class IntegralType > | |
| RCP < StringToIntegralParameterEntryValidator < IntegralType > > | stringToIntegralParameterEntryValidator (ArrayView< const std::string > const &strings, std::string const &defaultParameterName) |
| Nonmember constructor (see implementation). | |
| template<class IntegralType > | |
| RCP < StringToIntegralParameterEntryValidator < IntegralType > > | stringToIntegralParameterEntryValidator (ArrayView< const std::string > const &strings, ArrayView< const IntegralType > const &integralValues, std::string const &defaultParameterName) |
| Nonmember constructor (see implementation). | |
| template<class IntegralType > | |
| RCP < StringToIntegralParameterEntryValidator < IntegralType > > | stringToIntegralParameterEntryValidator (ArrayView< const std::string > const &strings, ArrayView< const std::string > const &stringsDocs, ArrayView< const IntegralType > const &integralValues, std::string const &defaultParameterName) |
| Nonmember constructor (see implementation). | |
Constructors | |
| StringToIntegralParameterEntryValidator (ArrayView< const std::string > const &strings, std::string const &defaultParameterName) | |
Construct with a mapping from strings to ordinals 0 to n-1. | |
| StringToIntegralParameterEntryValidator (ArrayView< const std::string > const &strings, ArrayView< const IntegralType > const &integralValues, std::string const &defaultParameterName) | |
| Construct with a mapping from strings to aribitrary typed integral values. | |
| StringToIntegralParameterEntryValidator (ArrayView< const std::string > const &strings, ArrayView< const std::string > const &stringsDocs, ArrayView< const IntegralType > const &integralValues, std::string const &defaultParameterName) | |
| Construct with a mapping from strings (with documentation) to aribitrary typed integral values. | |
Local non-virtual validated lookup functions | |
| IntegralType | getIntegralValue (const std::string &str, const std::string ¶mName="", const std::string &sublistName="") const |
| Perform a mapping from a std::string value to its integral value. | |
| IntegralType | getIntegralValue (const ParameterEntry &entry, const std::string ¶mName="", const std::string &sublistName="", const bool activeQuery=true) const |
Perform a mapping from a std::string value embedded in a ParameterEntry object and return its associated integral value. | |
| std::string | getStringValue (const ParameterEntry &entry, const std::string ¶mName="", const std::string &sublistName="", const bool activeQuery=true) const |
Get and validate a std::string value embedded in a ParameterEntry object. | |
| IntegralType | getIntegralValue (ParameterList ¶mList, const std::string ¶mName, const std::string &defaultValue) const |
Lookup a parameter from a parameter list, perform a mapping from a std::string value embedded in the ParameterEntry object and return its associated integral value. | |
| std::string | getStringValue (ParameterList ¶mList, const std::string ¶mName, const std::string &defaultValue) const |
| Lookup a parameter from a parameter list, validate the std::string value, and return the std::string value. | |
| ValidStringsList | getStringDocs () const |
| Get a pointer to the array containing all the documentation strings. | |
| const std::string & | getDefaultParameterName () const |
| Get the name of the default parameter for the validator. | |
| std::string | validateString (const std::string &str, const std::string ¶mName="", const std::string &sublistName="") const |
| Validate the std::string and pass it on. | |
Overridden from ParameterEntryValidator | |
| const std::string | getXMLTypeName () const |
| | |
| void | printDoc (std::string const &docString, std::ostream &out) const |
| | |
| ValidStringsList | validStringValues () const |
| | |
| void | validate (ParameterEntry const &entry, std::string const ¶mName, std::string const &sublistName) const |
| | |
Standard implementation of a ParameterEntryValidator that maps from a list of strings to some integral type value.
Objects of this type are meant to be used as both abstract objects passed to Teuchos::ParameterList objects to be used to validate parameter types and values, and to be used by the code that reads parameter values. Having a single definition for the types of valids input and outputs for a parameter value makes it easier to write error free validated code.
Please see StringToIntegralValidatorXMLConverter for documentation regarding the XML representation of this validator.
Definition at line 71 of file Teuchos_StandardParameterEntryValidators.hpp.
typedef std::map<std::string,IntegralType> Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::map_t [private] |
Definition at line 269 of file Teuchos_StandardParameterEntryValidators.hpp.
| Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::StringToIntegralParameterEntryValidator | ( | ArrayView< const std::string > const & | strings, |
| std::string const & | defaultParameterName | ||
| ) |
Construct with a mapping from strings to ordinals 0 to n-1.
| strings | [in] Array of unique std::string names. |
| defaultParameterName | [in] The default name of the parameter (used in error messages) |
Definition at line 2003 of file Teuchos_StandardParameterEntryValidators.hpp.
| Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::StringToIntegralParameterEntryValidator | ( | ArrayView< const std::string > const & | strings, |
| ArrayView< const IntegralType > const & | integralValues, | ||
| std::string const & | defaultParameterName | ||
| ) |
Construct with a mapping from strings to aribitrary typed integral values.
| strings | [in] Array of unique std::string names. |
| integralValues | [in] Array that gives the integral values associated with strings[] |
| defaultParameterName | [in] The default name of the parameter (used in error messages) |
Preconditions:
strings.size() == integralValues.size() Definition at line 2023 of file Teuchos_StandardParameterEntryValidators.hpp.
| Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::StringToIntegralParameterEntryValidator | ( | ArrayView< const std::string > const & | strings, |
| ArrayView< const std::string > const & | stringsDocs, | ||
| ArrayView< const IntegralType > const & | integralValues, | ||
| std::string const & | defaultParameterName | ||
| ) |
Construct with a mapping from strings (with documentation) to aribitrary typed integral values.
| strings | [in] Array of unique std::string names. |
| stringsDocs | [in] Array of documentation strings for each std::string value. |
| integralValues | [in] Array that gives the integral values associated with strings[] |
| defaultParameterName | [in] The default name of the parameter (used in error messages) |
Preconditions:
strings.size() == stringDocs.size() strings.size() == integralValues.size() Definition at line 2051 of file Teuchos_StandardParameterEntryValidators.hpp.
| Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::StringToIntegralParameterEntryValidator | ( | ) | [private] |
| IntegralType Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::getIntegralValue | ( | const std::string & | str, |
| const std::string & | paramName = "", |
||
| const std::string & | sublistName = "" |
||
| ) | const |
Perform a mapping from a std::string value to its integral value.
| str | [in] String that is being used to lookup the corresponding integral value. |
| paramName | [in] Optional name that will be used to generate error messages. |
If the std::string name str does not exist, the an std::exception will be thrown with a very descriptive error message.
Definition at line 2091 of file Teuchos_StandardParameterEntryValidators.hpp.
| IntegralType Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::getIntegralValue | ( | const ParameterEntry & | entry, |
| const std::string & | paramName = "", |
||
| const std::string & | sublistName = "", |
||
| const bool | activeQuery = true |
||
| ) | const |
Perform a mapping from a std::string value embedded in a ParameterEntry object and return its associated integral value.
| entry | [in] The std::string entry. |
| paramName | [in] Optional name that will be used to generate error messages. |
| sublistName | [in] The name of the sublist. |
| activeQuery | [in] If true, then this lookup will be recored as an active query which will turn the isUsed bool to true. |
Definition at line 2113 of file Teuchos_StandardParameterEntryValidators.hpp.
| std::string Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::getStringValue | ( | const ParameterEntry & | entry, |
| const std::string & | paramName = "", |
||
| const std::string & | sublistName = "", |
||
| const bool | activeQuery = true |
||
| ) | const |
Get and validate a std::string value embedded in a ParameterEntry object.
| entry | [in] The std::string entry. |
| paramName | [in] Optional name that will be used to generate error messages. |
| sublistName | [in] The name of the sublist. |
| activeQuery | [in] If true, then this lookup will be recored as an active query which will turn the isUsed bool to true. |
Definition at line 2135 of file Teuchos_StandardParameterEntryValidators.hpp.
| IntegralType Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::getIntegralValue | ( | ParameterList & | paramList, |
| const std::string & | paramName, | ||
| const std::string & | defaultValue | ||
| ) | const |
Lookup a parameter from a parameter list, perform a mapping from a std::string value embedded in the ParameterEntry object and return its associated integral value.
Definition at line 2149 of file Teuchos_StandardParameterEntryValidators.hpp.
| std::string Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::getStringValue | ( | ParameterList & | paramList, |
| const std::string & | paramName, | ||
| const std::string & | defaultValue | ||
| ) | const |
Lookup a parameter from a parameter list, validate the std::string value, and return the std::string value.
Definition at line 2162 of file Teuchos_StandardParameterEntryValidators.hpp.
| ParameterEntryValidator::ValidStringsList Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::getStringDocs | ( | ) | const |
Get a pointer to the array containing all the documentation strings.
Definition at line 2175 of file Teuchos_StandardParameterEntryValidators.hpp.
| const std::string & Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::getDefaultParameterName | ( | ) | const |
Get the name of the default parameter for the validator.
Definition at line 2182 of file Teuchos_StandardParameterEntryValidators.hpp.
| std::string Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::validateString | ( | const std::string & | str, |
| const std::string & | paramName = "", |
||
| const std::string & | sublistName = "" |
||
| ) | const |
Validate the std::string and pass it on.
| str | [in] String that is being used to lookup the corresponding integral value. |
| name | [in] Optional name that will be used to generate error messages. |
If the std::string name str does not exist, the an std::exception will be thrown with a very descriptive error message.
Definition at line 2189 of file Teuchos_StandardParameterEntryValidators.hpp.
| const std::string Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::getXMLTypeName | ( | ) | const [virtual] |
Implements Teuchos::ParameterEntryValidator.
Definition at line 2203 of file Teuchos_StandardParameterEntryValidators.hpp.
| void Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::printDoc | ( | std::string const & | docString, |
| std::ostream & | out | ||
| ) | const [virtual] |
Implements Teuchos::ParameterEntryValidator.
Definition at line 2210 of file Teuchos_StandardParameterEntryValidators.hpp.
| ParameterEntryValidator::ValidStringsList Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::validStringValues | ( | ) | const [virtual] |
Implements Teuchos::ParameterEntryValidator.
Definition at line 2235 of file Teuchos_StandardParameterEntryValidators.hpp.
| void Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::validate | ( | ParameterEntry const & | entry, |
| std::string const & | paramName, | ||
| std::string const & | sublistName | ||
| ) | const [virtual] |
Implements Teuchos::ParameterEntryValidator.
Definition at line 2242 of file Teuchos_StandardParameterEntryValidators.hpp.
| void Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::setValidValues | ( | ArrayView< const std::string > const & | strings, |
| ArrayView< const std::string > const * | stringsDocs = NULL |
||
| ) | [private] |
Definition at line 2255 of file Teuchos_StandardParameterEntryValidators.hpp.
| RCP< StringToIntegralParameterEntryValidator< IntegralType > > stringToIntegralParameterEntryValidator | ( | ArrayView< const std::string > const & | strings, |
| std::string const & | defaultParameterName | ||
| ) | [related] |
Nonmember constructor (see implementation).
| RCP< StringToIntegralParameterEntryValidator< IntegralType > > stringToIntegralParameterEntryValidator | ( | ArrayView< const std::string > const & | strings, |
| ArrayView< const IntegralType > const & | integralValues, | ||
| std::string const & | defaultParameterName | ||
| ) | [related] |
Nonmember constructor (see implementation).
| RCP< StringToIntegralParameterEntryValidator< IntegralType > > stringToIntegralParameterEntryValidator | ( | ArrayView< const std::string > const & | strings, |
| ArrayView< const std::string > const & | stringsDocs, | ||
| ArrayView< const IntegralType > const & | integralValues, | ||
| std::string const & | defaultParameterName | ||
| ) | [related] |
Nonmember constructor (see implementation).
std::string Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::defaultParameterName_ [private] |
Definition at line 270 of file Teuchos_StandardParameterEntryValidators.hpp.
std::string Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::validValues_ [private] |
Definition at line 271 of file Teuchos_StandardParameterEntryValidators.hpp.
ValidStringsList Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::validStringValues_ [private] |
Definition at line 272 of file Teuchos_StandardParameterEntryValidators.hpp.
ValidStringsList Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::validStringValuesDocs_ [private] |
Definition at line 273 of file Teuchos_StandardParameterEntryValidators.hpp.
map_t Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::map_ [private] |
Definition at line 274 of file Teuchos_StandardParameterEntryValidators.hpp.
1.7.6.1