Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
parameterlist
src
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
16
17
#include "Teuchos_Describable.hpp"
18
#include "Teuchos_ParameterEntryValidator.hpp"
19
#include "
Teuchos_map.hpp
"
20
#include "
Teuchos_RCP.hpp
"
21
namespace
Teuchos
{
22
23
24
#ifndef DOXYGEN_SHOULD_SKIP_THIS
25
class
ParameterList
;
26
#endif
27
36
class
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
ParameterListModifier
:
public
Describable
{
37
38
public
:
39
41
42
44
ParameterListModifier
() =
default
;
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
¶mList,
98
const
std::string &baseName,
const
bool
&findParameters =
true
,
99
const
bool
&findSublists =
true
)
const
;
100
112
virtual
void
modify
(
ParameterList
¶mList,
ParameterList
&validParamList)
const
{};
113
114
126
virtual
void
reconcile
(
ParameterList
¶mList)
const
{};
127
128
141
int
expandParameters(
const
std::string ¶mTemplateName,
ParameterList
¶mList,
142
ParameterList
&validParamList,
143
const
Array<std::string>
&excludeParameters=
Array<std::string>
())
const
;
144
145
158
int
expandSublists(
const
std::string &sublistTemplateName,
ParameterList
¶mList,
159
ParameterList
&validParamList,
160
const
Array<std::string>
&excludeSublists=
Array<std::string>
())
const
;
161
162
174
int
setDefaultsInSublists(
const
std::string ¶mName,
ParameterList
¶mList,
175
const
Array<std::string>
&sublistNames,
const
bool
removeParam =
true
)
const
;
176
177
191
int
expandSublistsUsingBaseName(
const
std::string &baseName,
ParameterList
¶mList,
192
ParameterList
&validParamList,
const
bool
&allowBaseName =
true
)
const
;
193
194
195
protected
:
196
std::string name_ =
"ANONYMOUS"
;
197
198
};
199
203
inline
bool
operator==
(
const
ParameterListModifier
& plm1,
const
ParameterListModifier
& plm2)
204
{
205
return
(
206
plm1.
getName
() == plm2.
getName
()
207
&&
typeid
(plm1) ==
typeid
(plm2)
208
);
209
}
210
214
inline
bool
operator!=
(
const
ParameterListModifier
& plm1,
const
ParameterListModifier
& plm2)
215
{
216
return
!( plm1 == plm2 );
217
}
218
219
// /////////////////////////////////////////////////////
220
// Inline and Template Function Definitions
221
222
223
inline
224
ParameterListModifier
&
ParameterListModifier::setName
(
const
std::string &name_in )
225
{
226
name_ = name_in;
227
return
*
this
;
228
}
229
230
231
}
// end of Teuchos namespace
232
233
#endif
Teuchos_RCP.hpp
Reference-counted pointer class and non-member templated function implementations.
Teuchos_map.hpp
Provides std::map class for deficient platforms.
Teuchos::Array
Replacement for std::vector that is compatible with the Teuchos Memory Management classes.
Definition
Teuchos_Array.hpp:163
Teuchos::Describable
Base class for all objects that can describe themselves.
Definition
Teuchos_Describable.hpp:44
Teuchos::ParameterList
A list of parameters of arbitrary type.
Definition
Teuchos_ParameterList.hpp:101
Teuchos::ParameterListModifier::getName
const std::string & getName() const
Get the name of *this modifier.
Definition
Teuchos_ParameterListModifier.hpp:62
Teuchos::ParameterListModifier::reconcile
virtual void reconcile(ParameterList ¶mList) const
Reconcile a parameter list and/or the valid parameter list being used to validate it and throw std::e...
Definition
Teuchos_ParameterListModifier.hpp:126
Teuchos::ParameterListModifier::ParameterListModifier
ParameterListModifier()=default
Constructor.
Teuchos::ParameterListModifier::modify
virtual void modify(ParameterList ¶mList, ParameterList &validParamList) const
Modify a parameter list and/or the valid parameter list being used to validate it and throw std::exce...
Definition
Teuchos_ParameterListModifier.hpp:112
Teuchos::ParameterListModifier::setName
ParameterListModifier & setName(const std::string &name)
Set the name of *this modifier.
Definition
Teuchos_ParameterListModifier.hpp:224
Teuchos::ParameterListModifier::operator!=
bool operator!=(const ParameterListModifier &plm1, const ParameterListModifier &plm2)
Returns true if two ParameterListModifier objects are not equal.
Definition
Teuchos_ParameterListModifier.hpp:214
Teuchos::ParameterListModifier::operator==
bool operator==(const ParameterListModifier &plm1, const ParameterListModifier &plm2)
Returns true if two ParameterListModifier objects are equal.
Definition
Teuchos_ParameterListModifier.hpp:203
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0