|
Teuchos - Trilinos Tools Package
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>
Public Member Functions | |
Constructors | |
| StringToIntegralParameterEntryValidator (ArrayView< const std::string > const &strings, std::string const &defaultParameterName) | |
Construct with a mapping from strings to ordinals 0 to n-1. More... | |
| 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. More... | |
| 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. More... | |
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. More... | |
| 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. More... | |
| 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. More... | |
| IntegralType | getIntegralValue (ParameterList ¶mList, const std::string ¶mName, const std::string &defaultValue) const |
| Get the integer enum value for the given parameter. More... | |
| 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. More... | |
| ValidStringsList | getStringDocs () const |
| Get a pointer to the array containing all the documentation strings. More... | |
| const std::string & | getDefaultParameterName () const |
| Get the name of the default parameter for the validator. More... | |
| std::string | validateString (const std::string &str, const std::string ¶mName="", const std::string &sublistName="") const |
| Validate the std::string and pass it on. More... | |
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 |
Public Member Functions inherited from Teuchos::ParameterEntryValidator | |
| ParameterEntryValidator () | |
| Default Constructor. More... | |
| virtual void | validateAndModify (std::string const ¶mName, std::string const &sublistName, ParameterEntry *entry) const |
| Validate and perhaps modify a parameter entry's value. More... | |
Public Member Functions inherited from Teuchos::Describable | |
| virtual std::string | description () const |
| Return a simple one-line description of this object. More... | |
| virtual void | describe (FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
| Print the object with some verbosity level to a FancyOStream. More... | |
| void | describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
| Version of describe() that takes an std::ostream instead of a FancyOStream. More... | |
| virtual | ~Describable () |
| Destructor (marked virtual for memory safety of derived classes). More... | |
Public Member Functions inherited from Teuchos::LabeledObject | |
| LabeledObject () | |
| Construct with an empty label. More... | |
| virtual | ~LabeledObject () |
| virtual void | setObjectLabel (const std::string &objectLabel) |
| Set the object label (see LabeledObject). More... | |
| virtual std::string | getObjectLabel () const |
| Get the object label (see LabeledObject). More... | |
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). More... | |
| 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). More... | |
| 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). More... | |
Related Functions inherited from Teuchos::Describable | |
| DescribableStreamManipulatorState | describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default) |
| Describable output stream manipulator. More... | |
| std::ostream & | operator<< (std::ostream &os, const DescribableStreamManipulatorState &d) |
| Output stream operator for Describable manipulator. More... | |
Additional Inherited Members | |
Public Types inherited from Teuchos::ParameterEntryValidator | |
| typedef unsigned int | ValidatorID |
| typedef RCP< const Array< std::string > > | ValidStringsList |
Static Public Attributes inherited from Teuchos::Describable | |
| static const EVerbosityLevel | verbLevel_default = VERB_DEFAULT |
Default value for the verbLevel argument of describe(). More... | |
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.
| 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 2005 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 2025 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 2053 of file Teuchos_StandardParameterEntryValidators.hpp.
| 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 2093 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 2115 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 recorded as an active query which will turn the isUsed bool to true. |
Definition at line 2137 of file Teuchos_StandardParameterEntryValidators.hpp.
| IntegralType Teuchos::StringToIntegralParameterEntryValidator< IntegralType >::getIntegralValue | ( | ParameterList & | paramList, |
| const std::string & | paramName, | ||
| const std::string & | defaultValue | ||
| ) | const |
Get the integer enum value for the given parameter.
Look up a parameter from a parameter list, map from the std::string value in the ParameterEntry object to its corresponding integer enum value, and return the integer enum value.
Definition at line 2151 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 2164 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 2177 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 2184 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 2191 of file Teuchos_StandardParameterEntryValidators.hpp.
|
virtual |
Implements Teuchos::ParameterEntryValidator.
Definition at line 2205 of file Teuchos_StandardParameterEntryValidators.hpp.
|
virtual |
Implements Teuchos::ParameterEntryValidator.
Definition at line 2212 of file Teuchos_StandardParameterEntryValidators.hpp.
|
virtual |
Implements Teuchos::ParameterEntryValidator.
Definition at line 2237 of file Teuchos_StandardParameterEntryValidators.hpp.
|
virtual |
Implements Teuchos::ParameterEntryValidator.
Definition at line 2244 of file Teuchos_StandardParameterEntryValidators.hpp.
|
related |
Nonmember constructor (see implementation).
|
related |
Nonmember constructor (see implementation).
|
related |
Nonmember constructor (see implementation).
1.8.11