Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

strmod::strmod::ChunkVisitor Class Reference

The interface for a StrChunk visitor. More...

#include <StrMod/ChunkVisitor.h>

Inheritance diagram for strmod::strmod::ChunkVisitor:

Inheritance graph
[legend]
List of all members.

Public Methods

 ChunkVisitor ()
 Do nothing constructor for interface class.

virtual ~ChunkVisitor ()
 Do nothing virtual destructor for interface class.

virtual int AreYouA (const lcore::ClassIdent &cid) const
 Asks if a class is of a particular type, or publicly derived from that type.


Static Public Attributes

const STR_ClassIdent identifier
 Globally unique identifier for this class.


Protected Methods

virtual const lcore::ClassIdent * i_GetIdent () const
 Returns the class identifier for the class the object actually is.

virtual void visitDataBlock (const void *start, size_t len)=0 throw (halt_visitation)
 Visit some raw data in a StrChunk.

void call_acceptVisitor (const StrChunkPtr &chnk) throw (halt_visitation)
 Call the StrChunk's 'acceptVisitor' method to visit a StrChunk's children.

StrChunk visit functions
virtual void visitStrChunk (const StrChunkPtr &chunk)=0 throw (halt_visitation)
 Visit a StrChunk, with no extent constraints imposed by parent.

virtual void visitStrChunk (const StrChunkPtr &chunk, const LinearExtent &used)=0 throw (halt_visitation)
 Visit a StrChunk, with extent constraints imposed by parent.


Friends

class StrChunk

Detailed Description

The interface for a StrChunk visitor.

Part of an implementation of the Visitor pattern for traversing StrChunk DAGs.

A StrChunk may be visited many times because the StrChunk containment hierarchy is a DAG. This means that a given StrChunk can be contained through more than one path, though it can never contain itself. Because a StrChunk can contain 'substrings' of other StrChunks, each time a StrChunk is visited, it may have different constraints stating which part of the data or StrChunks it contains are visible to the parent.

Derived classes should provide some sort of 'visit' method that takes at least the top level chunk to be visited as an argument. It isn't provided here because many visitor classes will have build up and tear down operations to perform before visiting.

Definition at line 60 of file ChunkVisitor.h.


Member Function Documentation

virtual int strmod::strmod::ChunkVisitor::AreYouA const lcore::ClassIdent &    cid const [inline, virtual]
 

Asks if a class is of a particular type, or publicly derived from that type.

Overriden in every derived class (with a static identifier member) to compare against the identifier, then call the AreYouA methods of all the superclasses.

Parameters:
cid Usually <class>::identifier for the class you want to ask if the object is an instance of.

Reimplemented from strmod::lcore::Protocol.

Reimplemented in strmod::strmod::ApplyVisitor_Base, strmod::strmod::GraphVizVisitor, and strmod::strmod::UseTrackingVisitor.

Definition at line 73 of file ChunkVisitor.h.

void strmod::strmod::ChunkVisitor::call_acceptVisitor const StrChunkPtr   chnk throw (halt_visitation) [protected]
 

Call the StrChunk's 'acceptVisitor' method to visit a StrChunk's children.

This exists so derived classes will have very limited and controlled access to a protected member function of StrChunk. It always provides this as the visitor argument of StrChunk::acceptVisitor.

Parameters:
chnk The StrChunk to call acceptVisitor on.

Definition at line 35 of file ChunkVisitor.cxx.

virtual const lcore::ClassIdent* strmod::strmod::ChunkVisitor::i_GetIdent   const [inline, protected, virtual]
 

Returns the class identifier for the class the object actually is.

Should always be overridden in any class that has a static identifier member.

Reimplemented from strmod::lcore::Protocol.

Reimplemented in strmod::strmod::ApplyVisitor_Base, strmod::strmod::GraphVizVisitor, and strmod::strmod::UseTrackingVisitor.

Definition at line 78 of file ChunkVisitor.h.


Member Data Documentation

const STR_ClassIdent strmod::strmod::ChunkVisitor::identifier [static]
 

Globally unique identifier for this class.

Every class that might need to be identified should have a public static const identifier object in it.

Reimplemented from strmod::lcore::Protocol.

Reimplemented in strmod::strmod::ApplyVisitor_Base, strmod::strmod::GraphVizVisitor, and strmod::strmod::UseTrackingVisitor.


The documentation for this class was generated from the following files:
Generated on Wed Jan 29 00:32:53 2003 for libNet by doxygen1.3-rc1