Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
parameterlist
src
Teuchos_FunctionObjectXMLConverterDB.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_FUNTIONOBJECTXMLCONVERTERDB_HPP
11
#define TEUCHOS_FUNTIONOBJECTXMLCONVERTERDB_HPP
12
16
17
// All includes needed for convience macros below
18
#include "
Teuchos_StandardFunctionObjectXMLConverters.hpp
"
19
#include "Teuchos_StandardFunctionObjects.hpp"
20
#include "
Teuchos_DummyObjectGetter.hpp
"
21
22
23
namespace
Teuchos
{
24
28
class
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
FunctionObjectXMLConverterDB
{
29
30
public
:
31
34
41
static
void
addConverter
(
42
RCP<const FunctionObject>
function,
43
RCP<FunctionObjectXMLConverter>
converterToAdd);
44
46
49
58
static
RCP<const FunctionObjectXMLConverter>
59
getConverter
(
const
FunctionObject
& function);
60
67
static
RCP<const FunctionObjectXMLConverter>
68
getConverter
(
const
XMLObject
& xmlObject);
69
77
static
XMLObject
convertFunctionObject
(
RCP<const FunctionObject>
function);
78
87
static
RCP<FunctionObject>
convertXML
(
const
XMLObject
& xmlObject);
89
92
98
static
void
printKnownConverters
(std::ostream& out){
99
out <<
"Known ConditionXMLConverters: "
<< std::endl;
100
for
(
101
ConverterMap::const_iterator it = getConverterMap().begin();
102
it != getConverterMap().end();
103
++it)
104
{
105
out <<
"\t"
<< it->first <<std::endl;
106
}
107
}
108
110
111
private
:
112
115
117
typedef
std::map<std::string, RCP<FunctionObjectXMLConverter> > ConverterMap;
118
120
typedef
std::pair<std::string, RCP<FunctionObjectXMLConverter> > ConverterPair;
121
125
static
ConverterMap& getConverterMap();
126
128
129
};
130
131
132
}
// end namespace Teuchos
133
134
//
135
// Helper Macros
136
//
137
141
#define TEUCHOS_ADD_SIMPLEFUNCTIONCONVERTERS(T) \
142
Teuchos::FunctionObjectXMLConverterDB::addConverter( \
143
Teuchos::rcp(new Teuchos::SubtractionFunction< T >), \
144
Teuchos::DummyObjectGetter<Teuchos::SubtractionFunctionXMLConverter< T > >:: \
145
getDummyObject()); \
146
\
147
Teuchos::FunctionObjectXMLConverterDB::addConverter( \
148
Teuchos::rcp(new Teuchos::AdditionFunction< T >), \
149
Teuchos::DummyObjectGetter<Teuchos::AdditionFunctionXMLConverter< T > >:: \
150
getDummyObject()); \
151
\
152
Teuchos::FunctionObjectXMLConverterDB::addConverter( \
153
Teuchos::rcp(new Teuchos::MultiplicationFunction< T >), \
154
Teuchos::DummyObjectGetter<Teuchos::MultiplicationFunctionXMLConverter< T > >:: \
155
getDummyObject()); \
156
\
157
Teuchos::FunctionObjectXMLConverterDB::addConverter( \
158
Teuchos::rcp(new Teuchos::DivisionFunction< T >), \
159
Teuchos::DummyObjectGetter<Teuchos::DivisionFunctionXMLConverter< T > >:: \
160
getDummyObject()); \
161
\
162
163
#endif
// TEUCHOS_FUNTIONOBJECTXMLCONVERTERDB_HPP
Teuchos_DummyObjectGetter.hpp
Teuchos_StandardFunctionObjectXMLConverters.hpp
A collection of standard FunctionObjectXMLConverters.
Teuchos::FunctionObject
A function object represents an arbitrary function.
Definition
Teuchos_FunctionObject.hpp:27
Teuchos::FunctionObjectXMLConverterDB
Provides ability to lookup FunctionObjectXMLConverters.
Definition
Teuchos_FunctionObjectXMLConverterDB.hpp:28
Teuchos::FunctionObjectXMLConverterDB::getConverter
static RCP< const FunctionObjectXMLConverter > getConverter(const FunctionObject &function)
Get an appropriate FunctionObjectXMLConverter given a FunctionObject.
Definition
Teuchos_FunctionObjectXMLConverterDB.cpp:28
Teuchos::FunctionObjectXMLConverterDB::printKnownConverters
static void printKnownConverters(std::ostream &out)
prints the xml tags associated with all known converters
Definition
Teuchos_FunctionObjectXMLConverterDB.hpp:98
Teuchos::FunctionObjectXMLConverterDB::addConverter
static void addConverter(RCP< const FunctionObject > function, RCP< FunctionObjectXMLConverter > converterToAdd)
Add a converter to the database.
Definition
Teuchos_FunctionObjectXMLConverterDB.cpp:19
Teuchos::FunctionObjectXMLConverterDB::convertFunctionObject
static XMLObject convertFunctionObject(RCP< const FunctionObject > function)
Given a FunctionObject, converts the FunctionObject to XML.
Definition
Teuchos_FunctionObjectXMLConverterDB.cpp:56
Teuchos::FunctionObjectXMLConverterDB::convertXML
static RCP< FunctionObject > convertXML(const XMLObject &xmlObject)
Given an XMLObject, converts the XMLObject to a FunctionObject.
Definition
Teuchos_FunctionObjectXMLConverterDB.cpp:62
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition
Teuchos_RCPDecl.hpp:397
Teuchos::XMLObject
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object,...
Definition
Teuchos_XMLObject.hpp:30
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0