64 std::string paramName1 =
"string param";
65 std::string paramName2 =
"string param2";
66 std::string dependent1Name =
"dependent1";
67 std::string dependent2Name =
"dependent2";
68 std::string paramValue =
"cheese";
71 tuple<std::string>(
"steve",
"blah",
"your face");
73 testList.
set(paramName1, paramValue);
74 testList.
set(paramName2, paramValue);
75 testList.
set(dependent1Name, paramValue);
76 testList.
set(dependent2Name, paramValue);
94 depSheet1->addDependency(simpleConDep);
95 depSheet1->addDependency(complexConDep);
97 writeParameterListToXmlOStream(testList, out, depSheet1);
107 rcp_dynamic_cast<ConditionVisualDependency>(
108 *(depSheetIn->getDependenciesForParameter(readInDependee1)->begin()));
110 simpleReadInDep->getCondition()->getTypeAttributeValue(),
113 rcp_dynamic_cast<const StringCondition>(simpleReadInDep->getCondition(),
true);
118 rcp_dynamic_cast<ConditionVisualDependency>(
119 *(depSheetIn->getDependenciesForParameter(readInDependee2)->begin()));
121 complexReadInDep->getCondition()->getTypeAttributeValue(),
124 rcp_dynamic_cast<const StringCondition>(complexReadInDep->getCondition(),
true);
129 simpleReadInCon->getValueList(), simpleStringCon->getValueList());
131 complexReadInCon->getValueList(), complexStringCon->getValueList());
137 std::string paramName1 =
"bool param";
138 std::string dependent1Name =
"dependent1";
139 bool paramValue =
true;
140 std::string dependentValue =
"hi there!";
142 testList.
set(paramName1, paramValue);
143 testList.
set(dependent1Name, dependentValue);
153 depSheet1->addDependency(boolConDep);
162 rcp_dynamic_cast<ConditionVisualDependency>(
163 *(depSheetIn->getDependenciesForParameter(readInDependee1)->begin()));
165 simpleReadInDep->getCondition()->getTypeAttributeValue(),
168 rcp_dynamic_cast<const BoolCondition>(simpleReadInDep->getCondition(),
true);
175 std::string paramName1 =
"T param";
176 std::string paramName2 =
"T param 2";
177 std::string dependent1Name =
"dependent1";
178 std::string dependent2Name =
"dependent2";
181 std::string dependentValue =
"hi there!";
183 testList.
set(paramName1, paramValue);
184 testList.
set(paramName2, paramValue);
185 testList.
set(dependent1Name, dependentValue);
186 testList.
set(dependent2Name, dependentValue);
208 depSheet1->addDependency(numberConDep);
209 depSheet1->addDependency(funcNumberConDep);
222 rcp_dynamic_cast<ConditionVisualDependency>(
223 *(depSheetIn->getDependenciesForParameter(readInDependee1)->begin()));
225 simpleReadInDep->getCondition()->getTypeAttributeValue(),
228 rcp_dynamic_cast<const NumberCondition< T > >(simpleReadInDep->getCondition(),
true);
233 rcp_dynamic_cast<ConditionVisualDependency>(
234 *(depSheetIn->getDependenciesForParameter(readInDependee2)->begin()));
238 rcp_dynamic_cast<const NumberCondition< T > >(funcReadInDep->getCondition());
243 rcp_dynamic_cast<const SubtractionFunction< T > >(
244 funcReadInCon->getFunctionObject());
247 funcReadInFunc->getModifiyingOperand(),
248 funcTester->getModifiyingOperand());
253#define NUMBER_PARAM_TYPE_TEST( T ) \
254TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT(Teuchos_Conditions, NumberConditionSerialization, T )
275 std::string paramName1 =
"bool param1";
276 std::string paramName2 =
"bool param2";
277 std::string dependent1Name =
"dependent1";
278 bool paramValue1 =
true;
279 bool paramValue2 =
false;
280 std::string dependentValue =
"hi there!";
282 testList.
set(paramName1, paramValue1);
283 testList.
set(paramName2, paramValue2);
284 testList.
set(dependent1Name, dependentValue);
291 tuple<RCP<const Condition> >(boolCon1, boolCon2);
301 depSheet1->addDependency(binConDep);
311 rcp_dynamic_cast<ConditionVisualDependency>(
312 *(depSheetIn->getDependenciesForParameter(readInDependee1)->begin()));
314 rcp_dynamic_cast<ConditionVisualDependency>(
315 *(depSheetIn->getDependenciesForParameter(readInDependee1)->begin()));
318 readInDep1->getCondition()->getTypeAttributeValue(),
321 rcp_dynamic_cast<const BinCondition >(readInDep1->getCondition(),
true);
329#define BIN_CON_TEST( BinCondition ) \
330TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT(Teuchos_Conditions, BoolLogicConditionSerialization, BinCondition)
338 std::string paramName1 =
"bool param1";
339 std::string dependent1Name =
"dependent1";
340 bool paramValue1 =
true;
341 std::string dependentValue =
"hi there!";
343 testList.
set(paramName1, paramValue1);
344 testList.
set(dependent1Name, dependentValue);
357 depSheet1->addDependency(notConDep);
366 rcp_dynamic_cast<ConditionVisualDependency>(
367 *(depSheetIn->getDependenciesForParameter(readInDependee1)->begin()));
369 readInDep1->getCondition()->getTypeAttributeValue(),
372 rcp_dynamic_cast<const NotCondition>(readInDep1->getCondition(),
true);
382 getParametersFromXmlFile(
383 "MissingParameterEntryDefinition.xml", depSheet),
397 getParametersFromXmlFile(
398 "MissingValuesTag.xml", depSheet),
#define NUMBER_PARAM_TYPE_TEST(T)
#define BIN_CON_TEST(BinCondition)
A database for ConditionXMLConverters.
#define TEST_ASSERT(v1)
Assert the given statement is true.
#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).
#define TEST_COMPARE_ARRAYS(a1, a2)
Assert that a1.size()==a2.size() and a[i]==b[i], i=0....
Templated Parameter List class.
A collection of standard ConditionXMLConverters.
Standard Conditions to be used.
A collection of standard dependencies.
#define TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL(TEST_GROUP, TEST_NAME, TYPE)
Macro for defining a templated unit test with one template parameter.
#define TEUCHOS_UNIT_TEST(TEST_GROUP, TEST_NAME)
Macro for defining a (non-templated) unit test.
A collection of Exceptions thrown when converting Conditions to and from XML.
Simple helper functions that make it easy to read and write XML to and from a parameterlist.
A collection of Exceptions that can be potentially thrown when converting a ParameterList to and from...
A Bool Condition is a Parameter Condition that evaluates whether or not a Boolean parameter is ture.
A condition visual dependency says the following about the relationship between elements in a Paramet...
static void printKnownConverters(std::ostream &out)
prints the xml tags associated with all known converters
XMLObject fromConditiontoXML(const RCP< const Condition > condition, const XMLParameterListWriter::EntryIDsMap &entryIDsMap) const
Converters a given ParameterEntryValidator to XML.
A Dependency sheet keeps track of dependencies between various ParameterEntries.
Class for retrieving a dummy object of type T.
Thrown when a referenced ParameterEntry can't be found.
Thrown when a StringConditon is missing it's Value tag.
A Not condition returns the result of performing a logical NOT on a given condition.
An xml converter for NumberConditions The valid XML represntation for a NumberCondition is:
A Number Condition is a Parameter Condition that evaluates whether or not a number parameter is great...
std::string getTypeAttributeValue() const
Get the value that should be used for the condition type attribute when converting a condition to XML...
This object is held as the "value" in the Teuchos::ParameterList std::map.
A list of parameters of arbitrary type.
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.
RCP< ParameterEntry > getEntryRCP(const std::string &name)
Retrieves the RCP for an entry with the name name if it exists.
Smart reference counting pointer class for automatic garbage collection.
T * get() const
Get the raw C++ pointer to the underlying object.
A String Condition is a Parameter Condition that evaluates whether or not a string parameter has take...
A simple function object that subtracts a specififed value from the given arguement in the runFunctio...
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object,...
std::map< RCP< const ParameterEntry >, ParameterEntry::ParameterEntryID, RCPConstComp > EntryIDsMap
bool nonnull(const std::shared_ptr< T > &p)
Returns true if p.get()!=NULL.
unsigned long long int ullint
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
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...
static T one()
Returns representation of one for this scalar type.