GCpp general purpose C++ library  version 1.0
GCollectionT< T > Class Template Referenceabstract

#include <GCollectionT.hh>

Inheritance diagram for GCollectionT< T >:
GListT< T > GVectT< T > GSortListT< T > GNamedListT< T >

Public Member Functions

template<class Q >
bool IsInstanceOf () const
 
template<class Q >
bool IsInstanceOf ()
 
virtual GCollectionT< T > * Clone () const =0
 
virtual const char * ClassName () const
 
 GCollectionT (u_int flg=0)
 
virtual ~GCollectionT ()
 
virtual u_int GetSize () const
 
virtual u_int GetCount () const
 
virtual u_int GetOptions () const
 
bool CheckOptions (u_int opts) const
 
bool FixPositionOption () const
 
bool IsSortable () const
 
bool IsAlwaysSorted () const
 
bool IsReverseSorted () const
 
bool UniqueNameOption () const
 
bool IsCaseSensitive () const
 
bool DictSortOption () const
 
virtual void Empty ()=0
 

Static Public Member Functions

static const char * StaticClassName ()
 

Protected Attributes

u_int options
 Collection option flags.
 
u_int count_item
 Number of objects in the collection.
 

Detailed Description

template<class T>
class GCollectionT< T >

This is a base class for collections of objects that are instances of the class T. The class is abstract.

See GCpp template classes for more information about the template classes.

Constructor & Destructor Documentation

template<class T >
GCollectionT< T >::GCollectionT ( u_int  opts = 0)
inline

Base constructor

Parameters
optsoption flags.
template<class T >
GCollectionT< T >::~GCollectionT ( )
inlinevirtual

Destructor: the Empty() function cannot be called here since it is pure virtual, and at destructor level, derived class does not exist any more. The Empty function must be called in derived class destructor.

Member Function Documentation

template<class T >
bool GCollectionT< T >::CheckOptions ( u_int  opts) const
inline

Return true if the argument option bits are set.

template<class T >
bool GCollectionT< T >::DictSortOption ( ) const
inline

Return true if the name comparison is base on dictionary order instead of ascii codes.

References gcollection::gDictSort.

template<class T>
virtual void GCollectionT< T >::Empty ( )
pure virtual

Pure virtual function to empty the collection.

Implemented in GListT< T >, GListT< GTreeNodeT< T > >, GListT< GItem >, GListT< GPointer >, GListT< GString >, GListT< GInterval >, and GVectT< T >.

template<class T >
bool GCollectionT< T >::FixPositionOption ( ) const
inline

Return true if the "fixed element position" option is set.

References gcollection::gFixed.

template<class T >
u_int GCollectionT< T >::GetCount ( ) const
inlinevirtual

Return the number of elements in the collection.

template<class T >
u_int GCollectionT< T >::GetOptions ( ) const
inlinevirtual

Return the option bits of the collection.

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

template<class T >
u_int GCollectionT< T >::GetSize ( ) const
inlinevirtual

Return the number of elements in the collection.

Reimplemented in GVectT< T >.

template<class T >
bool GCollectionT< T >::IsAlwaysSorted ( ) const
inline

Return true if the collection is always sorted.

References gcollection::gAlwaysSorted.

template<class T >
bool GCollectionT< T >::IsCaseSensitive ( ) const
inline

Return true if the name comparison is case sensitive.

References gcollection::gNoCaseSensitive.

template<class T>
template<class Q >
bool GCollectionT< 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 >
bool GCollectionT< T >::IsReverseSorted ( ) const
inline

Return true if the collection sorting is in reverse order (if sorted).

References gcollection::gReverseSort.

template<class T >
bool GCollectionT< T >::IsSortable ( ) const
inline

Return true if the collection is sortable.

References gcollection::gIsSortable.

template<class T >
bool GCollectionT< T >::UniqueNameOption ( ) const
inline

Return true if the "unique name" option is selected.

References gcollection::gUniqueName.


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