GCpp general purpose C++ library  version 1.0
GIterT< T > Class Template Reference

#include <GIterT.hh>

Inheritance diagram for GIterT< T >:
GListIterT< T > GVectIterT< T >

Public Member Functions

template<class Q >
bool IsInstanceOf () const
 
template<class Q >
bool IsInstanceOf ()
 
virtual GIterT< T > * Clone () const
 
virtual const char * ClassName () const
 
 GIterT (T *adr=NULL)
 
 GIterT (const GIterT< T > &p)
 
GIterT< T > & operator= (const GIterT< T > &p)
 
GIterT< T > & operator= (T *adr)
 
void SetItemPtr (T *adr)
 
u_int GetFlags () const
 
void SetFlags (u_int fl)
 
void SetFlag (u_int fl, bool on=true)
 
bool IsFlagOn (u_int fl) const
 
bool IsFlagOff (u_int fl) const
 
 operator bool (void) const
 
 operator T * (void) const
 
virtual T & operator* (void)
 
virtual T * operator-> (void)
 
virtual const T & operator* (void) const
 
virtual const T * operator-> (void) const
 
virtual bool operator== (const GIterT< T > &p) const
 
virtual bool operator!= (const GIterT< T > &p) const
 
virtual bool operator== (const T *adr) const
 
virtual bool operator!= (const T *adr) const
 
GIterT< T > & operator++ (void)
 
GIterT< T > & operator-- (void)
 
GIterT< T > operator++ (int)
 
GIterT< T > operator-- (int)
 
T * GetPointer ()
 

Static Public Member Functions

static const char * StaticClassName ()
 

Protected Attributes

u_int flags
 Iterator flags.
 
T * item_ptr
 Pointer on the instance of class T object.
 

Detailed Description

template<class T>
class GIterT< T >

The template class GIterT is a base class for collection iterators. It should be derived for specific types of collections.

The base class encapsulates a standard class T object pointer.

Constructor & Destructor Documentation

template<class T>
GIterT< T >::GIterT ( T *  adr = NULL)
inline

Default constructor.

Parameters
adradress of a class T object
template<class T>
GIterT< T >::GIterT ( const GIterT< T > &  p)
inline

Copy constructor.

Parameters
pobject to copy

References GIterT< T >::flags, and GIterT< T >::item_ptr.

Member Function Documentation

template<class T >
T * GIterT< T >::GetPointer ( )
inline

Return the standard T object pointer.

Referenced by GSortListT< T >::IsSorted(), GIntervalList::Remove(), and GSortListT< T >::Sort().

template<class T >
bool GIterT< T >::IsFlagOff ( u_int  fl) const
inline

Return true if the bit flags corresponding to argument are OFF.

Parameters
flflag bits
template<class T >
bool GIterT< T >::IsFlagOn ( u_int  fl) const
inline

Return true if the bit flags corresponding to argument are ON.

Parameters
flflag bits

Referenced by GListT< T >::GListT(), GVectT< T >::GVectT(), GVectT< T >::operator=(), GListT< T >::operator=(), and GListT< T >::Remove().

template<class T>
template<class Q >
bool GIterT< T >::IsInstanceOf ( ) const
inline

Macro from GCpp library that defines the following functions:

  • ClassName(): return the real class name of the object
  • StaticClassName(): return the used class name of the object (that may be a base class of the real object).
  • IsInstanceOf<T>(): return true if the current object is an instance of the template class name argument
  • Clone(): return an allocated copy of the object.
template<class T >
GIterT< T >::operator bool ( void  ) const
inline

Cast to boolean, to check for NULL pointer.

template<class T >
GIterT< T >::operator T * ( void  ) const
inline

Cast operator: return the standard T object pointer.

template<class T>
bool GIterT< T >::operator!= ( const GIterT< T > &  p) const
inlinevirtual

Return true if the class T pointers are the different.

References GIterT< T >::item_ptr.

template<class T>
bool GIterT< T >::operator!= ( const T *  adr) const
inlinevirtual

Return true if the class T pointers does not corresponds to the argument.

Parameters
adrclass T standard pointer

Reimplemented in GVectIterT< T >.

template<class T >
T & GIterT< T >::operator* ( void  )
inlinevirtual

Operator *: return the reference to the class T object.

template<class T >
const T & GIterT< T >::operator* ( void  ) const
inlinevirtual

Operator *: return the reference to the class T object.

template<class T >
GIterT< T > & GIterT< T >::operator++ ( void  )
inline

Prefix incrementation (faster that postfix).

template<class T >
GIterT< T > GIterT< T >::operator++ ( int  )
inline

Postfix incrementation.

template<class T >
GIterT< T > & GIterT< T >::operator-- ( void  )
inline

Prefix decrementation (faster that postfix).

template<class T >
GIterT< T > GIterT< T >::operator-- ( int  )
inline

Postfix decrementation.

template<class T >
T * GIterT< T >::operator-> ( void  )
inlinevirtual

Dereference (->) operator (access to a field of T object).

template<class T >
const T * GIterT< T >::operator-> ( void  ) const
inlinevirtual

Dereference (->) operator (access to a field of T object).

template<class T>
GIterT< T > & GIterT< T >::operator= ( const GIterT< T > &  p)
inline

Affectation operator.

Parameters
pclass T iterator

References GIterT< T >::flags, and GIterT< T >::item_ptr.

template<class T>
GIterT< T > & GIterT< T >::operator= ( T *  adr)
inline

Affectation operator.

Parameters
adrclass T standard pointer
template<class T>
bool GIterT< T >::operator== ( const GIterT< T > &  p) const
inlinevirtual

Return true if the class T pointers are the same.

References GIterT< T >::item_ptr.

template<class T>
bool GIterT< T >::operator== ( const T *  adr) const
inlinevirtual

Return true if the class T pointers corresponds to the argument.

Parameters
adrclass T standard pointer

Reimplemented in GVectIterT< T >.

template<class T >
void GIterT< T >::SetFlag ( u_int  fl,
bool  on = true 
)
inline

Set selected bit flags ON / OFF.

Parameters
flselected flag bits
onbits status to set
template<class T >
void GIterT< T >::SetFlags ( u_int  fl)
inline

Set the bit flags.

Parameters
flflag bits

Referenced by GListT< T >::__Swap().

template<class T>
void GIterT< T >::SetItemPtr ( T *  adr)
inline

Redefine the class T object pointer of the iterator.

Parameters
adrclass T standard pointer

The documentation for this class was generated from the following files: