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