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

strmod::strmod::__iterator Class Reference

The const_iterator class for StrChunk. More...

#include <StrMod/ChunkIterator.h>

List of all members.

Public Types

typedef ::std::bidirectional_iterator_tag iterator_category
typedef U1Byte value_type
typedef int difference_type
typedef const U1Byte * pointer
typedef const U1Byte & reference

Public Methods

 __iterator ()
 Creates an iterator that's always at the end().

 __iterator (const StrChunkPtr &chnk)
 Creates an interator pointat the beginning of a StrChunk.

 __iterator (shared *sh)
 Creates an iterator using the shared data already generated.

 __iterator (const __iterator &other)
 Copies one iterator to another. Manages reference count on shared area.

 ~__iterator ()
 Destroys an iterator, possibly destroying shared data too if refcount is only 1.

bool isFor (const StrChunkPtr &chnk) const
 Am I an iterator over this chunk?

bool isEqual (const __iterator &other) const
 Am I equal to other? Do I iterator over the same StrChunk and am I at the same spot?

bool isLessThan (const __iterator &other) const
 Am I less than other?

difference_type distance (const __iterator &other) const
 How many characters are there between me and another iterator?

const __iterator & operator= (const __iterator &other)
 Make me into a copy of another iterator.

pointer operator-> () const
 Using this operator will almost certainly result in a compiler error.

reference operator * () const
 What character am I looking at?

const __iterator & operator++ ()
 Move forward one. Prefix operator, so it's more efficient.

const __iterator operator++ (int)
 Move forward one. Postfix operator, so it's less efficient.

void moveToEnd ()
 Move to one past the last character.

const __iterator & operator-- ()
 Move backward one. Prefix operator, so it's more efficient.

const __iterator operator-- (int)
 Move backward one. Postfix operator, so it's less efficient.

void moveToBegin ()
 Move to the first character (which may be one past the last character if the StrChunk is empty.


Static Protected Methods

void setStorage (StrChunk &chnk, void *val)
 Set the secret storage compartment in a StrChunk to val.

void * getStorage (StrChunk &chnk)
 Get what's in the secret storage compartment inside a StrChunk.


Friends

class shared
class ExtVisitor


Detailed Description

The const_iterator class for StrChunk.

Definition at line 40 of file ChunkIterator.h.


Member Function Documentation

StrChunk::__iterator::difference_type strmod::strmod::__iterator::distance const __iterator &    other const
 

How many characters are there between me and another iterator?

Returns:
The number of bytes between two iterators.
Returns a silly value if the two iterators don't point at the same StrChunk. I believe that STL leaves this behavior undefined, so the silly value is as good as anything else.

Definition at line 296 of file ChunkIterator.cxx.

bool strmod::strmod::__iterator::isLessThan const __iterator &    other const
 

Am I less than other?

Returns a comparison of position within a StrChunk if the two iterators point at the same StrChunk.

Punts and returns some silly value when the values aren't comparable because the iterators don't point at the same StrChunk.

Definition at line 274 of file ChunkIterator.cxx.


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