Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_FunctionObjectXMLConverter.cpp
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 
11 
12 namespace Teuchos{
13 
14 
15 RCP<FunctionObject>
17  const XMLObject &xmlObj) const
18 {
19  return convertXML(xmlObj);
20 }
21 
24  const RCP<const FunctionObject> function) const
25 {
27  toReturn.addAttribute(
28  getTypeAttributeName(), function->getTypeAttributeValue());
29  convertFunctionObject(function, toReturn);
30  return toReturn;
31 }
32 
33 
34 } //namespace teuchos
XMLObject fromFunctionObjecttoXML(const RCP< const FunctionObject > function) const
Converters a given FunctionObject to XML.
Converts back and forth between XML and FunctionObjects.
virtual void convertFunctionObject(const RCP< const FunctionObject > function, XMLObject &xmlObj) const =0
Preforms any and all special FunctionObject conversion that is specific to a particlar FunctionObject...
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object...
static const std::string & getXMLTagName()
Returns the name of the XML tag used to indicate a funciton object.
virtual RCP< FunctionObject > convertXML(const XMLObject &xmlObj) const =0
Preforms any and all special xml conversion that is specific to a particular FunctionObject.
void addAttribute(const std::string &name, T value)
Lookup whether or not Doubles are allowed.
RCP< FunctionObject > fromXMLtoFunctionObject(const XMLObject &xmlObj) const
Converts a given XMLObject to a FunctionObject.
Smart reference counting pointer class for automatic garbage collection.