Teuchos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
List of all members
Teuchos::ParameterEntryValidator Class Referenceabstract

Abstract interface for an object that can validate a ParameterEntry's value. More...

#include <Teuchos_ParameterEntryValidator.hpp>

Inheritance diagram for Teuchos::ParameterEntryValidator:
Inheritance graph
[legend]

Public types

typedef unsigned int ValidatorID
 
typedef RCP< const Array< std::string > > ValidStringsList
 
 ParameterEntryValidator ()
 Default Constructor.
 
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.
 
virtual void printDoc (std::string const &docString, std::ostream &out) const =0
 Print documentation for this parameter.
 
virtual ValidStringsList validStringValues () const =0
 Return an array of strings of valid values if applicable.
 
virtual void validate (ParameterEntry const &entry, std::string const &paramName, std::string const &sublistName) const =0
 Validate a parameter entry value and throw std::exception (with a great error message) if validation fails.
 
virtual void validateAndModify (std::string const &paramName, std::string const &sublistName, ParameterEntry *entry) const
 Validate and perhaps modify a parameter entry's value.
 
double convertStringToDouble (std::string str) const
 
int convertStringToInt (std::string str) const
 
int convertStringToLongLong (std::string str) const
 

Additional Inherited Members

- Public Member Functions inherited from Teuchos::Describable
virtual std::string description () const
 Return a simple one-line description of this object.
 
virtual void describe (FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 Print the object with some verbosity level to a FancyOStream.
 
void describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 Version of describe() that takes an std::ostream instead of a FancyOStream.
 
virtual ~Describable ()
 Destructor (marked virtual for memory safety of derived classes).
 
- Public Member Functions inherited from Teuchos::LabeledObject
 LabeledObject ()
 Construct with an empty label.
 
virtual ~LabeledObject ()
 
virtual void setObjectLabel (const std::string &objectLabel)
 Set the object label (see LabeledObject).
 
virtual std::string getObjectLabel () const
 Get the object label (see LabeledObject).
 
- Static Public Attributes inherited from Teuchos::Describable
static const EVerbosityLevel verbLevel_default = VERB_DEFAULT
 Default value for the verbLevel argument of describe().
 

Detailed Description

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 64 of file Teuchos_ParameterEntryValidator.hpp.

Member Typedef Documentation

◆ ValidatorID

Definition at line 72 of file Teuchos_ParameterEntryValidator.hpp.

◆ ValidStringsList

Definition at line 75 of file Teuchos_ParameterEntryValidator.hpp.

Constructor & Destructor Documentation

◆ ParameterEntryValidator()

Teuchos::ParameterEntryValidator::ParameterEntryValidator ( )
inline

Default Constructor.

Definition at line 80 of file Teuchos_ParameterEntryValidator.hpp.

Member Function Documentation

◆ getXMLTypeName()

virtual const std::string Teuchos::ParameterEntryValidator::getXMLTypeName ( ) const
pure virtual

◆ printDoc()

virtual void Teuchos::ParameterEntryValidator::printDoc ( std::string const & docString,
std::ostream & out ) const
pure virtual

◆ validStringValues()

virtual ValidStringsList Teuchos::ParameterEntryValidator::validStringValues ( ) const
pure virtual

◆ validate()

virtual void Teuchos::ParameterEntryValidator::validate ( ParameterEntry const & entry,
std::string const & paramName,
std::string const & sublistName ) const
pure virtual

◆ validateAndModify()

virtual void Teuchos::ParameterEntryValidator::validateAndModify ( std::string const & paramName,
std::string const & sublistName,
ParameterEntry * entry ) const
inlinevirtual

Validate and perhaps modify a parameter entry's value.

Parameters
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::BoolParameterEntryValidator, Teuchos::AnyNumberParameterEntryValidator, and Teuchos::EnhancedNumberValidator< T >.

Definition at line 146 of file Teuchos_ParameterEntryValidator.hpp.

◆ convertStringToDouble()

double Teuchos::ParameterEntryValidator::convertStringToDouble ( std::string str) const
inline

Definition at line 156 of file Teuchos_ParameterEntryValidator.hpp.

◆ convertStringToInt()

int Teuchos::ParameterEntryValidator::convertStringToInt ( std::string str) const
inline

Definition at line 170 of file Teuchos_ParameterEntryValidator.hpp.

◆ convertStringToLongLong()

int Teuchos::ParameterEntryValidator::convertStringToLongLong ( std::string str) const
inline

Definition at line 184 of file Teuchos_ParameterEntryValidator.hpp.


The documentation for this class was generated from the following file: