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

d_Iterator< T > Class Template Reference

#include <d_Iterator.h>

List of all members.

Public Methods

 d_Iterator ()
 d_Iterator (const d_Iterator< T > &iSource)
 d_Iterator (d_Collection< T > *iColl)
 ~d_Iterator ()
void replace_element (const T &iValue)
void remove_element ()
operator * ()
get_element ()
d_Boolean not_done ()
void advance (d_Boolean current=d_False)
d_Iterator< T > & operator++ ()
d_Iterator< T > operator++ (const int iStep)
d_Boolean next (T &iValue)
void assign (const d_Collection< T > *iColl, d_Ref< oCollBlock< T > > &iBlock, const oUInt2 iPos)

Public Attributes

d_Collection< T > * collection
d_Ref< oCollBlock< T > > currBlock


Detailed Description

template<class T>
class d_Iterator< T >

This is the class used for iterating over the elements of a generic collection.

LOCATION: d_Iterator.h

USAGE: d_Iterator< <type-name> > <variable-name>;

Where:

<type-name>: Type to iterate. Can be a literal or a user type <variable-name>: is the name of d_Iterator object

EXAMPLES: d_Varray<d_String> stringColl; * Collection d_Iterator<d_String> iter = stringColl.create_iterator();

SEE ALSO: d_Bag, d_Collection, d_Dictionary, d_List, d_Set, d_Varray

ODMG: Compliant


Constructor & Destructor Documentation

template<class T>
d_Iterator< T >::d_Iterator  
 

Default Constructor.

ODMG : Compliant

template<class T>
d_Iterator< T >::d_Iterator const d_Iterator< T > &    iSource
 

Copy Constructor.

Current iterator object and are totally independent, thus they can browse the same collection with no conflict.

ODMG : Compliant

template<class T>
d_Iterator< T >::d_Iterator d_Collection< T > *    iColl
 

Create a d_Iterator object by a collection.

The new iterator point at the first element of collection.

SEE ALSO: d_Collection::create_iterator() ODMG : Extension

template<class T>
d_Iterator< T >::~d_Iterator  
 

Destructor.

ODMG : Compliant


Member Function Documentation

template<class T>
void d_Iterator< T >::advance d_Boolean    current = d_False
 

Advances the iterator to the next element of collection.

Use it without specifying parameter (default = false).

SEE ALSO: operator ++(), next() ODMG : Compliant

template<class T>
void d_Iterator< T >::assign const d_Collection< T > *    iColl,
d_Ref< oCollBlock< T > > &    iBlock,
const oUInt2    iPos
 

template<class T>
T d_Iterator< T >::get_element  
 

Returns the value of current element.

SEE ALSO: operator*() ODMG : Compliant

template<class T>
d_Boolean d_Iterator< T >::next T &    iValue
 

Checks the end of iteration and returns current value.

It returns false if the iterator is positioned past the last element of iteration, otherwise assigns current value to parameter, advances the iterator, and returns true.

SEE ALSO: advance(), operator ++() ODMG : Compliant

template<class T>
d_Boolean d_Iterator< T >::not_done  
 

Returns true if the iteration is not completed and there are some elements to visit.

Call this method to determine whether iteration is complete (usually in a loop).

ODMG : Compliant

template<class T>
T d_Iterator< T >::operator *  
 

Returns the value of current element.

SEE ALSO: get_element() ODMG : Compliant

template<class T>
d_Iterator<T> d_Iterator< T >::operator++ const int    iStep
 

This is the postfix increment operator.

It advances to the next element in the collection and returns the element pointed by iterator before the advancing. If this method is called after that the iterator has reached the end of iteration, a d_Error_IteratorExhausted exception is thrown.

SEE ALSO: advance(), next() ODMG : Compliant

template<class T>
d_Iterator<T>& d_Iterator< T >::operator++  
 

This is the prefix increment operator.

It advances to the next element in the collection and returns it. If this method is called after that the iterator has reached the end of iteration, a d_Error_IteratorExhausted exception is thrown.

SEE ALSO: advance(), next() ODMG : Compliant

template<class T>
void d_Iterator< T >::remove_element  
 

Removes the current element pointed by the iterator.

ODMG : Compliant

template<class T>
void d_Iterator< T >::replace_element const T &    iValue
 

Replaces current element.

Replaces the value of the current element pointed by the iterator with . This method can be used only with d_List and d_Varray collections.

ODMG : Compliant


Member Data Documentation

template<class T>
d_Collection<T>* d_Iterator< T >::collection
 

template<class T>
d_Ref<oCollBlock< T > > d_Iterator< T >::currBlock
 


The documentation for this class was generated from the following file:
Generated on Fri Nov 29 17:12:14 2002 for Orient ODBMS Just Edition v. 2.0e by doxygen1.3-rc1