Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

xmli::Builder Class Reference

Base class for classes which construct C++ objects from XML data. More...

#include <Builder.h>

Inheritance diagram for xmli::Builder:

cfg::configBuilder cfg::configdocBuilder cfg::paramBuilder jobc::jobBuilder jobc::jobdocBuilder jobc::linkBuilder jobc::nodeBuilder jobc::sequenceBuilder xmli::boolBuilder xmli::doubleBuilder xmli::floatBuilder xmli::intBuilder xmli::shortBuilder xmli::stringBuilder xmli::uintBuilder xmli::ushortBuilder xmli::xmlfileBuilder List of all members.

Public Member Functions

virtual void Build (const xmli::AttributeList &attr, const std::string &buffer)=0
 Builder (const char *tag)
virtual ~Builder ()

Detailed Description

Base class for classes which construct C++ objects from XML data.

Definition at line 14 of file Builder.h.


Constructor & Destructor Documentation

xmli::Builder::Builder const char *  tag  ) 
 

During construction, place this builder into the table of builders.

Parameters:
tag : the XML tag handled by the builder
Table is indexed by the tag that this builder handles. For example, the builder for the tag <xmltag> is indexed as "xmltag".

Definition at line 19 of file Builder.cxx.

References xmli::BuilderFac::Instance(), and xmli::BuilderFac::Register().

00020 {
00021   xmli::BuilderFac::Instance().Register(tag,this);
00022 }

xmli::Builder::~Builder  )  [virtual]
 

Definition at line 26 of file Builder.cxx.

00026 { }


Member Function Documentation

virtual void xmli::Builder::Build const xmli::AttributeList attr,
const std::string &  buffer
[pure virtual]
 

Builders must implement this method which constructs a C++ object from XML attributes

Parameters:
attr : The list of key/value pairs of XML attributes
buffer : The text appearing inside the XML tags
For example, this XML string:
<beetle name="ringo" instrument="drums"> Ringo is my favorite </beetle>
is passed as two attributes name=ringo, and instrument=drums and with buffer='Ringo is my favorite'

Once C++ object is created, it should be placed on a xmli::Stack to be used by other pieces of code

See also:
xmli::Stack.h
For examples see
See also:
xmli::intBuilder.cxx

xmli::xmlfileBuilder.cxx

Implemented in cfg::configBuilder, cfg::configdocBuilder, cfg::paramBuilder, jobc::jobBuilder, jobc::jobdocBuilder, jobc::linkBuilder, jobc::nodeBuilder, and jobc::sequenceBuilder.

Referenced by xmli::SAX2Handler::EndElement().


The documentation for this class was generated from the following files:
Generated on Fri Jul 25 02:05:55 2008 for NOvA Offline by doxygen 1.3.5