Teuchos - Trilinos Tools Package
Version of the Day
|
Abstract interface for an object that can validate a ParameterEntry's value. More...
#include <Teuchos_ParameterEntryValidator.hpp>
Public Types | |
Public types | |
typedef unsigned int | ValidatorID |
typedef RCP< const Array < std::string > > | ValidStringsList |
Public Member Functions | |
ParameterEntryValidator () | |
Default Constructor. More... | |
virtual const std::string | getXMLTypeName () const =0 |
Get a string that should be used as a value of the type attribute when serializing it to XML. More... | |
virtual void | printDoc (std::string const &docString, std::ostream &out) const =0 |
Print documentation for this parameter. More... | |
virtual ValidStringsList | validStringValues () const =0 |
Return an array of strings of valid values if applicable. More... | |
virtual void | validate (ParameterEntry const &entry, std::string const ¶mName, std::string const &sublistName) const =0 |
Validate a parameter entry value and throw std::exception (with a great error message) if validation fails. 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... | |
Additional Inherited Members | |
Static Public Attributes inherited from Teuchos::Describable | |
static const EVerbosityLevel | verbLevel_default = VERB_DEFAULT |
Default value for the verbLevel argument of describe(). 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... | |
Abstract interface for an object that can validate a ParameterEntry's value.
Not only can a validator validate and entry but it can also help to set and/or adjust the default value.
Definition at line 31 of file Teuchos_ParameterEntryValidator.hpp.
typedef unsigned int Teuchos::ParameterEntryValidator::ValidatorID |
Definition at line 39 of file Teuchos_ParameterEntryValidator.hpp.
typedef RCP<const Array<std::string> > Teuchos::ParameterEntryValidator::ValidStringsList |
Definition at line 42 of file Teuchos_ParameterEntryValidator.hpp.
|
inline |
Default Constructor.
Definition at line 47 of file Teuchos_ParameterEntryValidator.hpp.
|
pure virtual |
Get a string that should be used as a value of the type attribute when serializing it to XML.
Implemented in Teuchos::ArrayValidator< ValidatorType, EntryType >, Teuchos::ArrayValidator< EnhancedNumberValidator< T >, T >, Teuchos::ArrayValidator< StringValidator, std::string >, Teuchos::ArrayValidator< FileNameValidator, std::string >, Teuchos::TwoDArrayValidator< ValidatorType, EntryType >, Teuchos::TwoDArrayValidator< EnhancedNumberValidator< T >, T >, Teuchos::TwoDArrayValidator< StringValidator, std::string >, Teuchos::TwoDArrayValidator< FileNameValidator, std::string >, Teuchos::StringValidator, Teuchos::FileNameValidator, Teuchos::EnhancedNumberValidator< T >, Teuchos::AnyNumberParameterEntryValidator, Teuchos::BoolParameterEntryValidator, Teuchos::StringToIntegralParameterEntryValidator< IntegralType >, and Teuchos::StringToIntegralParameterEntryValidator< int >.
|
pure virtual |
Print documentation for this parameter.
docString | [in] (Multi-line) documentation std::string. |
out | [out] The std::ostream used for the output |
The purpose of this function is to augment what is in docString
with some description of what valid values this parameter validator will accept.
Implemented in Teuchos::ArrayValidator< ValidatorType, EntryType >, Teuchos::ArrayValidator< EnhancedNumberValidator< T >, T >, Teuchos::ArrayValidator< StringValidator, std::string >, Teuchos::ArrayValidator< FileNameValidator, std::string >, Teuchos::TwoDArrayValidator< ValidatorType, EntryType >, Teuchos::TwoDArrayValidator< EnhancedNumberValidator< T >, T >, Teuchos::TwoDArrayValidator< StringValidator, std::string >, Teuchos::TwoDArrayValidator< FileNameValidator, std::string >, Teuchos::StringValidator, Teuchos::FileNameValidator, Teuchos::EnhancedNumberValidator< T >, Teuchos::AnyNumberParameterEntryValidator, Teuchos::BoolParameterEntryValidator, Teuchos::StringToIntegralParameterEntryValidator< IntegralType >, and Teuchos::StringToIntegralParameterEntryValidator< int >.
|
pure virtual |
Return an array of strings of valid values if applicable.
If there is no such array of std::string values that makes since, just return return.get()==NULL
.
The returned strings must not contain any newlines (i.e. no '
characters) and must be short enough to fit on one line and be readable.
'
Implemented in Teuchos::AbstractArrayValidator< ValidatorType, EntryType >, Teuchos::AbstractArrayValidator< EnhancedNumberValidator< T >, T >, Teuchos::AbstractArrayValidator< StringValidator, std::string >, Teuchos::AbstractArrayValidator< FileNameValidator, std::string >, Teuchos::StringValidator, Teuchos::FileNameValidator, Teuchos::EnhancedNumberValidator< T >, Teuchos::AnyNumberParameterEntryValidator, Teuchos::BoolParameterEntryValidator, Teuchos::StringToIntegralParameterEntryValidator< IntegralType >, and Teuchos::StringToIntegralParameterEntryValidator< int >.
|
pure virtual |
Validate a parameter entry value and throw std::exception (with a great error message) if validation fails.
entry | [in] The ParameterEntry who's type and value is being validated |
paramName | [in] The name of the ParameterEntry that is used to build error messages. |
sublistName | [in] The name of the ParameterList that paramName exists in that is used to build error messages. |
Implemented in Teuchos::ArrayValidator< ValidatorType, EntryType >, Teuchos::ArrayValidator< EnhancedNumberValidator< T >, T >, Teuchos::ArrayValidator< StringValidator, std::string >, Teuchos::ArrayValidator< FileNameValidator, std::string >, Teuchos::TwoDArrayValidator< ValidatorType, EntryType >, Teuchos::TwoDArrayValidator< EnhancedNumberValidator< T >, T >, Teuchos::TwoDArrayValidator< StringValidator, std::string >, Teuchos::TwoDArrayValidator< FileNameValidator, std::string >, Teuchos::StringValidator, Teuchos::FileNameValidator, Teuchos::EnhancedNumberValidator< T >, Teuchos::AnyNumberParameterEntryValidator, Teuchos::BoolParameterEntryValidator, Teuchos::StringToIntegralParameterEntryValidator< IntegralType >, and Teuchos::StringToIntegralParameterEntryValidator< int >.
|
inlinevirtual |
Validate and perhaps modify a parameter entry's value.
paramName | [in] The name of the ParameterEntry that is used to build error messages. |
sublistName | [in] The name of the ParameterList that paramName exists in that is used to build error messages. |
entry | [in/out] The ParameterEntry who's type and value is being validated and perhaps even changed as a result of calling this function. |
The default implementation simply calls this->validate()
.
Reimplemented in Teuchos::EnhancedNumberValidator< T >, Teuchos::AnyNumberParameterEntryValidator, and Teuchos::BoolParameterEntryValidator.
Definition at line 113 of file Teuchos_ParameterEntryValidator.hpp.