Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_ParameterListModifier.hpp
Go to the documentation of this file.
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#ifndef TEUCHOS_ParameterListModifier_hpp_
11#define TEUCHOS_ParameterListModifier_hpp_
12
17#include "Teuchos_Describable.hpp"
18#include "Teuchos_ParameterEntryValidator.hpp"
19#include "Teuchos_map.hpp"
20#include "Teuchos_RCP.hpp"
21namespace Teuchos {
22
23
24#ifndef DOXYGEN_SHOULD_SKIP_THIS
25class ParameterList;
26#endif
27
36class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT ParameterListModifier : public Describable {
37
38public:
39
41
42
45
47 ParameterListModifier(const std::string &name);
48
50 virtual ~ParameterListModifier();
51
53
55
56 ParameterListModifier& setName( const std::string &name );
57
59
61
62 inline const std::string& getName() const{
63 return name_;
64 }
65
67
79 void printDoc(
80 std::string const& docString,
81 std::ostream &out
82 ) const;
83
84
97 Array<std::string> findMatchingBaseNames(const ParameterList &paramList,
98 const std::string &baseName, const bool &findParameters = true,
99 const bool &findSublists = true) const;
100
113
114
126 virtual void reconcile(ParameterList &paramList) const {};
127
128
141 int expandParameters(const std::string &paramTemplateName, ParameterList &paramList,
144
145
158 int expandSublists(const std::string &sublistTemplateName, ParameterList &paramList,
161
162
174 int setDefaultsInSublists(const std::string &paramName, ParameterList &paramList,
175 const Array<std::string> &sublistNames, const bool removeParam = true) const;
176
177
191 int expandSublistsUsingBaseName(const std::string &baseName, ParameterList &paramList,
192 ParameterList &validParamList, const bool &allowBaseName = true) const;
193
194
195protected:
196 std::string name_ = "ANONYMOUS";
197
198};
199
204{
205 return (
206 plm1.getName() == plm2.getName()
207 && typeid(plm1) == typeid(plm2)
208 );
209}
210
215{
216 return !( plm1 == plm2 );
217}
218
219// /////////////////////////////////////////////////////
220// Inline and Template Function Definitions
221
222
223inline
225{
226 name_ = name_in;
227 return *this;
228}
229
230
231} // end of Teuchos namespace
232
233#endif
Reference-counted pointer class and non-member templated function implementations.
Provides std::map class for deficient platforms.
Base class for all objects that can describe themselves.
Abstract interface for an object that can modify both a parameter list and the parameter list being u...
const std::string & getName() const
Get the name of *this modifier.
virtual void reconcile(ParameterList &paramList) const
Reconcile a parameter list and/or the valid parameter list being used to validate it and throw std::e...
ParameterListModifier()=default
Constructor.
virtual void modify(ParameterList &paramList, ParameterList &validParamList) const
Modify a parameter list and/or the valid parameter list being used to validate it and throw std::exce...
ParameterListModifier & setName(const std::string &name)
Set the name of *this modifier.
bool operator!=(const ParameterListModifier &plm1, const ParameterListModifier &plm2)
Returns true if two ParameterListModifier objects are not equal.
bool operator==(const ParameterListModifier &plm1, const ParameterListModifier &plm2)
Returns true if two ParameterListModifier objects are equal.
A list of parameters of arbitrary type.
Smart reference counting pointer class for automatic garbage collection.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...