43#ifndef TEUCHOS_STANDARDVALIDATORXMLCONVERTERS_HPP
44#define TEUCHOS_STANDARDVALIDATORXMLCONVERTERS_HPP
98template<
class IntegralType>
119 #ifdef HAVE_TEUCHOS_DEBUG
162 "defaultParameterName";
183template<
class IntegralType>
184RCP<ParameterEntryValidator>
192 for (
int i=0;
i<
xmlObj.numChildren(); ++
i) {
196 "Error converting xmlObject to "
197 "StringToIntegralParameterEntryValidator." << std::endl <<
200 if (
currentChild.hasAttribute(getIntegralValueAttributeName())) {
203 getIntegralValueAttributeName()));
205 if (
currentChild.hasAttribute(getStringDocAttributeName())) {
207 currentChild.getRequired<std::string>(getStringDocAttributeName()));
211 xmlObj.getRequired(getDefaultParameterAttributeName());
215 xmlObj.getWithDefault<
bool> (getCaseSensitiveAttributeName (),
true);
230template<
class IntegralType>
252 stringTag.addAttribute(getIntegralValueAttributeName(),
260 xmlObj.addAttribute(getDefaultParameterAttributeName(),
267 xmlObj.addAttribute(getIntegralValueAttributeName(),
294 void convertValidator(
299 #ifdef HAVE_TEUCHOS_DEBUG
344 void convertValidator(
349 #ifdef HAVE_TEUCHOS_DEBUG
424#ifdef HAVE_TEUCHOS_DEBUG
468RCP<ParameterEntryValidator>
478 unsigned short int precision =
xmlObj.getWithDefault(
479 getPrecisionAttributeName(),
482 if (
xmlObj.hasAttribute(getMinAttributeName())) {
485 if (
xmlObj.hasAttribute(getMaxAttributeName())) {
507 xmlObj.addAttribute<
short unsigned int>(
540 void convertValidator(
545 #ifdef HAVE_TEUCHOS_DEBUG
596 void convertValidator(
601 #ifdef HAVE_TEUCHOS_DEBUG
629template<
class Val
idatorType,
class EntryType>
662template<
class Val
idatorType,
class EntryType>
675 getPrototypeIdAttributeName()));
683 "Could not find prototype validator with id: "
685 getPrototypeIdAttributeName()) << std::endl<< std::endl);
696template<
class Val
idatorType,
class EntryType>
748template<
class Val
idatorType,
class EntryType>
761#ifdef HAVE_TEUCHOS_DEBUG
800template<
class Val
idatorType,
class EntryType>
815#ifdef HAVE_TEUCHOS_DEBUG
#define TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
A database for ValidatorXMLConverters.
Converts back and forth between XML and ParameterEntryValidators.
Writes an XML object to a parameter list.
RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObj, const IDtoValidatorMap &validatorIDsMap) const
virtual RCP< AbstractArrayValidator< ValidatorType, EntryType > > getConcreteValidator(RCP< ValidatorType > prototypeValidator) const =0
Returns a concrete validator that has AbstractArrayValidator as it's parent class.
void convertValidator(const RCP< const ParameterEntryValidator > validator, XMLObject &xmlObj, const ValidatortoIDMap &validatorIDsMap) const
Converts AnyNumberParameterEntryValidators to and from XML.
static const std::string & getAllowIntAttributeName()
static const std::string & getPrefferedTypeAttributeName()
static const std::string & getAllowStringAttributeName()
static const std::string & getAllowDoubleAttributeName()
Converts ArrayValidators to and from XML.
virtual RCP< AbstractArrayValidator< ValidatorType, EntryType > > getConcreteValidator(RCP< ValidatorType > prototypeValidator) const
Returns a concrete validator that has AbstractArrayValidator as it's parent class.
Thrown when xml tag is encountered that is either unrecognized or inappropriate for a given context.
Converts BoolParameterEntryValidators to and from XML.
int size(const Comm< Ordinal > &comm)
Get the number of processes in the communicator.
Class for retrieving a dummy object of type T.
Class defining the traits of the number type being used in an EnhancedNumberValidator.
Converts EnhancedNumberValidators to and from XML.
static const std::string & getStepAttributeName()
void convertValidator(const RCP< const ParameterEntryValidator > validator, XMLObject &xmlObj, const ValidatortoIDMap &validatorIDsMap) const
RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObj, const IDtoValidatorMap &validatorIDsMap) const
static const std::string & getPrecisionAttributeName()
static const std::string & getMaxAttributeName()
static const std::string & getMinAttributeName()
Converts FileNameValidators to and from XML.
static const std::string & getFileMustExistAttributeName()
Maps Validators to integers.
ValidatorMap::const_iterator const_iterator
Thrown when a referenced validator can't be found.
Concrete serial communicator subclass.
int getTag() const
The current tag.
Convert a StringToIntegralParameterEntryValidator to and from XML.
static const std::string & getStringTagName()
static const std::string & getDefaultParameterAttributeName()
Name (tag) of the default parameter attribute.
static const std::string & getStringDocAttributeName()
static const std::string & getStringValueAttributeName()
static const std::string & getIntegralValueAttributeName()
RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObj, const IDtoValidatorMap &validatorIDsMap) const
void convertValidator(const RCP< const ParameterEntryValidator > validator, XMLObject &xmlObj, const ValidatortoIDMap &validatorIDsMap) const
static const std::string & getCaseSensitiveAttributeName()
Name (tag) of the caseSensitive attribute.
Converts StringValidators to and from XML.
static const std::string & getStringTagName()
static const std::string & getStringValueAttributeName()
Converts TwoDArrayValidators to and from XML.
virtual RCP< AbstractArrayValidator< ValidatorType, EntryType > > getConcreteValidator(RCP< ValidatorType > prototypeValidator) const
Returns a concrete validator that has AbstractArrayValidator as it's parent class.
Default traits class that just returns typeid(T).name().
static XMLObject convertValidator(RCP< const ParameterEntryValidator > validator, const ValidatortoIDMap &validatorIDsMap, bool assignedID=true)
Given a validator converts the validator to XML.
static RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObject, const IDtoValidatorMap &validatorIDsMap)
Given an XMLObject converts the XMLObject to a ParameterEntryValidator and inserts the validator into...
An abstract base class for converting ParameterEntryValidators to and from XML.
static const std::string & getPrototypeIdAttributeName()
A class for mapping validators to integers.
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object,...
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.