Teuchos - Trilinos Tools Package
Version of the Day
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
parameterlist
src
Teuchos_ValidatorXMLConverterDB.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_VALIDATORXMLCONVERTERDB_HPP
11
#define TEUCHOS_VALIDATORXMLCONVERTERDB_HPP
12
17
#include "
Teuchos_ValidatorXMLConverter.hpp
"
18
19
20
namespace
Teuchos {
21
22
class
ParameterEntryValidator;
23
26
class
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
ValidatorXMLConverterDB
{
27
public
:
28
31
38
static
void
addConverter(
RCP<const ParameterEntryValidator>
validator,
39
RCP<ValidatorXMLConverter>
converterToAdd);
40
42
45
52
static
RCP<const ValidatorXMLConverter>
getConverter(
53
const
ParameterEntryValidator
& validator);
54
59
static
RCP<const ValidatorXMLConverter>
60
getConverter(
const
XMLObject
& xmlObject);
61
75
static
XMLObject
convertValidator(
76
RCP<const ParameterEntryValidator>
validator,
77
const
ValidatortoIDMap
& validatorIDsMap,
78
bool
assignedID=
true
);
79
89
static
RCP<ParameterEntryValidator>
90
convertXML(
91
const
XMLObject
& xmlObject,
92
const
IDtoValidatorMap
& validatorIDsMap);
93
95
98
104
static
void
printKnownConverters(std::ostream& out);
105
107
108
private
:
109
112
114
typedef
std::map<std::string, RCP<ValidatorXMLConverter> > ConverterMap;
115
117
typedef
std::pair<std::string, RCP<ValidatorXMLConverter> > ConverterPair;
118
120
123
129
static
ConverterMap& getConverterMap();
130
132
133
134
};
135
136
137
}
// end namespace Teuchos
138
139
140
//
141
// Helper Macros
142
//
143
144
// Doing this include so that when people macros like
145
// TEUCHOS_ADD_STRINGTOINTEGRALCONVERTER below they don't have to bother
146
// including it themselves. More likely they might not even know they have
147
// to.
148
#include "
Teuchos_StandardValidatorXMLConverters.hpp
"
149
153
#define TEUCHOS_ADD_STRINGTOINTEGRALVALIDATOR_CONVERTER(INTEGRALTYPE) \
154
\
155
Teuchos::ValidatorXMLConverterDB::addConverter( \
156
Teuchos::DummyObjectGetter< \
157
Teuchos::StringToIntegralParameterEntryValidator< INTEGRALTYPE > >:: \
158
getDummyObject(), \
159
Teuchos::rcp(new Teuchos::StringToIntegralValidatorXMLConverter< INTEGRALTYPE >));
160
161
162
166
#define TEUCHOS_ADD_ENHANCEDNUMBERVALIDATOR_CONVERTER(T) \
167
\
168
Teuchos::ValidatorXMLConverterDB::addConverter( \
169
Teuchos::DummyObjectGetter< \
170
Teuchos::EnhancedNumberValidator< T > >:: \
171
getDummyObject(), \
172
Teuchos::rcp(new Teuchos::EnhancedNumberValidatorXMLConverter< T >));
173
174
178
#define TEUCHOS_ADD_ARRAYVALIDATOR_CONVERTER(VALIDATORTYPE, ENTRYTYPE) \
179
\
180
Teuchos::ValidatorXMLConverterDB::addConverter( \
181
Teuchos::DummyObjectGetter< \
182
Teuchos::ArrayValidator< VALIDATORTYPE, ENTRYTYPE > >:: \
183
getDummyObject(), \
184
Teuchos::rcp(new Teuchos::ArrayValidatorXMLConverter< VALIDATORTYPE, ENTRYTYPE >)); \
185
Teuchos::ValidatorXMLConverterDB::addConverter( \
186
Teuchos::DummyObjectGetter< \
187
Teuchos::TwoDArrayValidator< VALIDATORTYPE, ENTRYTYPE > >:: \
188
getDummyObject(), \
189
Teuchos::rcp(new Teuchos::TwoDArrayValidatorXMLConverter< VALIDATORTYPE, ENTRYTYPE >));
190
191
193
#define TEUCHOS_ADD_NUMBERTYPE_VALIDATOR_CONVERTERS(T) \
194
TEUCHOS_ADD_STRINGTOINTEGRALVALIDATOR_CONVERTER(T); \
195
TEUCHOS_ADD_ENHANCEDNUMBERVALIDATOR_CONVERTER(T); \
196
TEUCHOS_ADD_ARRAYVALIDATOR_CONVERTER(Teuchos::EnhancedNumberValidator< T >, T );
197
201
#define TEUCHOS_ADD_VALIDATOR_CONVERTER(VALIDATOR_TYPE, CONVERTER_TYPE) \
202
Teuchos::ValidatorXMLConverterDB::addConverter( \
203
Teuchos::DummyObjectGetter< VALIDATOR_TYPE > \
204
::getDummyObject(), \
205
Teuchos::rcp(new CONVERTER_TYPE ));
206
207
#endif // TEUCHOS_VALIDATORXMLCONVERTERDB_HPP
Teuchos::ValidatorXMLConverterDB
Provides ability to lookup ValidatorXMLConverterDB.
Definition:
Teuchos_ValidatorXMLConverterDB.hpp:26
Teuchos_StandardValidatorXMLConverters.hpp
A collection of standard ValidatorXMLConverters.
Teuchos::IDtoValidatorMap
Maps Validators to integers.
Definition:
Teuchos_ValidatorMaps.hpp:24
Teuchos::XMLObject
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object...
Definition:
Teuchos_XMLObject.hpp:30
Teuchos_ValidatorXMLConverter.hpp
Converts back and forth between XML and ParameterEntryValidators.
Teuchos::ValidatortoIDMap
A class for mapping validators to integers.
Definition:
Teuchos_ValidatorMaps.hpp:71
Teuchos::ParameterEntryValidator
Abstract interface for an object that can validate a ParameterEntry's value.
Definition:
Teuchos_ParameterEntryValidator.hpp:31
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition:
Teuchos_RCPDecl.hpp:397
Generated on Fri Dec 20 2024 09:21:33 for Teuchos - Trilinos Tools Package by
1.8.5