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
//
4
// Teuchos: Common Tools Package
5
// Copyright (2004) Sandia Corporation
6
//
7
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8
// license for use of this work by or on behalf of the U.S. Government.
9
//
10
// Redistribution and use in source and binary forms, with or without
11
// modification, are permitted provided that the following conditions are
12
// met:
13
//
14
// 1. Redistributions of source code must retain the above copyright
15
// notice, this list of conditions and the following disclaimer.
16
//
17
// 2. Redistributions in binary form must reproduce the above copyright
18
// notice, this list of conditions and the following disclaimer in the
19
// documentation and/or other materials provided with the distribution.
20
//
21
// 3. Neither the name of the Corporation nor the names of the
22
// contributors may be used to endorse or promote products derived from
23
// this software without specific prior written permission.
24
//
25
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
//
37
// Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38
//
39
// ***********************************************************************
40
// @HEADER
41
42
#ifndef TEUCHOS_ParameterListModifier_hpp_
43
#define TEUCHOS_ParameterListModifier_hpp_
44
48
49
#include "Teuchos_Describable.hpp"
50
#include "Teuchos_ParameterEntryValidator.hpp"
51
#include "
Teuchos_map.hpp
"
52
#include "
Teuchos_RCP.hpp
"
53
namespace
Teuchos
{
54
55
56
#ifndef DOXYGEN_SHOULD_SKIP_THIS
57
class
ParameterList
;
58
#endif
59
68
class
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
ParameterListModifier
:
public
Describable
{
69
70
public
:
71
73
74
76
ParameterListModifier
() =
default
;
77
79
ParameterListModifier
(
const
std::string &name);
80
82
virtual
~ParameterListModifier
();
83
85
87
88
ParameterListModifier
&
setName
(
const
std::string &name );
89
91
103
void
printDoc
(
104
std::string
const
& docString,
105
std::ostream &out
106
)
const
;
107
108
121
Array<std::string>
findMatchingBaseNames
(
const
ParameterList
¶mList,
122
const
std::string &baseName,
const
bool
&findParameters =
true
,
123
const
bool
&findSublists =
true
)
const
;
124
136
virtual
void
modify
(
ParameterList
¶mList,
ParameterList
&validParamList)
const
{};
137
138
150
virtual
void
reconcile
(
ParameterList
¶mList)
const
{};
151
152
165
int
expandParameters(
const
std::string ¶mTemplateName,
ParameterList
¶mList,
166
ParameterList
&validParamList,
167
const
Array<std::string>
&excludeParameters=
Array<std::string>
())
const
;
168
169
182
int
expandSublists(
const
std::string &sublistTemplateName,
ParameterList
¶mList,
183
ParameterList
&validParamList,
184
const
Array<std::string>
&excludeSublists=
Array<std::string>
())
const
;
185
186
198
int
setDefaultsInSublists(
const
std::string ¶mName,
ParameterList
¶mList,
199
const
Array<std::string>
&sublistNames,
const
bool
removeParam =
true
)
const
;
200
201
215
int
expandSublistsUsingBaseName(
const
std::string &baseName,
ParameterList
¶mList,
216
ParameterList
&validParamList,
const
bool
&allowBaseName =
true
)
const
;
217
218
219
protected
:
220
std::string name_ =
"ANONYMOUS"
;
221
222
};
223
224
225
// /////////////////////////////////////////////////////
226
// Inline and Template Function Definitions
227
228
229
inline
230
ParameterListModifier
&
ParameterListModifier::setName
(
const
std::string &name_in )
231
{
232
name_ = name_in;
233
return
*
this
;
234
}
235
236
237
}
// end of Teuchos namespace
238
239
#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:195
Teuchos::Describable
Base class for all objects that can describe themselves.
Definition
Teuchos_Describable.hpp:76
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:150
Teuchos::ParameterListModifier::ParameterListModifier
ParameterListModifier()=default
Constructor.
Teuchos::ParameterListModifier::printDoc
void printDoc(std::string const &docString, std::ostream &out) const
Print documentation for this parameter list modifier.
Definition
Teuchos_ParameterListModifier.cpp:59
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:136
Teuchos::ParameterListModifier::findMatchingBaseNames
Array< std::string > findMatchingBaseNames(const ParameterList ¶mList, const std::string &baseName, const bool &findParameters=true, const bool &findSublists=true) const
Find the parameters and/or sublists with matching base names.
Definition
Teuchos_ParameterListModifier.cpp:66
Teuchos::ParameterListModifier::setName
ParameterListModifier & setName(const std::string &name)
Set the name of *this modifier.
Definition
Teuchos_ParameterListModifier.hpp:230
Teuchos::ParameterList
A list of parameters of arbitrary type.
Definition
Teuchos_ParameterList.hpp:133
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0