42#ifndef TEUCHOS_STANDARDDEPENDENCYXMLCONVERTERS_HPP
43#define TEUCHOS_STANDARDDEPENDENCYXMLCONVERTERS_HPP
115 void convertDependency(
192 void convertDependency(
228 void convertSpecialVisualAttributes(
291 void convertSpecialVisualAttributes(
380 "A NumberVisualDependency can only have 1 dependee!" <<
381 std::endl << std::endl);
419 void convertSpecialVisualAttributes(
465 void convertSpecialValidatorAttributes(
491 static const std::string
pairTag =
"Pair";
510 "defaultValidatorId";
542 void convertSpecialValidatorAttributes(
638 static const std::string
pairTag =
"Pair";
664 "defaultValidatorId";
691 T min =
it->first.first;
692 T max =
it->first.second;
699 pairTag.addAttribute(getMinAttributeName(), min);
700 pairTag.addAttribute(getMaxAttributeName(), max);
712 getDefaultValidatorIdAttributeName(),
726 int result =
xmlObj.findFirstChild(getRangesAndValidatorsTag());
729 "Error: All RangeValidatorDependencies must have a " <<
730 getRangesAndValidatorsTag() <<
" tag!" << std::endl << std::endl);
738 T min =
child.getRequired<
T>(getMinAttributeName());
739 T max =
child.getRequired<
T>(getMaxAttributeName());
742 getValidatorIdAttributeName());
747 "Could not find validator in given ValidatorIDsMap! " << std::endl <<
758 if(
xmlObj.hasAttribute(getDefaultValidatorIdAttributeName())){
761 getDefaultValidatorIdAttributeName());
765 "Could not find a validator (for the default validator) " <<
767 " in the given validatorIDsMap!" << std::endl << std::endl);
779template<
class DependeeType,
class DependentType>
831template<
class DependeeType,
class DependentType>
842 "A ArrayModifierDependency can only have 1 dependee!" <<
843 std::endl << std::endl);
854template<
class DependeeType,
class DependentType>
889template<
class DependeeType,
class DependentType>
906template<
class DependeeType,
class DependentType>
935template<
class DependeeType,
class DependentType>
953template<
class DependeeType,
class DependentType>
981template<
class DependeeType,
class DependentType>
999template<
class DependeeType,
class DependentType>
#define TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
Converts back and forth between XML and Dependencies.
A database for FunctionObjectXMLConverters.
A collection of standard dependencies.
A collection of Exceptions thrown when converting Dependencys to and from XML.
A converter used to convert ArrayModifierDepdencies to and from xml.
void convertDependency(const RCP< const Dependency > dependency, XMLObject &xmlObj, const XMLParameterListWriter::EntryIDsMap &entryIDsMap, ValidatortoIDMap &validatorIDsMap) const
RCP< Dependency > convertXML(const XMLObject &xmlObj, const Dependency::ConstParameterEntryList dependees, const Dependency::ParameterEntryList dependets, const XMLParameterListReader::EntryIDsMap &entryIDsMap, const IDtoValidatorMap &validatorIDsMap) const
virtual RCP< ArrayModifierDependency< DependeeType, DependentType > > getConcreteDependency(RCP< const ParameterEntry > dependee, Dependency::ParameterEntryList dependents, RCP< const SimpleFunctionObject< DependeeType > > function) const =0
Obtains a concrete ArrayModifierDependency given a dependee, dependtns, and a funciton object.
An xml converter for BoolValidatorDependencies.
static const std::string & getFalseValidatorIdAttributeName()
static const std::string & getTrueValidatorIdAttributeName()
An xml converter for BoolVisualDepenencies.
int size(const Comm< Ordinal > &comm)
Get the number of processes in the communicator.
An xml converter for ConditionVisualDependencies.
An abstract base class for converting Dependencies to and from XML.
std::set< RCP< ParameterEntry >, RCPComp > ParameterEntryList
A list of Dependees.
std::set< RCP< const ParameterEntry >, RCPConstComp > ConstParameterEntryList
A list of dependents.
static XMLObject convertFunctionObject(RCP< const FunctionObject > function)
Given a FunctionObject, converts the FunctionObject to XML.
static RCP< FunctionObject > convertXML(const XMLObject &xmlObject)
Given an XMLObject, converts the XMLObject to a FunctionObject.
static const std::string & getXMLTagName()
Returns the name of the XML tag used to indicate a funciton object.
Maps Validators to integers.
Thrown when the rangesAndValidators tag for the RangeValidatorDepencyConverter can't be found.
Thrown when converting a dependency that has validaotrs to and from XML. This excetpion indicates tha...
An xml converter for NumberArrayLengthDependencies.
virtual RCP< ArrayModifierDependency< DependeeType, DependentType > > getConcreteDependency(RCP< const ParameterEntry > dependee, Dependency::ParameterEntryList dependents, RCP< const SimpleFunctionObject< DependeeType > > function) const
Obtains a concrete ArrayModifierDependency given a dependee, dependtns, and a funciton object.
An xml converter for NumberVisualDependencies.
void convertSpecialVisualAttributes(RCP< const VisualDependency > dependency, XMLObject &xmlObj, const XMLParameterListWriter::EntryIDsMap &entryIDsMap) const
Smart reference counting pointer class for automatic garbage collection.
An xml converter for RangeValidatorDependencies.
void convertSpecialValidatorAttributes(RCP< const ValidatorDependency > dependency, XMLObject &xmlObj, ValidatortoIDMap &validatorIDsMap) const
static const std::string & getDefaultValidatorIdAttributeName()
static const std::string & getMaxAttributeName()
static const std::string & getValidatorIdAttributeName()
static const std::string & getRangesAndValidatorsTag()
static const std::string & getPairTag()
static const std::string & getMinAttributeName()
A RangeValidatorDependency says the following about the relationship between two parameters: Dependen...
std::pair< Range, RCP< const ParameterEntryValidator > > RangeValidatorPair
Convenience typedef.
std::map< Range, RCP< const ParameterEntryValidator > > RangeToValidatorMap
Convenience typedef.
std::pair< T, T > Range
Convenience typedef.
Concrete serial communicator subclass.
An xml converter for StringValidatorDependencies.
static const std::string & getValuesAndValidatorsTag()
static const std::string & getPairTag()
static const std::string & getDefaultValidatorIdAttributeName()
static const std::string & getValidatorIdAttributeName()
static const std::string & getValueAttributeName()
An xml converter for StringVisualDepenencies.
static const std::string & getValueAttributeName()
Gets the Value attribute name.
static const std::string & getStringValuesTagName()
Gets the StringValues Tag.
static const std::string & getStringTagName()
Gets the String Tag.
Thrown when a Dependency has too many dependees specified in its XML.
A class for converting TwoDColDependencies to and from XML.
virtual RCP< ArrayModifierDependency< DependeeType, DependentType > > getConcreteDependency(RCP< const ParameterEntry > dependee, Dependency::ParameterEntryList dependents, RCP< const SimpleFunctionObject< DependeeType > > function) const
Obtains a concrete ArrayModifierDependency given a dependee, dependtns, and a funciton object.
A class for converting TwoDRowDependencies to and from XML.
virtual RCP< ArrayModifierDependency< DependeeType, DependentType > > getConcreteDependency(RCP< const ParameterEntry > dependee, Dependency::ParameterEntryList dependents, RCP< const SimpleFunctionObject< DependeeType > > function) const
Obtains a concrete ArrayModifierDependency given a dependee, dependtns, and a funciton object.
An xml converter for ValidatorDependencies.
virtual RCP< ValidatorDependency > convertSpecialValidatorAttributes(const XMLObject &xmlObj, RCP< const ParameterEntry > dependee, const Dependency::ParameterEntryList dependents, const IDtoValidatorMap &validatorIDsMap) const =0
Converts any special aspects of a specific validator dependency from xml.
virtual void convertSpecialValidatorAttributes(RCP< const ValidatorDependency > dependency, XMLObject &xmlObj, ValidatortoIDMap &validatorIDsMap) const =0
Converts any special aspects of a specific validator dependency to xml.
A class for mapping validators to integers.
An xml converter for VisualDepenencies.
virtual void convertSpecialVisualAttributes(RCP< const VisualDependency > dependency, XMLObject &xmlObj, const XMLParameterListWriter::EntryIDsMap &entryIDsMap) const =0
Converts any special aspects of a specific visual dependency to xml.
static const std::string & getShowIfAttributeName()
Gets the name of the showif attribute.
virtual RCP< VisualDependency > convertSpecialVisualAttributes(const XMLObject &xmlObj, const Dependency::ConstParameterEntryList dependees, const Dependency::ParameterEntryList dependets, bool showIf, const XMLParameterListReader::EntryIDsMap &entryIDsMap) const =0
Converts any special aspects of a specific visual dependency from xml.
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object,...
std::map< ParameterEntry::ParameterEntryID, RCP< ParameterEntry > > EntryIDsMap
Convenience typedef.
std::map< RCP< const ParameterEntry >, ParameterEntry::ParameterEntryID, RCPConstComp > EntryIDsMap
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
bool nonnull(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.