43#include "Teuchos_ParameterEntryXMLConverterDB.hpp"
45#include "Teuchos_StaticSetupMacro.hpp"
51RCP<const ParameterEntryXMLConverter>
54 ConverterMap::const_iterator
it =
55 getConverterMap().find(entry->getAny().typeName());
56 if(
it == getConverterMap().end()){
72 " attribute." << std::endl <<
75 std::endl << std::endl);
79 ConverterMap::const_iterator
it = getConverterMap().find(
parameterType);
83 "Can't find converter for parameter entry of type: " <<
85 std::endl << std::endl);
91 out <<
"Known ParameterEntryXMLConverters: " << std::endl;
93 ConverterMap::const_iterator
it = getConverterMap().begin();
94 it != getConverterMap().end();
97 out <<
"\t" <<
it->first <<std::endl;
111ParameterEntryXMLConverterDB::ConverterMap&
112ParameterEntryXMLConverterDB::getConverterMap()
125TEUCHOS_STATIC_SETUP()
127 typedef unsigned int uint;
128 typedef unsigned short int ushort;
129 typedef unsigned long ulong;
130 TEUCHOS_ADD_TYPE_AND_ARRAYTYPE_CONVERTER(
int);
131 TEUCHOS_ADD_TYPE_AND_ARRAYTYPE_CONVERTER(uint);
132 TEUCHOS_ADD_TYPE_AND_ARRAYTYPE_CONVERTER(
short);
133 TEUCHOS_ADD_TYPE_AND_ARRAYTYPE_CONVERTER(ushort);
134 TEUCHOS_ADD_TYPE_AND_ARRAYTYPE_CONVERTER(
long);
135 TEUCHOS_ADD_TYPE_AND_ARRAYTYPE_CONVERTER(ulong);
136 typedef long long int llint;
137 typedef unsigned long long int ullint;
138 TEUCHOS_ADD_TYPE_AND_ARRAYTYPE_CONVERTER(llint);
139 TEUCHOS_ADD_TYPE_AND_ARRAYTYPE_CONVERTER(ullint);
140 TEUCHOS_ADD_TYPE_AND_ARRAYTYPE_CONVERTER(
double);
141 TEUCHOS_ADD_TYPE_AND_ARRAYTYPE_CONVERTER(
float);
143 typedef std::string myString;
144 TEUCHOS_ADD_TYPE_AND_ARRAYTYPE_CONVERTER(myString);
146 TEUCHOS_ADD_TYPE_CONVERTER(
char);
147 TEUCHOS_ADD_TYPE_CONVERTER(
bool);
A thin wrapper around the Teuchos Array class that allows for 2 dimensional arrays.
Writes a ParameterList to an XML object.
A last resort converter for when no others will do.
Thrown when an appropriate ParameterEntryXMLConverter can't be found.
Thrown when a parameter entry tag is missing it's type attribute.
static RCP< const ParameterEntryXMLConverter > getDefaultConverter()
Gets the default converter to be used on Parameter Entries.
static void addConverter(RCP< ParameterEntryXMLConverter > converterToAdd)
Add a converter to the database.
static void printKnownConverters(std::ostream &out)
prints the xml tags associated with all known converters
static RCP< const ParameterEntryXMLConverter > getConverter(RCP< const ParameterEntry > entry)
Get an appropriate ParameterEntryXMLConverter given a ParameterEntry.
static const std::string & getTypeAttributeName()
static const std::string & getTagName()
Get the string that should be used as the tag name for all parameters when they are serialized to xml...
Smart reference counting pointer class for automatic garbage collection.
bool is_null() const
Returns true if the underlying pointer is null.
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object,...
static const std::string & getNameAttributeName()
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.