23 return boolParameterEntryValidator();
38 #ifdef HAVE_TEUCHOS_DEBUG
40 BoolValidatorXMLConverter::getDummyValidator()
const{
56 return anyNumberParameterEntryValidator(
77 castedValidator->getPrefferedTypeString(
78 castedValidator->getPreferredType()));
81 #ifdef HAVE_TEUCHOS_DEBUG
83 AnyNumberValidatorXMLConverter::getDummyValidator()
const{
115 #ifdef HAVE_TEUCHOS_DEBUG
117 FileNameValidatorXMLConverter::getDummyValidator()
const{
133 "Error converting xmlObject to StringValidator." << std::endl <<
134 "Unrecognized tag: " << currentChild.
getTag());
150 if(!
is_null(validator->validStringValues())){
152 validator->validStringValues()->begin();
153 for(; it != validator->validStringValues()->end(); ++it){
162 #ifdef HAVE_TEUCHOS_DEBUG
164 StringValidatorXMLConverter::getDummyValidator()
const{
static bool mustAlreadyExistDefault()
The default value of the mustAlreadyExist parameter in the constructor.
A collection of standard ValidatorXMLConverters.
const std::string & getTag() const
Return the tag of the current node.
Maps Validators to integers.
static const std::string & getAllowDoubleAttributeName()
static RCP< T > getDummyObject()
Retrieves a dummy object of type T.
void addBool(const std::string &name, bool val)
Add a bool as an attribute.
RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObj, const IDtoValidatorMap &validatorIDsMap) const
bool is_null(const std::shared_ptr< T > &p)
Returns true if p.get()==NULL.
void convertValidator(const RCP< const ParameterEntryValidator > validator, XMLObject &xmlObj, const ValidatortoIDMap &validatorIDsMap) const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
void addChild(const XMLObject &child)
Add a child node to the node.
AcceptedTypes & allowString(bool _allowString)
Set allow an std::string value or not.
RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObj, const IDtoValidatorMap &validatorIDsMap) const
static EPreferredType getPrefferedTypeStringEnum(const std::string &enumString)
Gets the preferred type enum associated with a give string.
static const std::string & getFileMustExistAttributeName()
AcceptedTypes & allowInt(bool _allowInt)
Set allow an int value or not.
static const std::string & getStringTagName()
Determines the types that are accepted.
static const std::string & getPrefferedTypeAttributeName()
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObj, const IDtoValidatorMap &validatorIDsMap) const
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object...
void convertValidator(const RCP< const ParameterEntryValidator > validator, XMLObject &xmlObj, const ValidatortoIDMap &validatorIDsMap) const
void convertValidator(const RCP< const ParameterEntryValidator > validator, XMLObject &xmlObj, const ValidatortoIDMap &validatorIDsMap) const
Validate a file name entry.
A class for mapping validators to integers.
void addAttribute(const std::string &name, T value)
Lookup whether or not Doubles are allowed.
static const std::string & getAllowIntAttributeName()
void convertValidator(const RCP< const ParameterEntryValidator > validator, XMLObject &xmlObj, const ValidatortoIDMap &validatorIDsMap) const
A simple validator that only allows certain string values to be choosen or simply enforces that a par...
bool getRequiredBool(const std::string &name) const
Get a required attribute, returning it as a bool.
int numChildren() const
Return the number of child nodes owned by this node.
static const std::string & getAllowStringAttributeName()
AcceptedTypes & allowDouble(bool _allowDouble)
Set allow a double value or not.
static const std::string & getStringValueAttributeName()
Smart reference counting pointer class for automatic garbage collection.
bool fileMustExist() const
Gets the variable describing whether or not this validator wants the file that is specified to alread...
Thrown when xml tag is encountered that is either unrecognized or inappropriate for a given context...
const XMLObject & getChild(int i) const
Return the i-th child node.
Standard implementation of a ParameterEntryValidator that accepts numbers from a number of different ...
T getWithDefault(const std::string &name, const T &defaultValue) const
Get an attribute, assigning a default value if the requested attribute does not exist.
RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObj, const IDtoValidatorMap &validatorIDsMap) const
Reference-counted pointer class and non-member templated function implementations.
const std::string & getRequired(const std::string &name) const
Get an attribute, throwing an std::exception if it is not found.