Main Page | Modules | Class Hierarchy | Class List | Directories | Class Members | Related Pages | Examples

TraceIterator Class Reference
[Network Data Structures]

Iterator for Trace. More...

#include <Aggregate.h>

List of all members.

Public Member Functions

 TraceIterator (Trace *trc, int idx)
 TraceIterator (const TraceIterator &toCopy)
TraceIteratoroperator= (const TraceIterator &rhs)
TraceIteratorclone (void) const
TraceIterator operator+ (int increment) const
TraceIteratoroperator++ (void)
TraceIterator operator- (int decrement) const
TraceIteratoroperator-- (void)
bool operator== (const TraceIterator &rhs) const
bool operator!= (const TraceIterator &rhs) const
Packetoperator * (void) throw ( std::runtime_error, IndexOutOfBoundsException )
Packetoperator-> (void) throw ( std::runtime_error, IndexOutOfBoundsException )
const Packetoperator * (void) const throw ( std::runtime_error, IndexOutOfBoundsException )
const Packetoperator-> (void) const throw ( std::runtime_error, IndexOutOfBoundsException )
const StreamKeygetStreamKey (void) const throw ( std::runtime_error )
bool isValid (void) const

Protected Attributes

Tracetrace
int index

Friends

class Trace


Detailed Description

Iterator for Trace.

Not yet compliant with STL iterators; will have to do that if this is eventually to be used in STL algorithms. For the time being, however, it's just going to do what I need it to do, and not much more.

The interface is a bit wonky, unfortunately. To avoid having to maintain a seperate wrapper class, the iterator is not dereferenced like a pointer, and instead contains member functions that direct requests through the aggregate.

TraceIterator should behave as a const_iterator; that is, it should not modify the aggregate to which it refers.

Note:
Some ugliness with this - a const TraceIterator doesn't prevent modifications to the underlying Packet. This is probably a semantic error, but I'm having a lot of headaches with const, and this is slightly better than going through with sed 's/const //'.

TraceIterator is monomorphic to allow things like low-headache copying.

Todo:
Make const TraceIterators protect the Packet without requiring major contortions to support anceator and descendant tracking (the major headache for const TraceIterators)
Examples:

profile_streams_thesis.cc, and test_harness.cc.


Member Function Documentation

const StreamKey & TraceIterator::getStreamKey void   )  const throw ( std::runtime_error )
 

fetch the StreamKey that identifies the Trace

bool TraceIterator::isValid void   )  const
 

check if the TraceIterator is valid; i.e. refers to a valid location in a Trace

TraceIterator TraceIterator::operator+ int  increment  )  const
 

preincrement


Friends And Related Function Documentation

friend class Trace [friend]
 

Request the value of a PacketAttribute for the packet pointed to by the iterator


The documentation for this class was generated from the following files:
Generated on Thu Apr 5 01:02:39 2007 for ANTARES by  doxygen 1.4.2