100 pl->set(
"String",
foo_ );
129 pl->set(
"String",
foo_ );
158 pl->set(
"String",
foo_ );
189 TEST_THROW(
ob->setObjectTypeName(
""), std::logic_error );
199 ob->setObjectName(
"Foo");
200 ob->setObjectTypeName(
"Foo Type");
206 "Determines the type of Foo object that will be built.\nThe parameters for each Foo Type are specified in this sublist"
216 "Determines the type of Foo object that will be built.\nThe parameters for each Foo Type are specified in this sublist"
245 pl =
ob->getValidParameters();
260 TEST_THROW(
ob->getValidParameters(), std::logic_error );
280 pl->setParameters(*
ob->getValidParameters());
281 pl->set(
"Foo Type",
"Foo A");
285 ob->setParameterList(
pl);
313 out <<
"op.getValidParamters():\n";
316 pl->setParameters(*
ob->getValidParameters());
317 pl->set(
"Foo Type",
"None");
318 ob->setParameterList(
pl);
320 pl->set(
"Foo Type",
"Foo B");
321 pl->sublist(
"Foo B").set(
"String",
"BB");
322 pl->sublist(
"Foo C").set(
"String",
"CC");
329 ob->unsetParameterList();
341 ob->setParameterList(
pl);
349 TEST_THROW( foo =
ob->create(
"Foo D"), std::logic_error );
354#if !(__GNUC__ == 4 && __GNUC_MINOR__ == 8) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 9) && !(__GNUC__ == 5 && __GNUC_MINOR__ == 3) && !(__GNUC__ == 6 && __GNUC_MINOR__ == 2)
369 pl = parameterList();
371 pl->set(
"Hello",
"World");
374 TEST_THROW(
ob->unsetParameterList(), std::logic_error );
418 pl = parameterList();
419 pl->set(
"Object Type",
"None");
423 newPL =
ob->getNonconstParameterList();
428#if !(__GNUC__ == 4 && __GNUC_MINOR__ == 8) && !(__GNUC__ == 4 && __GNUC_MINOR__ == 9) && !(__GNUC__ == 5 && __GNUC_MINOR__ == 3) && !(__GNUC__ == 6 && __GNUC_MINOR__ == 2)
440 pl->set(
"Object Type",
"None");
441 ob->setParameterList(
pl);
449 ob->setParameterList(
pl);
450 pl->set(
"Hello",
"World");
474 pl->set(
"Object Type",
"Foo B");
483 validPL->set(
"Object Type",
"Foo C");
484 validPL->sublist(
"Foo A").set(
"String",
"A");
485 validPL->sublist(
"Foo B").set(
"String",
"B");
486 validPL->sublist(
"Foo C").set(
"String",
"C");
499 "Object Type",
"Foo C"
500 ,(std::string(
"Determines the type of Object object that will be built.\n")
501 +
"The parameters for each Object Type are specified in this sublist"
507 validPL->set(
"Object Type",
"Foo A");
509 validPL->set(
"Object Type",
"Foo B");
511 validPL->set(
"Object Type",
"None");
529 ob->setParameterList(
pl);
540 ob->unsetParameterList();
544 pl->setParameters(*
ob->getValidParameters());
545 pl->sublist(
"Foo A").set(
"String",
"AA");
546 ob->setParameterList(
pl);
559 ob->unsetParameterList();
570 ob->setParameterList(
pl);
577 ob->setParameterList(
pl);
578 ob->setDefaultObject(
"Foo A");
585 ob->setParameterList(
pl);
586 ob->setDefaultObject(
"None");
592 TEST_THROW(
ob->setDefaultObject(
"Foo D"), std::logic_error);
594 ob->setDefaultObject(
"Foo D");
605 ob->setParameterList(
pl);
614 ob->setDefaultObject(
"Foo A");
620 ob->setDefaultObject(
"None");
637 ob->setDefaultObject(
"Foo A");
643 ob->setDefaultObject(
"None");
#define TEST_ASSERT(v1)
Assert the given statement is true.
#define TEST_EQUALITY_CONST(v1, v2)
Assert the equality of v1 and constant v2.
#define TEST_NOTHROW(code)
Asserr that the statement 'code' does not thrown any excpetions.
#define TEST_THROW(code, ExceptType)
Assert that the statement 'code' throws the exception 'ExceptType' (otherwise the test fails).
Templated Parameter List class.
#define TEUCHOS_UNIT_TEST(TEST_GROUP, TEST_NAME)
Macro for defining a (non-templated) unit test.
RCP< const ParameterList > getValidParameters() const
Return a ParameterList containing all of the valid parameters that this->setParameterList(....
std::string getString() const
RCP< const ParameterList > getValidParameters() const
Return a ParameterList containing all of the valid parameters that this->setParameterList(....
std::string getString() const
RCP< const ParameterList > getValidParameters() const
Return a ParameterList containing all of the valid parameters that this->setParameterList(....
std::string getString() const
RCP< ParameterList > unsetParameterList()
Unset the parameter list that was set using setParameterList().
virtual void setDefaults()=0
RCP< const ParameterList > getParameterList() const
Get const version of the parameter list that was set using setParameterList().
RCP< ParameterList > getNonconstParameterList()
Get a nonconst version of the parameter list that was set using setParameterList().
void setParameterList(const RCP< ParameterList > ¶mList)
Set parameters from a parameter list and return with default values.
RCP< ParameterList > paramList_
virtual std::string getString() const =0
This object is held as the "value" in the Teuchos::ParameterList std::map.
Interface for objects that can accept a ParameterList.
virtual RCP< const ParameterList > getValidParameters() const
Return a ParameterList containing all of the valid parameters that this->setParameterList(....
Concrete serial communicator subclass.
bool is_null(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.
const std::string ObjectType_name
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void printValidParameters(const ParameterListAcceptor ¶mListAccpetor, std::ostream &out, const bool showDoc=true)
Pretty print the valid parameters from a ParameterListAccpetor object.