59 typedef unsigned short int ushort;
60 typedef unsigned int uint;
61 typedef unsigned long int ulong;
63 #ifdef HAVE_TEUCHOS_LONG_LONG_INT
64 typedef long long int llint;
65 typedef unsigned long long int ullint;
68 #define BASIC_DEPENDENCY_TEST( \
69 DEPENDENCY, DEPTYPE, NUM_DEPENDEES, NUM_DEPENDENTS) \
70 std::string depXMLTag##DEPENDENCY = \
71 DummyObjectGetter< DEPTYPE >::getDummyObject()->getTypeAttributeValue(); \
73 TEST_ASSERT(DEPENDENCY->getTypeAttributeValue() == depXMLTag##DEPENDENCY ); \
74 TEST_ASSERT(DEPENDENCY->getDependents().size() == NUM_DEPENDENTS); \
75 TEST_ASSERT(DEPENDENCY->getDependees().size() == NUM_DEPENDEES); \
77 #define VERIFY_DEPENDENT(DEPENDENCY, DEPENDENT) \
79 DEPENDENCY->getDependents().find(DEPENDENT) \
81 DEPENDENCY->getDependents().end() \
84 #define VERIFY_DEPENDEE(DEPENDENCY, DEPENDEE) \
86 DEPENDENCY->getDependees().find(DEPENDEE) \
88 DEPENDENCY->getDependees().end()); \
90 #define CREATE_DEPENDEE(POSTFIX, VALUE) \
91 RCP<ParameterEntry> dependeeParam##POSTFIX = rcp( \
92 new ParameterEntry( VALUE ));
94 #define CREATE_DEPENDENT(POSTFIX, VALUE) \
95 RCP<ParameterEntry> dependentParam##POSTFIX = \
96 rcp(new ParameterEntry( VALUE )); \
98 #define EXCEPTION_TEST_BOILERPLATE(DEPENDEE_VAL, DEPENDENT_VAL) \
99 CREATE_DEPENDEE(1, DEPENDEE_VAL); \
100 CREATE_DEPENDEE(Extra, DEPENDEE_VAL); \
101 CREATE_DEPENDENT(1, DEPENDENT_VAL); \
103 XMLParameterListWriter::EntryIDsMap writerEntryMap; \
104 writerEntryMap[dependeeParam1] = 1; \
105 writerEntryMap[dependentParam1] = 2; \
106 writerEntryMap[dependeeParamExtra] = 3; \
107 ValidatortoIDMap writerValiMap; \
109 XMLParameterListReader::EntryIDsMap readerEntryMap; \
110 readerEntryMap[1] = dependeeParam1; \
111 readerEntryMap[2] = dependentParam1; \
112 readerEntryMap[3] = dependeeParamExtra; \
113 IDtoValidatorMap readerValiMap; \
115 #define CONVERT_DEP_TO_XML(DEPENDENCY) \
116 XMLObject DEPENDENCY##XML = DependencyXMLConverterDB::convertDependency( \
117 DEPENDENCY , writerEntryMap, writerValiMap); \
119 #define TOO_MANY_DEPENDEE_TEST(DEPENDENCY) \
120 XMLObject extraDependee(DependencyXMLConverter::getDependeeTagName()); \
121 extraDependee.addAttribute<ParameterEntry::ParameterEntryID>( \
122 DependencyXMLConverter::getParameterIdAttributeName(), \
123 writerEntryMap[dependeeParamExtra]); \
124 XMLObject tooManyTempXML = DEPENDENCY##XML.deepCopy(); \
125 tooManyTempXML.addChild(extraDependee); \
128 DependencyXMLConverterDB::convertXML( \
129 tooManyTempXML , readerEntryMap, readerValiMap), \
130 TooManyDependeesException); \
132 #define COPY_DEPTAG_WITHOUT_CHILD(TAG, CHILDTAG, NEWTAG) \
133 XMLObject NEWTAG(TAG.getTag()); \
134 NEWTAG.addAttribute( \
135 DependencyXMLConverter::getTypeAttributeName(), \
136 TAG.getAttribute(DependencyXMLConverter::getTypeAttributeName())); \
137 for(int i =0; i< TAG.numChildren(); i++){ \
138 if(TAG.getChild(i).getTag() != CHILDTAG) \
140 NEWTAG.addChild(TAG.getChild(i).deepCopy()); \
145 #define INSERT_VALIDATOR_TO_MAPS(VALIDATOR) \
146 writerValiMap.insert( VALIDATOR ); \
147 readerValiMap.insert( \
148 IDtoValidatorMap::IDValidatorPair( \
149 writerValiMap.find( VALIDATOR )->second, VALIDATOR )); \
162 dependentList.insert(dependent1);
163 dependentList.insert(dependent2);
181 std::string dependee1 =
"string param";
182 std::string dependee2 =
"string param2";
183 std::string dependent1 =
"dependent param1";
184 std::string dependent2 =
"dependent param2";
187 myDepList.
set(dependee1,
"val1");
188 myDepList.
set(dependee2,
"val2");
189 myDepList.
set(dependent1, 1.0);
190 myDepList.
set(dependent2, 1.0);
201 dependentList.insert(myDepList.
getEntryRCP(dependent1));
202 dependentList.insert(myDepList.
getEntryRCP(dependent2));
204 tuple<std::string>(
"val1",
"val2");
251 castedDep1->
getValues(), basicStringVisDep->getValues());
253 castedDep2->getValues(), complexStringVisDep->getValues());
256 TEST_EQUALITY(castedDep2->getShowIf(), complexStringVisDep->getShowIf());
260 std::string dependee1 =
"bool param";
261 std::string dependee2 =
"bool param2";
262 std::string dependent1 =
"dependent param1";
263 std::string dependent2 =
"dependent param2";
266 myDepList.
set(dependee1,
true);
267 myDepList.
set(dependee2,
true);
268 myDepList.
set(dependent1, 1.0);
269 myDepList.
set(dependent2, 1.0);
277 dependentList.insert(myDepList.
getEntryRCP(dependent1));
278 dependentList.insert(myDepList.
getEntryRCP(dependent2));
329 Teuchos_Dependencies,
330 NumberVisualDepSerialization,
333 std::string dependee1 =
"num param";
334 std::string dependee2 =
"num param2";
335 std::string dependent1 =
"dependent param1";
336 std::string dependent2 =
"dependent param2";
341 myDepList.
set(dependent1,
true);
342 myDepList.
set(dependent2,
"vale");
350 dependentList.insert(myDepList.
getEntryRCP(dependent1));
351 dependentList.insert(myDepList.
getEntryRCP(dependent2));
400 TEST_EQUALITY(castedDep1->getShowIf(), simpleNumVisDep->getShowIf());
401 TEST_EQUALITY(castedDep2->getShowIf(), complexNumVisDep->getShowIf());
404 castedDep2->getFunctionObject();
410 castedFunction->getModifiyingOperand(),
411 subFunction->getModifiyingOperand());
414 #define NUMBER_VIS_TEST(T) \
415 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( \
416 Teuchos_Dependencies, NumberVisualDepSerialization, T)
421 #ifdef HAVE_TEUCHOS_LONG_LONG_INT
426 std::string dependee1 =
"string param";
427 std::string dependee2 =
"bool param";
428 std::string dependee3 =
"int param";
429 std::string dependent1 =
"dependent param1";
430 std::string dependent2 =
"dependent param2";
431 std::string dependent3 =
"dependent param3";
434 myDepList.
set(dependee1,
"val1");
435 myDepList.
set(dependee2,
true);
436 myDepList.
set(dependee3, 1);
437 myDepList.
set(dependent1, 1.0);
438 myDepList.
set(dependent2, 1.0);
439 myDepList.
set(dependent3, (
float)1.0);
442 tuple<std::string>(
"steve",
"blah",
"your face");
454 tuple<RCP<const Condition> >(boolCon, numberCon);
464 dependentList.insert(myDepList.
getEntryRCP(dependent2));
465 dependentList.insert(myDepList.
getEntryRCP(dependent3));
522 simpleConVisDep->
getCondition()->getTypeAttributeValue());
523 TEST_EQUALITY(castedDep2->getCondition()->getTypeAttributeValue(),
524 complexConVisDep->
getCondition()->getTypeAttributeValue());
527 #define ArrayModifierTest(DEPENDENCYTYPE, ARRAY_TYPE) \
528 TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( \
529 Teuchos_Dependencies, \
530 DEPENDENCYTYPE##_serialization_tests, \
534 std::string dependee1 = "dependee param"; \
535 std::string dependee2 = "dependee param2"; \
536 std::string dependent1 = "dependent param1"; \
537 std::string dependent2 = "dependent param2"; \
538 ParameterList myDepList("Array modifier dep list"); \
539 RCP<DependencySheet> myDepSheet = rcp(new DependencySheet); \
540 myDepList.set(dependee1, ScalarTraits<DependeeType>::one()); \
541 myDepList.set(dependee2, ScalarTraits<DependeeType>::one()); \
542 myDepList.set(dependent1, ARRAY_TYPE<DependentType>()); \
543 myDepList.set(dependent2, ARRAY_TYPE<DependentType>()); \
546 RCP<DEPENDENCYTYPE<DependeeType, DependentType> > basicArrayDep = \
547 rcp(new DEPENDENCYTYPE<DependeeType, DependentType>( \
548 myDepList.getEntryRCP(dependee1), \
549 myDepList.getEntryRCP(dependent1))); \
551 DependeeType one = ScalarTraits< DependeeType >::one(); \
552 RCP<AdditionFunction< DependeeType > > functionTester = \
553 rcp(new AdditionFunction<DependeeType>(one)); \
555 RCP<DEPENDENCYTYPE<DependeeType, DependentType> > funcArrayDep = \
556 rcp(new DEPENDENCYTYPE<DependeeType, DependentType>( \
557 myDepList.getEntryRCP(dependee2), \
558 myDepList.getEntryRCP(dependent2), \
562 myDepSheet->addDependency(basicArrayDep); \
563 myDepSheet->addDependency(funcArrayDep); \
565 RCP<DependencySheet> readInDepSheet = rcp(new DependencySheet); \
567 XMLParameterListWriter plWriter; \
568 XMLObject xmlOut = plWriter.toXML(myDepList, myDepSheet); \
569 out << xmlOut.toString(); \
571 RCP<ParameterList> readInList = \
572 writeThenReadPL(myDepList, myDepSheet, readInDepSheet); \
574 RCP<ParameterEntry> readinDependee1 = readInList->getEntryRCP(dependee1); \
575 RCP<ParameterEntry> readinDependent1 = readInList->getEntryRCP(dependent1); \
576 RCP<ParameterEntry> readinDependee2 = readInList->getEntryRCP(dependee2); \
577 RCP<ParameterEntry> readinDependent2 = readInList->getEntryRCP(dependent2); \
579 RCP<Dependency> readinDep1 = \
580 *(readInDepSheet->getDependenciesForParameter(readinDependee1)->begin()); \
581 RCP<Dependency> readinDep2 = \
582 *(readInDepSheet->getDependenciesForParameter(readinDependee2)->begin()); \
584 typedef DEPENDENCYTYPE<DependeeType, DependentType> deptype; \
585 BASIC_DEPENDENCY_TEST(readinDep1, deptype, 1, 1); \
586 VERIFY_DEPENDEE(readinDep1, readinDependee1); \
587 VERIFY_DEPENDENT(readinDep1, readinDependent1); \
589 BASIC_DEPENDENCY_TEST(readinDep2, deptype, 1, 1); \
590 VERIFY_DEPENDEE(readinDep2, readinDependee2); \
591 VERIFY_DEPENDENT(readinDep2, readinDependent2); \
593 RCP<DEPENDENCYTYPE<DependeeType, DependentType> > castedDep1 = \
594 rcp_dynamic_cast<DEPENDENCYTYPE<DependeeType, DependentType> >( \
596 TEST_ASSERT(castedDep1 != null); \
598 RCP<DEPENDENCYTYPE<DependeeType, DependentType> > castedDep2 = \
599 rcp_dynamic_cast<DEPENDENCYTYPE<DependeeType, DependentType> >( \
601 TEST_ASSERT(castedDep2 != null); \
603 RCP<const SimpleFunctionObject< DependeeType > > readInFunc = \
604 castedDep2->getFunctionObject(); \
605 TEST_ASSERT(readInFunc != null); \
607 RCP<const AdditionFunction< DependeeType > > castedFunc = \
608 rcp_dynamic_cast<const AdditionFunction< DependeeType > >(readInFunc); \
609 TEST_ASSERT(castedFunc != null); \
611 castedFunc->getModifiyingOperand(), \
612 functionTester->getModifiyingOperand()); \
617 #define NUM_ARRAY_LENGTH_TEST(DependeeType, DependentType) \
618 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( \
619 Teuchos_Dependencies, \
620 NumberArrayLengthDependency_serialization_tests, \
628 #ifdef HAVE_TEUCHOS_LONG_LONG_INT
629 #define NUM_ARRAY_LENGTH_TEST_GROUP(DependeeType) \
630 NUM_ARRAY_LENGTH_TEST(DependeeType, int) \
631 NUM_ARRAY_LENGTH_TEST(DependeeType, float) \
632 NUM_ARRAY_LENGTH_TEST(DependeeType, double) \
633 NUM_ARRAY_LENGTH_TEST(DependeeType, llint)
635 #define NUM_ARRAY_LENGTH_TEST_GROUP(DependeeType) \
636 NUM_ARRAY_LENGTH_TEST(DependeeType, int) \
637 NUM_ARRAY_LENGTH_TEST(DependeeType, double) \
638 NUM_ARRAY_LENGTH_TEST(DependeeType, float)
642 #ifdef HAVE_TEUCHOS_LONG_LONG_INT
648 #define TWODROW_TEST(DependeeType, DependentType) \
649 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( \
650 Teuchos_Dependencies, \
651 TwoDRowDependency_serialization_tests, \
659 #ifdef HAVE_TEUCHOS_LONG_LONG_INT
660 #define TWODROW_TEST_GROUP(DependeeType) \
661 TWODROW_TEST(DependeeType, int) \
662 TWODROW_TEST(DependeeType, float) \
663 TWODROW_TEST(DependeeType, double) \
664 TWODROW_TEST(DependeeType, llint)
666 #define TWODROW_TEST_GROUP(DependeeType) \
667 TWODROW_TEST(DependeeType, int) \
668 TWODROW_TEST(DependeeType, double) \
669 TWODROW_TEST(DependeeType, float)
673 #ifdef HAVE_TEUCHOS_LONG_LONG_INT
679 #define TWODCOL_TEST(DependeeType, DependentType) \
680 TEUCHOS_UNIT_TEST_TEMPLATE_2_INSTANT( \
681 Teuchos_Dependencies, \
682 TwoDColDependency_serialization_tests, \
690 #ifdef HAVE_TEUCHOS_LONG_LONG_INT
691 #define TWODCOL_TEST_GROUP(DependeeType) \
692 TWODCOL_TEST(DependeeType, int) \
693 TWODCOL_TEST(DependeeType, float) \
694 TWODCOL_TEST(DependeeType, double) \
695 TWODCOL_TEST(DependeeType, llint)
697 #define TWODCOL_TEST_GROUP(DependeeType) \
698 TWODCOL_TEST(DependeeType, int) \
699 TWODCOL_TEST(DependeeType, double) \
700 TWODCOL_TEST(DependeeType, float)
704 #ifdef HAVE_TEUCHOS_LONG_LONG_INT
709 std::string dependee1 =
"string param";
710 std::string dependee2 =
"string param2";
711 std::string dependent1 =
"dependent param1";
712 std::string dependent2 =
"dependent param2";
715 myDepList.
set(dependee1,
"val1");
716 myDepList.
set(dependee2,
"val2");
717 myDepList.
set(dependent1, 2.0);
718 myDepList.
set(dependent2, 3.0);
730 valuesAndValidators[
"val1"] = double1Vali;
731 valuesAndValidators[
"val2"] = double2Vali;
737 valuesAndValidators));
740 dependentList.insert(myDepList.
getEntryRCP(dependent1));
741 dependentList.insert(myDepList.
getEntryRCP(dependent2));
789 TEST_ASSERT(castedDep2->getValuesAndValidators().size() == 2);
796 double1Vali->getMax());
799 castedDep2->getValuesAndValidators().find(
"val1")->second,
true)->getMax(),
800 double1Vali->getMax());
805 double2Vali->getMax());
808 castedDep2->getValuesAndValidators().find(
"val2")->second,
true)->getMax(),
809 double2Vali->getMax());
813 castedDep2->getDefaultValidator(),
true)->getMax(),
814 defaultVali->getMax());
819 std::string dependee1 =
"bool param";
820 std::string dependee2 =
"bool param2";
821 std::string dependent1 =
"dependent param1";
822 std::string dependent2 =
"dependent param2";
825 myDepList.
set(dependee1,
true);
826 myDepList.
set(dependee2,
false);
827 myDepList.
set(dependent1, 2.0);
828 myDepList.
set(dependent2, 3.0);
848 dependentList.insert(myDepList.
getEntryRCP(dependent1));
849 dependentList.insert(myDepList.
getEntryRCP(dependent2));
898 TEST_ASSERT(castedDep2->getFalseValidator().is_null());
902 true1Vali->getMax());
906 false1Vali->getMax());
909 castedDep2->getTrueValidator(),
true)->getMax(),
910 true2Vali->getMax());
916 Teuchos_Dependencies, RangeValidatorDepSerialization, T)
918 std::string dependee1 =
"dependee param";
919 std::string dependee2 =
"dependee param2";
920 std::string dependent1 =
"dependent param1";
921 std::string dependent2 =
"dependent param2";
926 myDepList.
set(dependent1, 2.0);
927 myDepList.
set(dependent2, 3.0);
942 rangeValiMap[range1] = double1Vali;
943 rangeValiMap[range2] = double2Vali;
952 dependentList.insert(myDepList.
getEntryRCP(dependent1));
953 dependentList.insert(myDepList.
getEntryRCP(dependent2));
1001 castedDep1->getRangeToValidatorMap();
1013 readinMap1.find(range1)->second;
1015 readinMap1.find(range2)->second;
1018 range1Vali,
true)->getMax(),
1019 double1Vali->getMax());
1022 range2Vali,
true)->getMax(),
1023 double2Vali->getMax());
1026 castedDep2->getRangeToValidatorMap();
1027 it = readinMap2.begin();
1036 readinMap2.find(range1)->second,
true)->getMax(),
1037 double1Vali->getMax());
1040 readinMap2.find(range2)->second,
true)->getMax(),
1041 double2Vali->getMax());
1045 castedDep2->getDefaultValidator());
1046 TEST_EQUALITY( defaultReadInVali->getMax(), defaultValidator->getMax());
1047 TEST_EQUALITY( defaultReadInVali->getMin(), defaultValidator->getMin());
1051 #define RANGE_VALIDATOR_TEST(T) \
1052 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( \
1053 Teuchos_Dependencies, RangeValidatorDepSerialization, T)
1058 #ifdef HAVE_TEUCHOS_LONG_LONG_INT
1068 getParametersFromXmlFile(
"MissingDependeeTag.xml", depSheet),
1071 getParametersFromXmlFile(
"MissingDependentTag.xml", depSheet),
1074 getParametersFromXmlFile(
"MissingDependee.xml", depSheet),
1077 getParametersFromXmlFile(
"MissingDependent.xml", depSheet),
1086 entryIDsMap[dependentParam] = 1;
1091 boolVisDep, entryIDsMap, validatorIDsMap),
1093 entryIDsMap.erase(dependentParam);
1094 entryIDsMap[dependeeParam] = 3;
1097 boolVisDep, entryIDsMap, validatorIDsMap),
1136 missingValuesXML, readerEntryMap, readerValiMap),
1142 Teuchos_Dependencies, ConditionVisualDepSerializationExceptions)
1156 missingConXML, readerEntryMap, readerValiMap),
1161 Teuchos_Dependencies, BoolValidatorDepSerializationExceptions)
1179 readerValiMap.erase(writerValiMap.find(trueVali)->second);
1183 boolValiDepXML, readerEntryMap, readerValiMap),
1187 writerValiMap.find(trueVali)->second, trueVali));
1188 readerValiMap.erase(writerValiMap.find(falseVali)->second);
1192 boolValiDepXML, readerEntryMap, readerValiMap),
1198 Teuchos_Dependencies, StringValidatorDepSerializationExceptions)
1206 valiMap[
"blah"] = scrapVali;
1212 dependeeParam1, dependentParam1, valiMap, scrapVali2));
1224 missingValuesXML, readerEntryMap, readerValiMap),
1227 readerValiMap.erase(writerValiMap.find(scrapVali)->second);
1231 stringValiDepXML, readerEntryMap, readerValiMap),
1235 writerValiMap.find(scrapVali)->second,scrapVali));
1236 readerValiMap.erase(writerValiMap.find(scrapVali2)->second);
1240 stringValiDepXML, readerEntryMap, readerValiMap),
1245 Teuchos_Dependencies, RangeValidatorDepSerializationExceptions)
1258 valiMap[scrapRange] = scrapVali;
1259 secondvaliMap[scrapRange] = otherScrapVali;
1260 writerValiMap.insert(scrapVali);
1261 writerValiMap.insert(otherScrapVali);
1262 writerValiMap.insert(defaultScrapVali);
1263 readerValiMap.insert(
1265 writerValiMap.find(scrapVali)->second,scrapVali));
1266 readerValiMap.insert(
1268 writerValiMap.find(otherScrapVali)->second,otherScrapVali));
1269 readerValiMap.insert(
1271 writerValiMap.find(defaultScrapVali)->second,defaultScrapVali));
1275 dependeeParam1, dependentParam1, valiMap));
1279 dependeeParam1, dependentParam1, secondvaliMap, defaultScrapVali));
1294 missingRangesXML, readerEntryMap, readerValiMap),
1297 readerValiMap.erase(writerValiMap.find(scrapVali)->second);
1301 rangeDepXML, readerEntryMap, readerValiMap),
1304 readerValiMap.erase(writerValiMap.find(defaultScrapVali)->second);
1307 rangeDefaultDepXML, readerEntryMap, readerValiMap),
1313 Teuchos_Dependencies, NumArrayLengthDepSerializationExceptions)
1318 dependeeParam1, dependentParam1));
1325 Teuchos_Dependencies, DepSheetTests)
1328 std::string dependee1 =
"dependee1";
1329 std::string dependent1 =
"dependent1";
1331 myDepList.
set(dependee1,
"val1");
1332 myDepList.
set(dependent1, 2.0);
#define COPY_DEPTAG_WITHOUT_CHILD(TAG, CHILDTAG, NEWTAG)
A Dependency sheet keeps track of dependencies between various ParameterEntries.
RCP< const ParameterEntryValidator > getDefaultValidator() const
Thrown when no dependes of a dependency can't be found when converting the dependency to or from XML...
XMLObject toXML(const ParameterList &p, RCP< const DependencySheet > depSheet=null) const
#define TEST_ASSERT(v1)
Assert the given statement is true.
static RCP< T > getDummyObject()
Retrieves a dummy object of type T.
A BoolValidatorDependency says the following about the relationship between two parameters: Dependeni...
#define INSERT_VALIDATOR_TO_MAPS(VALIDATOR)
Thrown when a StringVisualDependency is being converted from XML and no Values tag is found...
RCP< ParameterEntry > getEntryRCP(const std::string &name)
Retrieves the RCP for an entry with the name name if it exists.
A database for DependencyXMLConverters.
A string visual depdencies says the following about the relationship between two elements in a Parame...
A bool visual dependency says the following about the relationship between two elements in a Paramete...
An xml converter for BoolVisualDepenencies.
#define EXCEPTION_TEST_BOILERPLATE(DEPENDEE_VAL, DEPENDENT_VAL)
std::set< RCP< ParameterEntry >, RCPComp > ParameterEntryList
A list of Dependees.
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Set a parameter whose value has type T.
This object is held as the "value" in the Teuchos::ParameterList std::map.
A Bool Logic Condition that returns the result or perfroming a logical AND on the conditions...
static const std::string & getXMLTagName()
#define RANGE_VALIDATOR_TEST(T)
#define TEST_EQUALITY(v1, v2)
Assert the equality of v1 and v2.
#define TEST_THROW(code, ExceptType)
Assert that the statement 'code' throws the exception 'ExceptType' (otherwise the test fails)...
bool getShowIf() const
Get's the value of the showIf variable.
const ValueToValidatorMap & getValuesAndValidators() const
retrieve a const reference to the ValueToValidator map being used by this StringValidatorDependency ...
Thrown when a dependent of a dependency cant be found when converting the dependency to or from XML...
T * get() const
Get the raw C++ pointer to the underlying object.
static const std::string & getValuesAndValidatorsTag()
#define ArrayModifierTest(DEPENDENCYTYPE, ARRAY_TYPE)
#define VERIFY_DEPENDEE(DEPENDENCY, DEPENDEE)
An xml converter for RangeValidatorDependencies.
std::map< std::string, RCP< const ParameterEntryValidator > > ValueToValidatorMap
Conveniece typedef.
A Number Condition is a Parameter Condition that evaluates whether or not a number parameter is great...
#define NUMBER_VIS_TEST(T)
Simple helper functions that make it easy to read and write XML to and from a parameterlist.
This structure defines some basic traits for a scalar field type.
const ValueList & getValues() const
get the List of values the dependee will be checked against.
A RangeValidatorDependency says the following about the relationship between two parameters: Dependen...
RCP< const ParameterEntryValidator > getFalseValidator() const
Gets the false validator.
void addDependency(RCP< Dependency > dependency)
Adds a dependency to the sheet.
A simple function object that subtracts a specififed value from the given arguement in the runFunctio...
TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL(RCPNodeHandle, basicConstruct_owns_mem, T)
static const std::string & getStringValuesTagName()
Gets the StringValues Tag.
TEUCHOS_UNIT_TEST(ConstNonconstObjectContainer, create)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
Templated Parameter List class.
Thrown when no dependents of a dependency are specified when converting the dependency from XML...
const std::string & getName() const
Gets the name of the dependency sheet.
std::string toString() const
Represent this node and its children as a std::string.
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object...
A collection of standard DependencyXMLConverters.
A String Condition is a Parameter Condition that evaluates whether or not a string parameter has take...
#define TWODROW_TEST_GROUP(DependeeType)
std::map< RCP< const ParameterEntry >, ParameterEntry::ParameterEntryID, RCPConstComp > EntryIDsMap
#define NUM_ARRAY_LENGTH_TEST_GROUP(DependeeType)
Thrown when the rangesAndValidators tag for the RangeValidatorDepencyConverter can't be found...
A NumberArrayLengthDependency says the following about the relationship between two parameters: The l...
A class for mapping validators to integers.
#define TWODCOL_TEST_GROUP(DependeeType)
RCP< const ParameterEntryValidator > getTrueValidator() const
Gets the true validator.
#define BASIC_DEPENDENCY_TEST(DEPENDENCY, DEPTYPE,NUM_DEPENDEES, NUM_DEPENDENTS)
A list of parameters of arbitrary type.
A collection of standard dependencies.
A Bool Condition is a Parameter Condition that evaluates whether or not a Boolean parameter is ture...
RCP< const Condition > getCondition() const
Gets the condition being used in this dependency.
bool nonnull(const boost::shared_ptr< T > &p)
Returns true if p.get()!=NULL.
#define TEST_COMPARE_ARRAYS(a1, a2)
Assert that a1.size()==a2.size() and a[i]==b[i], i=0....
DataStructure keeping track of dependencies.
XMLObject fromDependencytoXML(const RCP< const Dependency > dependency, const XMLParameterListWriter::EntryIDsMap &entryIDsMap, ValidatortoIDMap &validatorIDsMap) const
Converters a given ParameterEntryValidator to XML.
A StringValidatorDependency says the following about the relationship between two parameters: Depende...
std::pair< ParameterEntryValidator::ValidatorID, RCP< ParameterEntryValidator > > IDValidatorPair
Class uesd to validate a particular type of number.
Thrown when converting a StrinvValidatorDependcny from XML and no valuesAndValidators tag is found...
#define VERIFY_DEPENDENT(DEPENDENCY, DEPENDENT)
Smart reference counting pointer class for automatic garbage collection.
A condition visual dependency says the following about the relationship between elements in a Paramet...
#define CONVERT_DEP_TO_XML(DEPENDENCY)
Thrown when converting a dependency that has validaotrs to and from XML. This excetpion indicates tha...
std::pair< T, T > Range
Convenience typedef.
static RCP< Dependency > convertXML(const XMLObject &xmlObject, const XMLParameterListReader::EntryIDsMap &entryIDsMap, const IDtoValidatorMap &validatorIDsMap)
Given an XMLObject converts the XMLObject to a Dependency.
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< ParameterList > writeThenReadPL(ParameterList &myList)
Write a parameter list to xml and then read that xml back in via a string. The intent of this functio...
Thrown when no condtion tag is found when converting a ConditionVisualDependency from XML...
A number visual dependency says the following about the relationship between two elements in a Parame...
static T one()
Returns representation of one for this scalar type.
std::map< Range, RCP< const ParameterEntryValidator > > RangeToValidatorMap
Convenience typedef.
Standard Conditions to be used.
#define TOO_MANY_DEPENDEE_TEST(DEPENDENCY)
Thrown when no dependess of a dependency are specified when converting the dependency from XML...
RCP< const DepSet > getDependenciesForParameter(RCP< const ParameterEntry > dependee) const
Returns a set of all the dependencies associated with a particular dependee. If no dependencies with ...
Writes a ParameterList to an XML object.