Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
DataRepXML Class Reference

A class that is does XML serialization and de-serialization of derived classes of DataRep. More...

#include <DataRepXML.h>

Inheritance diagram for DataRepXML:
Inheritance graph
[legend]
Collaboration diagram for DataRepXML:
Collaboration graph
[legend]

Public Member Functions

XmlElementcreateElement ()
 Creates a new element node.
XmlElementcreateElement (const hippodraw::DataRep &rep)
 Returns a newly created XML element with its attributes set.
hippodraw::DataRepcreateObject (const XmlElement *element)
 Returns a newly created object based on the XmlElement.
 DataRepXML (XmlController *)
 A constructor taking an XML Controller as argument.
void fillNodeList (const XmlElement *element, std::list< XmlElement * > &nodelist)
 Fills the nodelist with immediate child nodes of element with nodes that can be handled by this object.
const XmlElementgetNode (const XmlElement *element) const
 Returns the single child node of element of the type that can be handled by this object.
virtual const std::string & tagName () const
 Returns the tag name used by this class.
 ~DataRepXML ()
 The destructor.

Protected Types

typedef std::list< XmlElement * > NodeList_t
 The container type for element nodes.

Protected Member Functions

void setId (XmlElement &tag, int id)
 Sets the unique identification of the object.

Protected Attributes

XmlControllerm_controller
 The singleton XML controller object.
const std::string m_id
 The attribute name for the identification of the object.
const std::string m_tagname
 The tag name used for elements created by this class.
const std::string m_type
 The attribute name for the type of object.

Private Member Functions

void createChildren (XmlElement &tag, const hippodraw::DataRep &rep)
 Creates the children elements of this element.
void createChildren (XmlElement &tag, const NTupleProjector *projector)
 Creates the child elements in special case where the DataRep object contained a NTupleProjector object.
void createChildren (XmlElement &tag, const BinningProjector *projector)
 Creates the child elements in special case where the DataRep object contains a BinningProjector object.
void createChildren (XmlElement &tag, const MapMatrixProjector *projector)
 Creates the child elements in special case where the DataRep object contains a MapMatrixProjector object.
void createChildren (XmlElement &tag, const FunctionProjector *projector)
 Creates the child elements in special case where the DataRep object contained a FunctionProjector object.
hippodraw::DataRepcreateDataRep (const XmlElement *element)
 Creates and returns a DataRep object that does not have NTuple bindings.
hippodraw::DataRepcreateDataRep (const XmlElement *dr_element, const XmlElement *ntp_element)
 Creates and returns a DataRep object that has NTuple bindings.
void createFunctionTargetChild (XmlElement &tag, const hippodraw::DataRep &rep)
 Creates the child element for the function target.
hippodraw::DataRepgetTextRepObject (const XmlElement *)
 Creates and returns a DataRep object that is a TextDataRep.

Private Attributes

BinningProjectorXMLm_binningProjectorXML
 the BinningProjectorXML instance used by this class.
std::string m_contours
 The attribute name for number of contours.
FunctionProjectorXMLm_functionProjector
 The FunctionProjectorXML instance used by this class.
MapMatrixProjectorXMLm_mapMatrixProjectorXML
 The MapMatrixProjectorXML instance used by this class.
NTupleProjectorXMLm_nTupleProjector
 The NTupleProjectorXML instance used by this class.
PointRepXMLm_pointrep
 The PointRepXML instance used by this class.

Detailed Description

A class that is does XML serialization and de-serialization of derived classes of DataRep.

Requests:
Check that histogram with equal bin contents can be archived.
Requests:
Check that minimum entries per bin can be archived.
Author
Paul F. Kunz Paul_.nosp@m.Kunz.nosp@m.@slac.nosp@m..sta.nosp@m.nford.nosp@m..edu
Sanket B. Malde sanke.nosp@m.t@st.nosp@m.anfor.nosp@m.d.ed.nosp@m.u

Definition at line 46 of file DataRepXML.h.

Member Typedef Documentation

typedef std::list< XmlElement * > NodeList_t
protectedinherited

The container type for element nodes.

Definition at line 47 of file BaseXML.h.

Constructor & Destructor Documentation

DataRepXML ( XmlController controller)
~DataRepXML ( )

Member Function Documentation

void createChildren ( XmlElement tag,
const hippodraw::DataRep rep 
)
private
void createChildren ( XmlElement tag,
const NTupleProjector projector 
)
private

Creates the child elements in special case where the DataRep object contained a NTupleProjector object.

Definition at line 89 of file DataRepXML.cxx.

References XmlNode::appendChild(), NTupleProjectorXML::createElement(), and DataRepXML::m_nTupleProjector.

void createChildren ( XmlElement tag,
const BinningProjector projector 
)
private

Creates the child elements in special case where the DataRep object contains a BinningProjector object.

Definition at line 102 of file DataRepXML.cxx.

References XmlNode::appendChild(), BaseXML::createElement(), and DataRepXML::m_binningProjectorXML.

void createChildren ( XmlElement tag,
const MapMatrixProjector projector 
)
private

Creates the child elements in special case where the DataRep object contains a MapMatrixProjector object.

Definition at line 112 of file DataRepXML.cxx.

References XmlNode::appendChild(), BaseXML::createElement(), and DataRepXML::m_mapMatrixProjectorXML.

void createChildren ( XmlElement tag,
const FunctionProjector projector 
)
private

Creates the child elements in special case where the DataRep object contained a FunctionProjector object.

Definition at line 120 of file DataRepXML.cxx.

References XmlNode::appendChild(), FunctionProjectorXML::createElement(), and DataRepXML::m_functionProjector.

hippodraw::DataRep * createDataRep ( const XmlElement element)
private

Creates and returns a DataRep object that does not have NTuple bindings.

Definition at line 189 of file DataRepXML.cxx.

References DataRepController::instance(), BaseXML::m_type, and num_util::type().

Referenced by DataRepXML::createObject().

DataRep * createDataRep ( const XmlElement dr_element,
const XmlElement ntp_element 
)
private

Creates and returns a DataRep object that has NTuple bindings.

These objects are the ones that can be created from the DataRepFactory. Uses the XML element dr_element for the DataRep information and the XML element ntp_element for the NTuple information.

Definition at line 214 of file DataRepXML.cxx.

References XmlElement::attribute(), DataRepController::createDataRep(), NTupleProjectorXML::getBindings(), XmlController::getDataSource(), NTupleProjectorXML::getNTupleReference(), DataRepController::instance(), BaseXML::m_controller, DataRepXML::m_nTupleProjector, BaseXML::m_type, and num_util::type().

XmlElement * createElement ( )
inherited
XmlElement * createElement ( const hippodraw::DataRep rep)

Returns a newly created XML element with its attributes set.

Definition at line 73 of file DataRepXML.cxx.

References DataRepXML::createChildren(), BaseXML::createElement(), BaseXML::m_controller, BaseXML::m_type, DataRep::name(), XmlElement::setAttribute(), and BaseXML::setId().

Referenced by PlotterBaseXML::createChildren().

void createFunctionTargetChild ( XmlElement tag,
const hippodraw::DataRep rep 
)
private
DataRep * createObject ( const XmlElement element)
void fillNodeList ( const XmlElement element,
std::list< XmlElement * > &  nodelist 
)
inherited
const XmlElement * getNode ( const XmlElement element) const
inherited

Returns the single child node of element of the type that can be handled by this object.

If no such node exists, returns a null pointer.

Definition at line 53 of file BaseXML.cxx.

References XmlElement::getNode(), and BaseXML::m_tagname.

Referenced by PointRepXML::createObject(), DataRepXML::createObject(), BinningProjectorXML::getObject(), PlotterBaseXML::getObject(), ViewBaseXML::getObjects(), and BinningProjectorXML::setBins().

DataRep * getTextRepObject ( const XmlElement )
private

Creates and returns a DataRep object that is a TextDataRep.

These objects are the ones that can be created from the TextRepFactory.

Todo:
Why is this call with an argument.

Definition at line 238 of file DataRepXML.cxx.

Referenced by DataRepXML::createObject().

void setId ( XmlElement tag,
int  id 
)
protectedinherited
const string & tagName ( ) const
virtualinherited

Returns the tag name used by this class.

Definition at line 48 of file BaseXML.cxx.

References BaseXML::m_tagname.

Member Data Documentation

BinningProjectorXML* m_binningProjectorXML
private

the BinningProjectorXML instance used by this class.

Definition at line 58 of file DataRepXML.h.

Referenced by DataRepXML::createChildren(), DataRepXML::createObject(), DataRepXML::DataRepXML(), and DataRepXML::~DataRepXML().

std::string m_contours
private

The attribute name for number of contours.

Definition at line 68 of file DataRepXML.h.

XmlController* m_controller
protectedinherited
FunctionProjectorXML* m_functionProjector
private
const std::string m_id
protectedinherited

The attribute name for the identification of the object.

Definition at line 57 of file BaseXML.h.

Referenced by BaseXML::setId().

MapMatrixProjectorXML* m_mapMatrixProjectorXML
private
NTupleProjectorXML* m_nTupleProjector
private
PointRepXML* m_pointrep
private

The PointRepXML instance used by this class.

Definition at line 52 of file DataRepXML.h.

Referenced by DataRepXML::createChildren(), DataRepXML::createObject(), DataRepXML::DataRepXML(), and DataRepXML::~DataRepXML().

const std::string m_tagname
protectedinherited

The tag name used for elements created by this class.

Definition at line 50 of file BaseXML.h.

Referenced by BaseXML::createElement(), BaseXML::fillNodeList(), BaseXML::getNode(), and BaseXML::tagName().

const std::string m_type
protectedinherited

The documentation for this class was generated from the following files:

Generated for HippoDraw Class Library by doxygen