Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_ParameterListNonAcceptor.cpp
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #include "Teuchos_ParameterListNonAcceptor.hpp"
12 
13 namespace Teuchos {
14 
15 
16 // Overridden from ParameterListAcceptor
17 
18 
20  RCP<ParameterList> const& paramList
21  )
22 {
23  TEUCHOS_TEST_FOR_EXCEPT(is_null(paramList));
24  paramList->validateParameters(*this->getValidParameters());
25  setMyParamList(paramList);
26 }
27 
28 
31 {
32  static RCP<const ParameterList> validPL;
33  if (is_null(validPL)) {
34  validPL = parameterList();
35  }
36  return validPL;
37 }
38 
39 
40 } // end namespace Teuchos
bool is_null(const std::shared_ptr< T > &p)
Returns true if p.get()==NULL.
Templated Parameter List class.
void setParameterList(RCP< ParameterList > const &paramList)
Accepts a parameter list but asserts that it is empty.
void setMyParamList(const RCP< ParameterList > &paramList)
RCP< const ParameterList > getValidParameters() const
Returns a non-null but empty parameter list.
Smart reference counting pointer class for automatic garbage collection.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
This macro is designed to be a short version of TEUCHOS_TEST_FOR_EXCEPTION() that is easier to call...