|
Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
|
Standard implementation of a ParameterEntryValidator that accepts numbers from a number of different formats and converts them to numbers in another format. More...
#include <Teuchos_StandardParameterEntryValidators.hpp>

Classes | |
| class | AcceptedTypes |
| Determines the types that are accepted. More... | |
Private Member Functions | |
| void | finishInitialization () |
| void | throwTypeError (ParameterEntry const &entry, std::string const ¶mName, std::string const &sublistName) const |
Static Private Member Functions | |
| static const std::string & | getIntEnumString () |
| static const std::string & | getDoubleEnumString () |
| static const std::string & | getStringEnumString () |
Private Attributes | |
| EPreferredType | preferredType_ |
| std::string | acceptedTypesString_ |
| const AcceptedTypes | acceptedTypes_ |
Related Functions | |
(Note that these are not member functions.) | |
| TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP < AnyNumberParameterEntryValidator > | anyNumberParameterEntryValidator () |
| Nonmember constructor AnyNumberParameterEntryValidator. | |
| TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP < AnyNumberParameterEntryValidator > | anyNumberParameterEntryValidator (AnyNumberParameterEntryValidator::EPreferredType const preferredType, AnyNumberParameterEntryValidator::AcceptedTypes const &acceptedTypes) |
| Nonmember constructor AnyNumberParameterEntryValidator. | |
Public types | |
| enum | EPreferredType { PREFER_INT, PREFER_DOUBLE, PREFER_STRING } |
| Determines what type is the preferred type. More... | |
Constructors | |
| AnyNumberParameterEntryValidator () | |
| Construct with a preferrded type of double and accept all types. | |
| AnyNumberParameterEntryValidator (EPreferredType const preferredType, AcceptedTypes const &acceptedTypes) | |
| Construct with allowed input and output types and the preferred type. | |
Local non-virtual validated lookup functions | |
| int | getInt (const ParameterEntry &entry, const std::string ¶mName="", const std::string &sublistName="", const bool activeQuery=true) const |
| Get an integer value from a parameter entry. | |
| double | getDouble (const ParameterEntry &entry, const std::string ¶mName="", const std::string &sublistName="", const bool activeQuery=true) const |
| Get a double value from a parameter entry. | |
| std::string | getString (const ParameterEntry &entry, const std::string ¶mName="", const std::string &sublistName="", const bool activeQuery=true) const |
| Get a std::string value from a parameter entry. | |
| int | getInt (ParameterList ¶mList, const std::string ¶mName, const int defaultValue) const |
| Lookup parameter from a parameter list and return as an int value. | |
| double | getDouble (ParameterList ¶mList, const std::string ¶mName, const double defaultValue) const |
| Lookup parameter from a parameter list and return as an double value. | |
| std::string | getString (ParameterList ¶mList, const std::string ¶mName, const std::string &defaultValue) const |
| Lookup parameter from a parameter list and return as an std::string value. | |
| bool | isDoubleAllowed () const |
| Lookup whether or not Doubles are allowed. | |
| bool | isIntAllowed () const |
| Lookup whether or not ints are allowed. | |
| bool | isStringAllowed () const |
| Lookup whether or not strings are allowed. | |
| EPreferredType | getPreferredType () const |
| Lookup the preferred type. | |
| static const std::string & | getPrefferedTypeString (EPreferredType enumValue) |
| Gets the string representation of a given preferred type enum. | |
| static EPreferredType | getPrefferedTypeStringEnum (const std::string &enumString) |
| Gets the preferred type enum associated with a give string. | |
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 |
| | |
| void | validateAndModify (std::string const ¶mName, std::string const &sublistName, ParameterEntry *entry) const |
| | |
Standard implementation of a ParameterEntryValidator that accepts numbers from a number of different formats and converts them to numbers in another format.
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 AnyNumberValidatorXMLConverter for documenation regarding the XML representation of this validator.
Definition at line 602 of file Teuchos_StandardParameterEntryValidators.hpp.
Determines what type is the preferred type.
Definition at line 611 of file Teuchos_StandardParameterEntryValidators.hpp.
Construct with a preferrded type of double and accept all types.
Definition at line 135 of file Teuchos_StandardParameterEntryValidators.cpp.
| Teuchos::AnyNumberParameterEntryValidator::AnyNumberParameterEntryValidator | ( | EPreferredType const | preferredType, |
| AcceptedTypes const & | acceptedTypes | ||
| ) |
Construct with allowed input and output types and the preferred type.
| preferredType | [in] Determines the preferred type. This enum value is used to set the default value in the override validateAndModify(). |
| acceptedType | [in] Determines the types that are allowed in the parameter list. |
Definition at line 142 of file Teuchos_StandardParameterEntryValidators.cpp.
| int Teuchos::AnyNumberParameterEntryValidator::getInt | ( | const ParameterEntry & | entry, |
| const std::string & | paramName = "", |
||
| const std::string & | sublistName = "", |
||
| const bool | activeQuery = true |
||
| ) | const |
Get an integer value from a parameter entry.
Definition at line 154 of file Teuchos_StandardParameterEntryValidators.cpp.
| double Teuchos::AnyNumberParameterEntryValidator::getDouble | ( | const ParameterEntry & | entry, |
| const std::string & | paramName = "", |
||
| const std::string & | sublistName = "", |
||
| const bool | activeQuery = true |
||
| ) | const |
Get a double value from a parameter entry.
Definition at line 171 of file Teuchos_StandardParameterEntryValidators.cpp.
| std::string Teuchos::AnyNumberParameterEntryValidator::getString | ( | const ParameterEntry & | entry, |
| const std::string & | paramName = "", |
||
| const std::string & | sublistName = "", |
||
| const bool | activeQuery = true |
||
| ) | const |
Get a std::string value from a parameter entry.
Definition at line 188 of file Teuchos_StandardParameterEntryValidators.cpp.
| int Teuchos::AnyNumberParameterEntryValidator::getInt | ( | ParameterList & | paramList, |
| const std::string & | paramName, | ||
| const int | defaultValue | ||
| ) | const |
Lookup parameter from a parameter list and return as an int value.
Definition at line 205 of file Teuchos_StandardParameterEntryValidators.cpp.
| double Teuchos::AnyNumberParameterEntryValidator::getDouble | ( | ParameterList & | paramList, |
| const std::string & | paramName, | ||
| const double | defaultValue | ||
| ) | const |
Lookup parameter from a parameter list and return as an double value.
Definition at line 216 of file Teuchos_StandardParameterEntryValidators.cpp.
| std::string Teuchos::AnyNumberParameterEntryValidator::getString | ( | ParameterList & | paramList, |
| const std::string & | paramName, | ||
| const std::string & | defaultValue | ||
| ) | const |
Lookup parameter from a parameter list and return as an std::string value.
Definition at line 227 of file Teuchos_StandardParameterEntryValidators.cpp.
| bool Teuchos::AnyNumberParameterEntryValidator::isDoubleAllowed | ( | ) | const |
Lookup whether or not Doubles are allowed.
Definition at line 238 of file Teuchos_StandardParameterEntryValidators.cpp.
| bool Teuchos::AnyNumberParameterEntryValidator::isIntAllowed | ( | ) | const |
Lookup whether or not ints are allowed.
Definition at line 244 of file Teuchos_StandardParameterEntryValidators.cpp.
| bool Teuchos::AnyNumberParameterEntryValidator::isStringAllowed | ( | ) | const |
Lookup whether or not strings are allowed.
Definition at line 250 of file Teuchos_StandardParameterEntryValidators.cpp.
| AnyNumberParameterEntryValidator::EPreferredType Teuchos::AnyNumberParameterEntryValidator::getPreferredType | ( | ) | const |
Lookup the preferred type.
Definition at line 257 of file Teuchos_StandardParameterEntryValidators.cpp.
| static const std::string& Teuchos::AnyNumberParameterEntryValidator::getPrefferedTypeString | ( | EPreferredType | enumValue | ) | [inline, static] |
Gets the string representation of a given preferred type enum.
Definition at line 732 of file Teuchos_StandardParameterEntryValidators.hpp.
| static EPreferredType Teuchos::AnyNumberParameterEntryValidator::getPrefferedTypeStringEnum | ( | const std::string & | enumString | ) | [inline, static] |
Gets the preferred type enum associated with a give string.
Definition at line 748 of file Teuchos_StandardParameterEntryValidators.hpp.
| const std::string Teuchos::AnyNumberParameterEntryValidator::getXMLTypeName | ( | ) | const [virtual] |
Implements Teuchos::ParameterEntryValidator.
Definition at line 266 of file Teuchos_StandardParameterEntryValidators.cpp.
| void Teuchos::AnyNumberParameterEntryValidator::printDoc | ( | std::string const & | docString, |
| std::ostream & | out | ||
| ) | const [virtual] |
Implements Teuchos::ParameterEntryValidator.
Definition at line 272 of file Teuchos_StandardParameterEntryValidators.cpp.
| ParameterEntryValidator::ValidStringsList Teuchos::AnyNumberParameterEntryValidator::validStringValues | ( | ) | const [virtual] |
Implements Teuchos::ParameterEntryValidator.
Definition at line 283 of file Teuchos_StandardParameterEntryValidators.cpp.
| void Teuchos::AnyNumberParameterEntryValidator::validate | ( | ParameterEntry const & | entry, |
| std::string const & | paramName, | ||
| std::string const & | sublistName | ||
| ) | const [virtual] |
Implements Teuchos::ParameterEntryValidator.
Definition at line 289 of file Teuchos_StandardParameterEntryValidators.cpp.
| void Teuchos::AnyNumberParameterEntryValidator::validateAndModify | ( | std::string const & | paramName, |
| std::string const & | sublistName, | ||
| ParameterEntry * | entry | ||
| ) | const [virtual] |
Reimplemented from Teuchos::ParameterEntryValidator.
Definition at line 304 of file Teuchos_StandardParameterEntryValidators.cpp.
| static const std::string& Teuchos::AnyNumberParameterEntryValidator::getIntEnumString | ( | ) | [inline, static, private] |
Definition at line 821 of file Teuchos_StandardParameterEntryValidators.hpp.
| static const std::string& Teuchos::AnyNumberParameterEntryValidator::getDoubleEnumString | ( | ) | [inline, static, private] |
Definition at line 827 of file Teuchos_StandardParameterEntryValidators.hpp.
| static const std::string& Teuchos::AnyNumberParameterEntryValidator::getStringEnumString | ( | ) | [inline, static, private] |
Definition at line 833 of file Teuchos_StandardParameterEntryValidators.hpp.
| void Teuchos::AnyNumberParameterEntryValidator::finishInitialization | ( | ) | [private] |
Definition at line 339 of file Teuchos_StandardParameterEntryValidators.cpp.
| void Teuchos::AnyNumberParameterEntryValidator::throwTypeError | ( | ParameterEntry const & | entry, |
| std::string const & | paramName, | ||
| std::string const & | sublistName | ||
| ) | const [private] |
Definition at line 362 of file Teuchos_StandardParameterEntryValidators.cpp.
| TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< AnyNumberParameterEntryValidator > anyNumberParameterEntryValidator | ( | ) | [related] |
Nonmember constructor AnyNumberParameterEntryValidator.
| TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< AnyNumberParameterEntryValidator > anyNumberParameterEntryValidator | ( | AnyNumberParameterEntryValidator::EPreferredType const | preferredType, |
| AnyNumberParameterEntryValidator::AcceptedTypes const & | acceptedTypes | ||
| ) | [related] |
Nonmember constructor AnyNumberParameterEntryValidator.
Definition at line 804 of file Teuchos_StandardParameterEntryValidators.hpp.
std::string Teuchos::AnyNumberParameterEntryValidator::acceptedTypesString_ [private] |
Definition at line 805 of file Teuchos_StandardParameterEntryValidators.hpp.
Definition at line 812 of file Teuchos_StandardParameterEntryValidators.hpp.
1.7.6.1