Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

NTupleXML Class Reference

A singleton class that is does XML serialization and deserialization of derived classes of NTuple. More...

#include <NTupleXML.h>

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

List of all members.

Public Member Functions

XmlElementcreateElement (const DataSource &ntuple)
 Returns a newly created XmlElement for DataSource.
XmlElementcreateElement ()
 Creates a new element node.
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.
std::string getName (const XmlElement &tag) const
 Returns the name of the NTuple object.
const XmlElementgetNode (const XmlElement *element) const
 Returns the single child node of element of the type that can be handled by this object.
const DataSourcegetObject (const XmlElement &tag)
 Returns the DataSource corresponding to XmlElement.
 NTupleXML (XmlController *)
 The only public constructor.
virtual const std::string & tagName () const
 Returns the tag name used by this class.

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 DataSource &ntuple)
 Creates the Dom text node children.
void createChildren2D (XmlElement *tag, const DataSource &ntuple)
 Creates the Dom text node children for 1D histograms.
void createChildren3D (XmlElement *tag, const DataSource &ntuple)
 Creates the Dom text node children for 2D histograms.
 NTupleXML (const NTupleXML &)
 A private copy constructor in order to avoid copying.
void setAttributes (XmlElement *tag, const DataSource &ntuple)
 Sets the attributes.

Private Attributes

std::string m_col_name
 the attribute name for the column index.
std::string m_data
 The tag name of the column data.
std::string m_label
 The attribute name of the column label.
std::string m_name
 The tag name for the name attribute.

Detailed Description

A singleton class that is does XML serialization and deserialization of derived classes of NTuple.

Requests:
Need to save shape of NTuple in order to implement saving St2DHistogram.
Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 34 of file NTupleXML.h.


Member Typedef Documentation

typedef std::list< XmlElement * > NodeList_t [protected, inherited]

The container type for element nodes.

Definition at line 47 of file BaseXML.h.


Constructor & Destructor Documentation

NTupleXML ( const NTupleXML ) [private]

A private copy constructor in order to avoid copying.

NTupleXML ( XmlController controller)

The only public constructor.

Definition at line 42 of file NTupleXML.cxx.


Member Function Documentation

void createChildren ( XmlElement tag,
const DataSource ntuple 
) [private]

Creates the Dom text node children.

Definition at line 79 of file NTupleXML.cxx.

References DataSource::columns(), NTupleXML::createChildren2D(), and hippodraw::DataPoint2DTuple::SIZE.

Referenced by NTupleXML::createElement().

void createChildren2D ( XmlElement tag,
const DataSource ntuple 
) [private]
void createChildren3D ( XmlElement tag,
const DataSource ntuple 
) [private]

Creates the Dom text node children for 2D histograms.

Todo:
Why is this called with a DataSource argument.

Definition at line 123 of file NTupleXML.cxx.

References XmlController::m_xml_doc.

XmlElement * createElement ( const DataSource ntuple)

Returns a newly created XmlElement for DataSource.

Definition at line 51 of file NTupleXML.cxx.

References NTupleXML::createChildren(), BaseXML::createElement(), and NTupleXML::setAttributes().

XmlElement * createElement ( ) [inherited]
void fillNodeList ( const XmlElement element,
std::list< XmlElement * > &  nodelist 
) [inherited]
string getName ( const XmlElement tag) const

Returns the name of the NTuple object.

Todo:
Implement M4 macro to detect missing string::clear().

Gcc 2.95.3 is missing this function, while gcc 3.2.1 has it.

Definition at line 133 of file NTupleXML.cxx.

References XmlElement::attribute(), and NTupleXML::m_name.

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(), PlotterBaseXML::getObject(), BinningProjectorXML::getObject(), ViewBaseXML::getObjects(), and BinningProjectorXML::setBins().

const DataSource * getObject ( const XmlElement tag)
void setAttributes ( XmlElement tag,
const DataSource ntuple 
) [private]

Sets the attributes.

Definition at line 65 of file NTupleXML.cxx.

References DataSource::getName(), BaseXML::m_controller, NTupleXML::m_name, and BaseXML::setId().

Referenced by NTupleXML::createElement().

void setId ( XmlElement tag,
int  id 
) [protected, inherited]
const string & tagName ( ) const [virtual, inherited]

Returns the tag name used by this class.

Definition at line 48 of file BaseXML.cxx.

References BaseXML::m_tagname.


Member Data Documentation

std::string m_col_name [private]

the attribute name for the column index.

Definition at line 47 of file NTupleXML.h.

Referenced by NTupleXML::createChildren2D(), and NTupleXML::getObject().

XmlController* m_controller [protected, inherited]
std::string m_data [private]

The tag name of the column data.

Definition at line 51 of file NTupleXML.h.

Referenced by NTupleXML::createChildren2D(), and NTupleXML::getObject().

const std::string m_id [protected, inherited]

The attribute name for the identification of the object.

Definition at line 57 of file BaseXML.h.

Referenced by BaseXML::setId().

std::string m_label [private]

The attribute name of the column label.

Definition at line 55 of file NTupleXML.h.

Referenced by NTupleXML::createChildren2D(), and NTupleXML::getObject().

std::string m_name [private]

The tag name for the name attribute.

Definition at line 43 of file NTupleXML.h.

Referenced by NTupleXML::getName(), and NTupleXML::setAttributes().

const std::string m_tagname [protected, inherited]

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 [protected, inherited]

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

Generated for HippoDraw Class Library by doxygen