23 out <<
"\nA:\n"; A.
print(out);
24 writeParameterListToXmlFile(A,
"A.xml");
27 updateParametersFromXmlFile(
"A.xml", inoutArg(B));
28 out <<
"\nB:\n"; B.
print(out);
33 getParameter<std::string>(B.
sublist(
"SublistA",
true),
"param_a"),
36 getParameter<std::string>(B.
sublist(
"SublistA",
true).
sublist(
"SublistB",
true),
"param_b"),
44 A.
set(
"conflicting param",
"a");
47 out <<
"\nA:\n"; A.
print(out);
48 std::stringstream Astream;
49 writeParameterListToXmlOStream(A,Astream);
53 B.
set(
"conflicting param",
"b");
54 updateParametersFromXmlString(Astream.str(), inoutArg(B),
true);
55 out <<
"\nB:\n"; B.
print(out);
63 C.
set(
"conflicting param",
"c");
64 updateParametersFromXmlString(Astream.str(), inoutArg(B),
false);
65 out <<
"\nC:\n"; C.
print(out);
void print() const
Print function to use in debugging in a debugger.
#define TEST_ASSERT(v1)
Assert the given statement is true.
T & get(const std::string &name, T def_value)
Return the parameter's value, or the default value if it is not there.
#define TEST_EQUALITY(v1, v2)
Assert the equality of v1 and v2.
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Templated set method.
Simple helper functions that make it easy to read and write XML to and from a parameterlist.
TEUCHOS_UNIT_TEST(ConstNonconstObjectContainer, create)
A list of parameters of arbitrary type.
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
Creates an empty sublist and returns a reference to the sublist name. If the list already exists...