CPPSERV


Home Projects Jobs Clientele Contact
CPPSERV Documentation Download TODO Mailing lists Bug tracker News RSS Feed Browse source

servlet::taglib::Generator Class Reference

#include <Generator.h>

Inheritance diagram for servlet::taglib::Generator:
Collaboration diagram for servlet::taglib::Generator:

List of all members.


Public Types

typedef servlet::taglib::attribs_t attribs_t

Public Member Functions

 Generator (const std::string &name)
virtual ~Generator ()
void setBuffers (std::iostream &body, std::iostream &header, std::iostream &member)
virtual void initChildBuffers ()
virtual void doStartTag (const attribs_t &attribs)=0
virtual void doEndTag ()=0
virtual void setParent (Generator *gen)
std::string getName ()
std::iostream * child_body ()
std::iostream * child_member ()
std::iostream * child_header ()

Protected Attributes

std::iostream * body
std::iostream * header
std::iostream * member
std::iostream * m_child_body
std::iostream * m_child_header
std::iostream * m_child_member
Generatorparent
std::string m_name

Detailed Description

Base class for tag handlers in compile-time taglibs

Generator class provides two abstract methods (doStartTag and doEndTag) which should be overridden by derived classes to provide actual functionality. In addition there are few helper methods.

Important note: instantiation policy is determined by taglib this tag is registered with.

Definition at line 43 of file Generator.h.


Member Typedef Documentation


Constructor & Destructor Documentation

servlet::taglib::Generator::Generator ( const std::string &  name  )  [inline]

Definition at line 52 of file Generator.h.

virtual servlet::taglib::Generator::~Generator (  )  [inline, virtual]

Definition at line 56 of file Generator.h.


Member Function Documentation

servlet::taglib::Generator::child_body (  )  [inline]

Returns stream to output child tag content into

Definition at line 90 of file Generator.h.

References m_child_body.

std::iostream* servlet::taglib::Generator::child_header (  )  [inline]

Definition at line 98 of file Generator.h.

References m_child_header.

servlet::taglib::Generator::child_member (  )  [inline]

Returns stream to output child tag content into

Definition at line 94 of file Generator.h.

References m_child_member.

servlet::taglib::Generator::doStartTag ( const attribs_t attribs  )  [pure virtual]

doStartTag is called when opening tag is encountered

Parameters:
attribs key-value map of the tag attributes Override this function in your tag handler to generate pre-amble code for your tag

Implemented in servlet::taglib::RunTimeTaglib::RunTimeTaglib::RunTimeTagGenerator, csp::tags::IfTag, csp::tags::ChoiceTag, csp::tags::SwitchTag, csp::tags::AttrIteratorTag, csp::tags::ListIteratorTag, csp::tags::DefineTag, csp::tags::UseDefTag, csp::tags::DefunTag, and csp::tags::CallTag.

servlet::taglib::Generator::getName (  )  [inline]

Returns tag name this object is handling

Definition at line 85 of file Generator.h.

References m_name.

Referenced by csp::tags::SwitchTag::doEndTag(), csp::tags::ChoiceTag::doEndTag(), csp::tags::SwitchTag::initChildBuffers(), and csp::tags::ChoiceTag::initChildBuffers().

servlet::taglib::Generator::initChildBuffers (  )  [inline, virtual]

Sets up child buffers (buffers where contents _inside_ this tag is sent By default it's same as its own buffers (set by setBuffers) If this function is overridden and different set of buffers is generated, it's tag writer's responsibility to ensure that output is actually sent to parent's buffers

Reimplemented in csp::tags::ChoiceTag, csp::tags::SwitchTag, csp::tags::DefineTag, and csp::tags::UseDefTag.

Definition at line 68 of file Generator.h.

References body, header, m_child_body, m_child_header, m_child_member, and member.

void servlet::taglib::Generator::setBuffers ( std::iostream &  body,
std::iostream &  header,
std::iostream &  member 
) [inline]

Definition at line 60 of file Generator.h.

servlet::taglib::Generator::setParent ( Generator gen  )  [inline, virtual]

--iluxa: not sure what this is for

Definition at line 81 of file Generator.h.

References parent.


Member Data Documentation

std::iostream * servlet::taglib::Generator::header [protected]

Definition at line 45 of file Generator.h.

Referenced by initChildBuffers().

std::string servlet::taglib::Generator::m_name [protected]

Reimplemented in servlet::taglib::RunTimeTaglib::RunTimeTaglib::RunTimeTagGenerator.

Definition at line 48 of file Generator.h.

Referenced by getName().


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

SourceForge.net Logo