Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_ConditionXMLConverterDB.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_CONDITIONXMLCONVERTERDB_HPP
11#define TEUCHOS_CONDITIONXMLCONVERTERDB_HPP
12
17// Both includes needed for convience macros below
20
21
22namespace Teuchos {
23
24class Condition;
25
28class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT ConditionXMLConverterDB {
29
30public:
31
34
41 static void addConverter(RCP<const Condition> condition,
43
45
48
58 getConverter(const Condition& condition);
59
67 getConverter(const XMLObject& xmlObject);
68
79 static XMLObject convertCondition(
82
93 static RCP<Condition> convertXML(
94 const XMLObject& xmlObject,
96
98
101
107 static void printKnownConverters(std::ostream& out){
108 out << "Known ConditionXMLConverters: " << std::endl;
109 for(
110 ConverterMap::const_iterator it = getConverterMap().begin();
111 it != getConverterMap().end();
112 ++it)
113 {
114 out << "\t" << it->first <<std::endl;
115 }
116 }
117
119
120private:
121
124
126 typedef std::map<std::string, RCP<ConditionXMLConverter> > ConverterMap;
127
129 typedef std::pair<std::string, RCP<ConditionXMLConverter> > ConverterPair;
130
134 static ConverterMap& getConverterMap();
135
137
138};
139
140
141} // end namespace Teuchos
142
143//
144// Helper Macros
145//
146
148#define TEUCHOS_ADD_NUMBERCONDITION_CONVERTER(T) \
149 Teuchos::ConditionXMLConverterDB::addConverter( \
150 Teuchos::DummyObjectGetter<Teuchos::NumberCondition< T > >:: \
151 getDummyObject(), \
152 Teuchos::rcp(new Teuchos::NumberConditionConverter< T >));
153
154#endif // TEUCHOS_CONDITIONXMLCONVERTERDB_HPP
A collection of standard ConditionXMLConverters.
Standard Conditions to be used.
Provides ability to lookup ConditionXMLConverters.
static void printKnownConverters(std::ostream &out)
prints the xml tags associated with all known converters
A Condition determines whether or not a particular set of conditions are currently occuring.
Smart reference counting pointer class for automatic garbage collection.
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object,...
std::map< ParameterEntry::ParameterEntryID, RCP< ParameterEntry > > EntryIDsMap
Convenience typedef.
std::map< RCP< const ParameterEntry >, ParameterEntry::ParameterEntryID, RCPConstComp > EntryIDsMap
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...