Zoltan 2 Version 0.5
Public Types | Public Member Functions | Static Public Attributes
Zoltan2::IntegerRangeListValidator< Integral > Class Template Reference

A ParameterList validator for integer range lists. More...

#include <Zoltan2_IntegerRangeList.hpp>

Inheritance diagram for Zoltan2::IntegerRangeListValidator< Integral >:
Inheritance graph
[legend]
Collaboration diagram for Zoltan2::IntegerRangeListValidator< Integral >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef unsigned int ValidatorID
typedef RCP< const Array
< std::string > > 
ValidStringsList

Public Member Functions

 IntegerRangeListValidator (bool unsorted=false)
 Constructor: any Integral is valid.
 IntegerRangeListValidator (Integral validMin, Integral validMax, bool unsorted=false)
 Constructor: only Integrals in the specified range are valid.
const std::string getXMLTypeName () const
void printDoc (std::string const &docString, std::ostream &out) const
ValidStringsList validStringValues () const
void validate (Teuchos::ParameterEntry const &entry, std::string const &paramName, std::string const &sublistName) const
void validateAndModify (std::string const &paramName, std::string const &sublistName, Teuchos::ParameterEntry *entry) const
Integral getAllowedMinimum () const
 Return the minimum value permitted in the list.
Integral getAllowedMaximum () const
 Return the maximum value permitted in the list.
bool inputListWillBeSorted () const
 Return whether the list is sorted or not.
virtual std::string description () const
virtual void describe (FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
DescribableStreamManipulatorState describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default)
std::ostream & operator<< (std::ostream &os, const DescribableStreamManipulatorState &d)
virtual void setObjectLabel (const std::string &objectLabel)
virtual std::string getObjectLabel () const

Static Public Attributes

static const EVerbosityLevel verbLevel_default

Detailed Description

template<typename Integral>
class Zoltan2::IntegerRangeListValidator< Integral >

A ParameterList validator for integer range lists.

An integer range list is a concise way to provide a list of integers. It is set as a string. Valid values are:

Examples:

A constructor flag determines how the list is processed at validateAndModify() time. Either the list is sorted and duplicates are removed, or the list remains as it was entered by the user. For example, if the list is to be modified:

Typical use cases for an integer range list are:

At the call to validateAndModify(), the integer range list parameter value is changed from a string to an Array<Integral> which encodes the meaning of the string. (The last value in the array specifies whether the values are listed, whether the user requested "all", or whether the first and last value of a range is provided.)

Helper functions for interpreting the integer range list after it has been validated are:

The template parameter is the data type of the values in the list.

Definition at line 388 of file Zoltan2_IntegerRangeList.hpp.


Constructor & Destructor Documentation

template<typename Integral >
Zoltan2::IntegerRangeListValidator< Integral >::IntegerRangeListValidator ( bool  unsorted = false)

Constructor: any Integral is valid.

Parameters:
unsortednormally the input integers will be sorted and duplicates will be removed. If this is not the desired behavior, then set unsorted to true.

Definition at line 531 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
Zoltan2::IntegerRangeListValidator< Integral >::IntegerRangeListValidator ( Integral  validMin,
Integral  validMax,
bool  unsorted = false 
)

Constructor: only Integrals in the specified range are valid.

Parameters:
validMinall values implied by the integer range list must be bounded by this minimum.
validMaxall values implied by the integer range list must be bounded by this maximum.
unsortednormally the input integers will be sorted and duplicates will be removed.. If this is not the desired behavior, then set unsorted to true.

Definition at line 537 of file Zoltan2_IntegerRangeList.hpp.


Member Function Documentation

template<typename Integral >
const std::string Zoltan2::IntegerRangeListValidator< Integral >::getXMLTypeName ( ) const [virtual]

Implements Teuchos::ParameterEntryValidator.

Definition at line 548 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
void Zoltan2::IntegerRangeListValidator< Integral >::printDoc ( std::string const &  docString,
std::ostream &  out 
) const [virtual]

Implements Teuchos::ParameterEntryValidator.

Definition at line 556 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
ValidStringsList Zoltan2::IntegerRangeListValidator< Integral >::validStringValues ( ) const [virtual]

Implements Teuchos::ParameterEntryValidator.

Definition at line 572 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
void Zoltan2::IntegerRangeListValidator< Integral >::validate ( Teuchos::ParameterEntry const &  entry,
std::string const &  paramName,
std::string const &  sublistName 
) const [virtual]

Implements Teuchos::ParameterEntryValidator.

Definition at line 578 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
void Zoltan2::IntegerRangeListValidator< Integral >::validateAndModify ( std::string const &  paramName,
std::string const &  sublistName,
Teuchos::ParameterEntry entry 
) const [virtual]

Reimplemented from Teuchos::ParameterEntryValidator.

Definition at line 631 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
Integral Zoltan2::IntegerRangeListValidator< Integral >::getAllowedMinimum ( ) const [inline]

Return the minimum value permitted in the list.

If getAllowedMinimum() > getAllowedMaximum(), then there are no limits on the integer values in the list.

Definition at line 451 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
Integral Zoltan2::IntegerRangeListValidator< Integral >::getAllowedMaximum ( ) const [inline]

Return the maximum value permitted in the list.

If getAllowedMinimum() > getAllowedMaximum(), then there are no limits on the integer values in the list.

Definition at line 458 of file Zoltan2_IntegerRangeList.hpp.

template<typename Integral >
bool Zoltan2::IntegerRangeListValidator< Integral >::inputListWillBeSorted ( ) const [inline]

Return whether the list is sorted or not.

By default, when the parameter value (a list of integers and integer ranges), is processed it is sorted and duplicates are removed. A constructor argument can be set so that the list is not sorted and duplicates are not removed.

Definition at line 466 of file Zoltan2_IntegerRangeList.hpp.


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