Teuchos Package Browser (Single Doxygen Collection) Version of the Day
Teuchos::EnhancedNumberValidator< T > Class Template Reference

Class uesd to validate a particular type of number. More...

#include <Teuchos_StandardParameterEntryValidators.hpp>

Inheritance diagram for Teuchos::EnhancedNumberValidator< T >:
Inheritance graph
[legend]

List of all members.

Constructors/Destructor

 EnhancedNumberValidator (T min, T max, T step=EnhancedNumberTraits< T >::defaultStep(), unsigned short precision=EnhancedNumberTraits< T >::defaultPrecision())
 Constructs a EnhancedNumberValidator.
 EnhancedNumberValidator ()
 Constructs a EnhancedNumberValidator without an explicit minimum or maximum.

Setter Functions

void setMin (T min)
 Sets the minimum acceptable value for the validator.
void setMax (T max)
 Sets the maximum acceptable value for the validator.
void setStep (T step)
 Sets the step being used for the validator.
void setPrecision (unsigned short precision)
 Sets the precision specified for the validator.

Getter Functions

getMin () const
 Gets the minimum acceptable value for the validator.
getMax () const
 Gets the maximum acceptable value for the validator.
getStep () const
 Gets the step being used for the validator.
unsigned short getPrecision () const
 Gets the precision specified for the validator.

Attribute/Query Methods

bool hasMin () const
 Determines whether or not the validator has a minimum value.
bool hasMax () const
 Determines whether or not the validator has a maximum value.

Overridden from ParameterEntryValidator

ValidStringsList validStringValues () const
 
void validate (ParameterEntry const &entry, std::string const &paramName, std::string const &sublistName) const
 
const std::string getXMLTypeName () const
 
void printDoc (std::string const &docString, std::ostream &out) const
 

Private Members

minVal
 The minimum value accepted by the validator.
maxVal
 The maximum value accepted by the validator.
step_
 The increment to use when increaseing or decreaseing the value the validator is validating.
unsigned short precision_
 The number of decimal places with which the nubmer will be displayed in a UI. This value is meaningless for non-floating point number types.
bool containsMin
 Whether or not a minimum value has been specified for this validator.
bool containsMax
 Whetehr or not a maximum value has been specified for this validator.

Detailed Description

template<class T>
class Teuchos::EnhancedNumberValidator< T >

Class uesd to validate a particular type of number.

Please see EnhancedNumberValidatorXMLConverter for documenation regarding the XML representation of this validator.

Definition at line 1070 of file Teuchos_StandardParameterEntryValidators.hpp.


Constructor & Destructor Documentation

template<class T >
Teuchos::EnhancedNumberValidator< T >::EnhancedNumberValidator ( min,
max,
step = EnhancedNumberTraits<T>::defaultStep(),
unsigned short  precision = EnhancedNumberTraits<T>::defaultPrecision() 
) [inline]

Constructs a EnhancedNumberValidator.

Parameters:
minThe minimum acceptable value for this validator.
maxThe maximum acceptable value for this validator.
stepThe increments at which the values being validated should be changed when incremented in a UI.
precisionThe number of decimials places to which the values validated shold be compared to the min and max and the number of decimals which are displayed in a UI. This parameter is pretty much meamingless for non-floating point types.

Definition at line 1091 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
Teuchos::EnhancedNumberValidator< T >::EnhancedNumberValidator ( ) [inline]

Constructs a EnhancedNumberValidator without an explicit minimum or maximum.

Definition at line 1103 of file Teuchos_StandardParameterEntryValidators.hpp.


Member Function Documentation

template<class T >
void Teuchos::EnhancedNumberValidator< T >::setMin ( min) [inline]

Sets the minimum acceptable value for the validator.

Parameters:
minThe desired minimum acceptable value for the validator.

Definition at line 1121 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
void Teuchos::EnhancedNumberValidator< T >::setMax ( max) [inline]

Sets the maximum acceptable value for the validator.

Parameters:
minThe desired maximum acceptable value for the validator.

Definition at line 1130 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
void Teuchos::EnhancedNumberValidator< T >::setStep ( step) [inline]

Sets the step being used for the validator.

Parameters:
Thestep to be used for the validator.

Definition at line 1139 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
void Teuchos::EnhancedNumberValidator< T >::setPrecision ( unsigned short  precision) [inline]

Sets the precision specified for the validator.

Parameters:
Theprecision specific for the validator.

Definition at line 1147 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
T Teuchos::EnhancedNumberValidator< T >::getMin ( ) const [inline]

Gets the minimum acceptable value for the validator.

Returns:
The minimum acceptable value for the validator.

Definition at line 1160 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
T Teuchos::EnhancedNumberValidator< T >::getMax ( ) const [inline]

Gets the maximum acceptable value for the validator.

Returns:
The maximum acceptable value for the validator.

Definition at line 1168 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
T Teuchos::EnhancedNumberValidator< T >::getStep ( ) const [inline]

Gets the step being used for the validator.

Returns:
The step being used for the validator.

Definition at line 1176 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
unsigned short Teuchos::EnhancedNumberValidator< T >::getPrecision ( ) const [inline]

Gets the precision specified for the validator.

Returns:
The precision specific for the validator.

Definition at line 1184 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
bool Teuchos::EnhancedNumberValidator< T >::hasMin ( ) const [inline]

Determines whether or not the validator has a minimum value.

Returns:
True if the validator has a minimum value, false otherwise.

Definition at line 1197 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
bool Teuchos::EnhancedNumberValidator< T >::hasMax ( ) const [inline]

Determines whether or not the validator has a maximum value.

Returns:
True if the validator has a maximum value, false otherwise.

Definition at line 1205 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
ValidStringsList Teuchos::EnhancedNumberValidator< T >::validStringValues ( ) const [inline, virtual]
template<class T >
void Teuchos::EnhancedNumberValidator< T >::validate ( ParameterEntry const &  entry,
std::string const &  paramName,
std::string const &  sublistName 
) const [virtual]
template<class T >
const std::string Teuchos::EnhancedNumberValidator< T >::getXMLTypeName ( ) const [inline, virtual]
template<class T >
void Teuchos::EnhancedNumberValidator< T >::printDoc ( std::string const &  docString,
std::ostream &  out 
) const [inline, virtual]

Member Data Documentation

template<class T >
T Teuchos::EnhancedNumberValidator< T >::minVal [private]

The minimum value accepted by the validator.

Definition at line 1248 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
T Teuchos::EnhancedNumberValidator< T >::maxVal [private]

The maximum value accepted by the validator.

Definition at line 1252 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
T Teuchos::EnhancedNumberValidator< T >::step_ [private]

The increment to use when increaseing or decreaseing the value the validator is validating.

Definition at line 1256 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
unsigned short Teuchos::EnhancedNumberValidator< T >::precision_ [private]

The number of decimal places with which the nubmer will be displayed in a UI. This value is meaningless for non-floating point number types.

Definition at line 1261 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
bool Teuchos::EnhancedNumberValidator< T >::containsMin [private]

Whether or not a minimum value has been specified for this validator.

Definition at line 1265 of file Teuchos_StandardParameterEntryValidators.hpp.

template<class T >
bool Teuchos::EnhancedNumberValidator< T >::containsMax [private]

Whetehr or not a maximum value has been specified for this validator.

Definition at line 1269 of file Teuchos_StandardParameterEntryValidators.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines