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

strmod::strmod::UseTrackingVisitor Class Reference

Simplifies the Visitor interface down so that derived classes don't have to worry about tracking which parts of a StrChunk are actually used. More...

#include <StrMod/UseTrackingVisitor.h>

Inheritance diagram for strmod::strmod::UseTrackingVisitor:

Inheritance graph
[legend]
List of all members.

Public Methods

 UseTrackingVisitor (bool ignorezeros=false)
 Constructor.

virtual ~UseTrackingVisitor ()
 Destructor. Doesn't do much.

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.

const StrChunkPtrgetParent () const
 Retrieves the parent StrChunk of the currently visited chunk or piece of data.

const LinearExtent::off_t parentOffset () const
 Retrieves the offset of where the currently visited chunk or piece of data is within its parent.

void startVisit (const StrChunkPtr &root)
 Start a traversal of a chunk DAG.

Only overload these
Only overload these functions, not the various private visit* functions down below.

virtual void use_visitStrChunk (const StrChunkPtr &chunk, const LinearExtent &used)=0 throw (halt_visitation)
 This is the Template Method function to visit a StrChunk. Called by the UseTracking machinery.

virtual void use_visitDataBlock (const void *start, size_t len, const void *realstart, size_t reallen)=0 throw (halt_visitation)
 This is the Template Method function to visit an actual chunk of data. Called by the UseTracking machinery.


Detailed Description

Simplifies the Visitor interface down so that derived classes don't have to worry about tracking which parts of a StrChunk are actually used.

Definition at line 42 of file UseTrackingVisitor.h.


Constructor & Destructor Documentation

strmod::strmod::UseTrackingVisitor::UseTrackingVisitor bool    ignorezeros = false
 

Constructor.

Parameters:
ignorezeros Should the use_* Template Methods be called for StrChunks that have no used bytes or data sections that have no used bytes?

Definition at line 41 of file UseTrackingVisitor.cxx.


Member Function Documentation

virtual int strmod::strmod::UseTrackingVisitor::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::strmod::ChunkVisitor.

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

Definition at line 56 of file UseTrackingVisitor.h.

virtual const lcore::ClassIdent* strmod::strmod::UseTrackingVisitor::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::strmod::ChunkVisitor.

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

Definition at line 61 of file UseTrackingVisitor.h.

void strmod::strmod::UseTrackingVisitor::startVisit const StrChunkPtr   root [inline, protected]
 

Start a traversal of a chunk DAG.

Parameters:
root The root of the DAG to visit.

Definition at line 155 of file UseTrackingVisitor.h.

virtual void strmod::strmod::UseTrackingVisitor::use_visitDataBlock const void *    start,
size_t    len,
const void *    realstart,
size_t    reallen
throw (halt_visitation) [protected, pure virtual]
 

This is the Template Method function to visit an actual chunk of data. Called by the UseTracking machinery.

Parameters:
start Start of the portion of the data area that's used.
len Length of the used part of the data area.
realstart Start of the actual data area, including the unused portions.
reallen Length of the actual data area, including the unsused portions.

Implemented in strmod::strmod::ApplyVisitor_Base, strmod::strmod::ApplyVisitor< _Function >, and strmod::strmod::GraphVizVisitor.

virtual void strmod::strmod::UseTrackingVisitor::use_visitStrChunk const StrChunkPtr   chunk,
const LinearExtent   used
throw (halt_visitation) [protected, pure virtual]
 

This is the Template Method function to visit a StrChunk. Called by the UseTracking machinery.

Parameters:
chunk The chunk being visited.
extent Which extent of the chunk is used.

Implemented in strmod::strmod::ApplyVisitor_Base, and strmod::strmod::GraphVizVisitor.


Member Data Documentation

const STR_ClassIdent strmod::strmod::UseTrackingVisitor::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::strmod::ChunkVisitor.

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


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