|
Teuchos - Trilinos Tools Package
Version of the Day
|
43 #include "Teuchos_StandardParameterEntryValidators.hpp"
45 #include "Teuchos_StaticSetupMacro.hpp"
55 getConverterMap().insert(ConverterPair(
56 validator->getXMLTypeName(), converterToAdd));
63 ConverterMap::const_iterator it = getConverterMap().find(validator.
getXMLTypeName());
66 "Could not find a ValidatorXMLConverter for validator type " <<
68 "Try adding an appropriate converter to the ValidatorXMLConverterDB " <<
69 "in order solve this problem." << std::endl << std::endl
80 ConverterMap::const_iterator it = getConverterMap().find(validatorType);
83 "Could not find a ValidatorXMLConverter for type " << validatorType <<
85 "Try adding an appropriate converter to the ValidatorXMLConverterDB " <<
86 "in order solve this problem." << std::endl << std::endl
98 validator, validatorIDsMap, assignID);
107 getConverter(xmlObject)->fromXMLtoValidator(xmlObject, validatorIDsMap);
111 ValidatorXMLConverterDB::ConverterMap&
112 ValidatorXMLConverterDB::getConverterMap()
114 static ConverterMap masterMap;
121 out <<
"Known ValidatorXMLConverters: " << std::endl;
123 ConverterMap::const_iterator it = getConverterMap().begin();
124 it != getConverterMap().end();
127 out <<
"\t" << it->first <<std::endl;
138 TEUCHOS_STATIC_SETUP()
static void addConverter(RCP< const ParameterEntryValidator > validator, RCP< ValidatorXMLConverter > converterToAdd)
Add a converter to the database.
static const std::string & getTypeAttributeName()
Standard implementation of a BoolParameterEntryValidator that accepts bool values (true/false) or str...
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object,...
#define TEUCHOS_ADD_NUMBERTYPE_VALIDATOR_CONVERTERS(T)
Add numeric parameter types for type T.
A simple validator that only allows certain string values to be choosen or simply enforces that a par...
static RCP< const ValidatorXMLConverter > getConverter(const ParameterEntryValidator &validator)
Get an appropriate ValidatorXMLConverter given a Validator.
Maps Validators to integers.
Abstract interface for an object that can validate a ParameterEntry's value.
EVerbosityLevel
Verbosity level.
#define TEUCHOS_ADD_ENHANCEDNUMBERVALIDATOR_CONVERTER(T)
Add EnhancedNumberValidator<T> to the set of supported parameter types.
Smart reference counting pointer class for automatic garbage collection.
#define TEUCHOS_ADD_ARRAYVALIDATOR_CONVERTER(VALIDATORTYPE, ENTRYTYPE)
Add ArrayValidator<VALIDATORTYPE, ENTRYTYPE> to set of supported parameter types.
A class for mapping validators to integers.
Standard implementation of a ParameterEntryValidator that accepts numbers from a number of different ...
Class uesd to validate a particular type of number.
Converts BoolParameterEntryValidators to and from XML.
Converts StringValidators to and from XML.
Converts AnyNumberParameterEntryValidators to and from XML.
Converts FileNameValidators to and from XML.
static XMLObject convertValidator(RCP< const ParameterEntryValidator > validator, const ValidatortoIDMap &validatorIDsMap, bool assignedID=true)
Given a validator converts the validator to XML.
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.
Validate a file name entry.
#define TEUCHOS_ADD_VALIDATOR_CONVERTER(VALIDATOR_TYPE, CONVERTER_TYPE)
Add a validator converter of type CONVERTER_TYPE which converts validators of VALIDATOR_TYPE to the m...
static RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObject, const IDtoValidatorMap &validatorIDsMap)
Given an XMLObject converts the XMLObject to a ParameterEntryValidator and inserts the validator into...
#define TEUCHOS_ADD_STRINGTOINTEGRALVALIDATOR_CONVERTER(INTEGRALTYPE)
Add StringToIntegralParameterEntryValidator<INTEGRAL_TYPE> to set of supported parameter types.
static void printKnownConverters(std::ostream &out)
prints the xml tags associated with all known converters
Thrown when the ValidatorXMLConverterDB can't find an appropriate converter.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
const std::string & getRequired(const std::string &name) const
Get an attribute, throwing an std::exception if it is not found.
A database for ValidatorXMLConverters.