55 return boolParameterEntryValidator();
70#ifdef HAVE_TEUCHOS_DEBUG
72BoolValidatorXMLConverter::getDummyValidator()
const{
88 return anyNumberParameterEntryValidator(
101 rcp_dynamic_cast<const AnyNumberParameterEntryValidator>(validator,
true);
109 castedValidator->getPrefferedTypeString(
110 castedValidator->getPreferredType()));
113#ifdef HAVE_TEUCHOS_DEBUG
115AnyNumberValidatorXMLConverter::getDummyValidator()
const{
141 rcp_dynamic_cast<const FileNameValidator>(validator);
147#ifdef HAVE_TEUCHOS_DEBUG
149FileNameValidatorXMLConverter::getDummyValidator()
const{
165 "Error converting xmlObject to StringValidator." << std::endl <<
166 "Unrecognized tag: " << currentChild.
getTag());
180 rcp_dynamic_cast<const StringValidator>(validator);
182 if(!
is_null(validator->validStringValues())){
184 validator->validStringValues()->begin();
185 for(; it != validator->validStringValues()->end(); ++it){
194#ifdef HAVE_TEUCHOS_DEBUG
196StringValidatorXMLConverter::getDummyValidator()
const{
Reference-counted pointer class and non-member templated function implementations.
A collection of standard ValidatorXMLConverters.
Determines the types that are accepted.
AcceptedTypes & allowInt(bool _allowInt)
Set allow an int value or not.
AcceptedTypes & allowDouble(bool _allowDouble)
Set allow a double value or not.
AcceptedTypes & allowString(bool _allowString)
Set allow an std::string value or not.
static EPreferredType getPrefferedTypeStringEnum(const std::string &enumString)
Gets the preferred type enum associated with a give string.
static const std::string & getAllowIntAttributeName()
static const std::string & getPrefferedTypeAttributeName()
RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObj, const IDtoValidatorMap &validatorIDsMap) const
static const std::string & getAllowStringAttributeName()
static const std::string & getAllowDoubleAttributeName()
void convertValidator(const RCP< const ParameterEntryValidator > validator, XMLObject &xmlObj, const ValidatortoIDMap &validatorIDsMap) const
Replacement for std::vector that is compatible with the Teuchos Memory Management classes.
std::vector< T >::const_iterator const_iterator
The type of a const forward iterator.
Thrown when xml tag is encountered that is either unrecognized or inappropriate for a given context.
void convertValidator(const RCP< const ParameterEntryValidator > validator, XMLObject &xmlObj, const ValidatortoIDMap &validatorIDsMap) const
RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObj, const IDtoValidatorMap &validatorIDsMap) const
static RCP< T > getDummyObject()
Retrieves a dummy object of type T.
static const std::string & getFileMustExistAttributeName()
RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObj, const IDtoValidatorMap &validatorIDsMap) const
void convertValidator(const RCP< const ParameterEntryValidator > validator, XMLObject &xmlObj, const ValidatortoIDMap &validatorIDsMap) const
Validate a file name entry.
static bool mustAlreadyExistDefault()
The default value of the mustAlreadyExist parameter in the constructor.
Maps Validators to integers.
Smart reference counting pointer class for automatic garbage collection.
static const std::string & getStringTagName()
static const std::string & getStringValueAttributeName()
void convertValidator(const RCP< const ParameterEntryValidator > validator, XMLObject &xmlObj, const ValidatortoIDMap &validatorIDsMap) const
RCP< ParameterEntryValidator > convertXML(const XMLObject &xmlObj, const IDtoValidatorMap &validatorIDsMap) const
A simple validator that only allows certain string values to be choosen or simply enforces that a par...
A class for mapping validators to integers.
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object,...
void addBool(const std::string &name, bool val)
Add a bool as an attribute.
bool getRequiredBool(const std::string &name) const
Get a required attribute, returning it as a bool.
void addChild(const XMLObject &child)
Add a child node to the node.
const std::string & getRequired(const std::string &name) const
Get an attribute, throwing an std::exception if it is not found.
const std::string & getTag() const
Return the tag of the current node.
T getWithDefault(const std::string &name, const T &defaultValue) const
Get an attribute, assigning a default value if the requested attribute does not exist.
void addAttribute(const std::string &name, T value)
Lookup whether or not Doubles are allowed.
const XMLObject & getChild(int i) const
Return the i-th child node.
int numChildren() const
Return the number of child nodes owned by this node.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
bool is_null(const std::shared_ptr< T > &p)
Returns true if p.get()==NULL.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.