Buffer Class Reference

Represents the DOM buffer. More...

#include <buffer.h>

Collaboration diagram for Buffer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Buffer (ProjectionDFA *_pdfa)
 Constructor.
virtual ~Buffer ()
void appendTag (TAG tag)
 Appends a tag node to the buffer.
void appendTag (TAG tag, vector< unsigned > *_cumulative_roles, vector< unsigned > *_non_cumulative_roles)
 Appends a tag node including roles to the buffer.
void appendPCData (const char *data)
 Appends a text node to the buffer.
void appendPCData (const char *data, vector< unsigned > *_cumulative_roles, vector< unsigned > *_non_cumulative_roles)
 Appends a text node including some roles to the buffer.
void appendRoles (vector< unsigned > *_cumulative_roles, vector< unsigned > *_non_cumulative_roles)
 Appends a set of roles to the current buffer node.
void print (OutputStream &dos)
 Prints the buffer.
void printCurrent (OutputStream &dos)
 Prints the current node of the buffer (including its subtree).
void debugPrint (OutputStream &dos)
 Prints the buffer including debug and role information.
BufferNodegetRoot ()
 Returns the document root.
BufferNodegetCurrent ()
 Returns the current buffer node.
void closeTag ()
 Closes the current tag node in the buffer.

Private Attributes

BufferNoderoot
 The root node of the buffer.
BufferNodecur
 The current node of the buffer.


Detailed Description

Represents the DOM buffer.

The buffer is implemented as a DOM tree. The buffer may contain both tag and character nodes, and the class provides methods for appending suchlike node types.

Author:
Michael Schmidt

Gunnar Jehl

Version:
2.1
License:
Software License Agreement (BSD License)

Definition at line 51 of file buffer.h.


Constructor & Destructor Documentation

Buffer::Buffer ( ProjectionDFA _pdfa  ) 

Constructor.

Constructor - creating object for a ProjectionDFA.

Parameters:
[in] _pdfa The ProjectionDFA is used to assign the roles to the document root.

Definition at line 37 of file buffer.cpp.

References appendRoles(), cur, ProjectionDFAState::getCumulativeRoles(), ProjectionDFA::getInitialState(), ProjectionDFAState::getNonCumulativeRoles(), root, and TAGID_ROOT.

Buffer::~Buffer (  )  [virtual]

Destructor.

Definition at line 46 of file buffer.cpp.

References root.


Member Function Documentation

void Buffer::appendPCData ( const char *  data,
vector< unsigned > *  _cumulative_roles,
vector< unsigned > *  _non_cumulative_roles 
)

Appends a text node including some roles to the buffer.

The text node is appended at the current position of the buffer.

Parameters:
[in] data The PCDATA content of the node that will be created.
[in] _cumulative_roles Pointer to a vector containing cumulative roles.
[in] _non_cumulative_roles Pointer to a vector containing non-cumulative roles.
Return values:
void 

Definition at line 71 of file buffer.cpp.

References BufferNode::addChild(), and cur.

void Buffer::appendPCData ( const char *  data  ) 

Appends a text node to the buffer.

The text node is appended at the current position of the buffer.

Parameters:
[in] data The PCDATA content of the node that will be created.
Return values:
void 

Definition at line 65 of file buffer.cpp.

References BufferNode::addChild(), and cur.

Referenced by StreamTracker::processPCData().

void Buffer::appendRoles ( vector< unsigned > *  _cumulative_roles,
vector< unsigned > *  _non_cumulative_roles 
)

Appends a set of roles to the current buffer node.

Parameters:
[in] _cumulative_roles Pointer to a vector containing cumulative roles.
[in] _non_cumulative_roles Pointer to a vector containing non-cumulative roles.
Return values:
void 

Definition at line 79 of file buffer.cpp.

References BufferNode::appendRoles(), and cur.

Referenced by Buffer().

void Buffer::appendTag ( TAG  tag,
vector< unsigned > *  _cumulative_roles,
vector< unsigned > *  _non_cumulative_roles 
)

Appends a tag node including roles to the buffer.

The tag node is appended at the current position of the buffer.

Parameters:
[in] tag The tag id of the node that will be created.
[in] _cumulative_roles Pointer to a vector containing cumulative roles.
[in] _non_cumulative_roles Pointer to a vector containing non-cumulative roles.
Return values:
void 

Definition at line 57 of file buffer.cpp.

References BufferNode::addChild(), and cur.

void Buffer::appendTag ( TAG  tag  ) 

Appends a tag node to the buffer.

The tag node is appended at the current position of the buffer.

Parameters:
[in] tag The tag id of the node that will be created.
Return values:
void 

Definition at line 50 of file buffer.cpp.

References BufferNode::addChild(), and cur.

Referenced by StreamTracker::processBachelorTag(), and StreamTracker::processOpeningTag().

void Buffer::closeTag (  ) 

Closes the current tag node in the buffer.

This is simply realized by marking the tag node as closed.

Return values:
void 

Definition at line 96 of file buffer.cpp.

References BufferNode::close(), cur, and BufferNode::parent.

Referenced by StreamTracker::processBachelorTag(), and StreamTracker::processClosingTag().

void Buffer::debugPrint ( OutputStream dos  ) 

Prints the buffer including debug and role information.

Prints the complete buffer to the debug output stream, including idebug and role information.

Parameters:
[in] dos Reference to the (debug) OutputStream.
Return values:
void 

Definition at line 92 of file buffer.cpp.

References BufferNode::debugPrint(), and root.

Referenced by Executor::finalDebugPrint(), Executor::initStreamParser(), and Executor::preprocessStream().

BufferNode * Buffer::getCurrent (  )  [inline]

Returns the current buffer node.

Returns the current buffer node, i.e. the one that has last recently been read into the buffer.

Return values:
BufferNode* Pointer to the current BufferNode.

Definition at line 151 of file buffer.h.

BufferNode * Buffer::getRoot (  )  [inline]

Returns the document root.

The document root is the virtual root node of the XML document.

Return values:
BufferNode* Pointer to the document root.

Definition at line 143 of file buffer.h.

References root.

Referenced by Executor::evalQuery().

void Buffer::print ( OutputStream dos  ) 

Prints the buffer.

Prints the complete buffer content to the debug output stream.

Parameters:
[in] dos Reference to the (debug) OutputStream.
Return values:
void 

Definition at line 84 of file buffer.cpp.

References BufferNode::print(), and root.

Referenced by Executor::preprocessStream().

void Buffer::printCurrent ( OutputStream dos  ) 

Prints the current node of the buffer (including its subtree).

Prints the node that is currently active to the debug output stream, including its subtree.

Parameters:
[in] dos Reference to the (debug) OutputStream.
Return values:
void 

Definition at line 88 of file buffer.cpp.

References cur, and BufferNode::print().


Member Data Documentation

BufferNode * Buffer::cur [private]

The current node of the buffer.

The current node of the buffer, i.e. the node that has been appended or closed last recently.

Definition at line 174 of file buffer.h.

Referenced by appendPCData(), appendRoles(), appendTag(), Buffer(), closeTag(), and printCurrent().

BufferNode * Buffer::root [private]

The root node of the buffer.

The root node of the buffer, i.e. the virtual document root.

Definition at line 167 of file buffer.h.

Referenced by Buffer(), debugPrint(), getRoot(), print(), and ~Buffer().


Generated on Sun May 24 20:20:21 2009 for G(arbage) C(ollected) X(Query) Engine by  doxygen 1.5.9