43 #include "Teuchos_StaticSetupMacro.hpp"
54 getConverterMap().insert(
55 ConverterPair(function->getTypeAttributeValue(), converterToAdd));
61 ConverterMap::const_iterator it =
62 getConverterMap().find(
function.getTypeAttributeValue());
65 "Could not find a FunctionObjectXMLConverter for a FuncitonObject of type " <<
66 function.getTypeAttributeValue() <<
" when writing out a condition to " <<
67 "xml." << std::endl << std::endl
78 ConverterMap::const_iterator it = getConverterMap().find(functionType);
81 "Could not find a FunctionObjectXMLConverter for a condition of type " <<
82 functionType <<
" when reading in a condition from " <<
83 "xml." << std::endl << std::endl
91 return getConverter(*function)->fromFunctionObjecttoXML(
function);
98 fromXMLtoFunctionObject(xmlObject);
101 FunctionObjectXMLConverterDB::ConverterMap&
102 FunctionObjectXMLConverterDB::getConverterMap()
104 static ConverterMap masterMap;
115 TEUCHOS_STATIC_SETUP()
static XMLObject convertFunctionObject(RCP< const FunctionObject > function)
Given a FunctionObject, converts the FunctionObject to XML.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
static const std::string & getTypeAttributeName()
#define TEUCHOS_ADD_SIMPLEFUNCTIONCONVERTERS(T)
Adds a SubtractionFunction, AdditionFunction, MultiplicationFunction, and DivisionFunction of type T ...
A database for FunctionObjectXMLConverters.
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object...
Thrown when an appropriate FunctionObject Converter can't be found.
static void addConverter(RCP< const FunctionObject > function, RCP< FunctionObjectXMLConverter > converterToAdd)
Add a converter to the database.
Smart reference counting pointer class for automatic garbage collection.
static RCP< FunctionObject > convertXML(const XMLObject &xmlObject)
Given an XMLObject, converts the XMLObject to a FunctionObject.
static RCP< const FunctionObjectXMLConverter > getConverter(const FunctionObject &function)
Get an appropriate FunctionObjectXMLConverter given a FunctionObject.
A function object represents an arbitrary function.
A collection of Exceptions thrown when converting FunctionObjects to and from XML.
const std::string & getRequired(const std::string &name) const
Get an attribute, throwing an std::exception if it is not found.