GCpp general purpose C++ library  version 1.0
GItemList Class Reference

#include <GItemList.hh>

Inheritance diagram for GItemList:
GNamedListT< GItem > GSortListT< GItem > GListT< GItem > GCollectionT< GItem >

Public Types

typedef GListIterT< GItemiterator
 Local iterator definition for collection elements.
 

Public Member Functions

template<class Q >
bool IsInstanceOf () const
 
template<class Q >
bool IsInstanceOf ()
 
virtual GItemListClone () const
 
virtual const char * ClassName () const
 
 GItemList (const u_int fl=0)
 
 GItemList (const GItemList &original)
 
virtual ~GItemList ()
 
GItemListoperator= (const GItemList &original)
 
virtual bool Remove ()
 
virtual GItemSelect (const u_int n, const bool b=true)
 
virtual void SelectAll (const bool b=true)
 
virtual GItemAddItem (const GItem &item)
 
virtual GItemAddItem (GItem *item)
 
virtual GItemAddItem (const string &s, void *ptr=NULL)
 
virtual int GetSelectedNumber () const
 

Static Public Member Functions

static const char * StaticClassName ()
 

Additional Inherited Members

- Protected Member Functions inherited from GNamedListT< GItem >
virtual GListIterT< GItem__Add (GItem *item)
 
virtual GListIterT< GItem__Insert (GItem *item)
 
virtual GListIterT< GItem > * __FindName (const string &obj_name, const char smod= 'f') const
 
bool IsInstanceOf () const
 
bool IsInstanceOf ()
 
 GNamedListT (u_int fl=0)
 
 GNamedListT (const GNamedListT< GItem > &list)
 
 GNamedListT (const GNamedListT< GItem > &list, u_int fl)
 
GNamedListT< GItem > & operator= (const GNamedListT< GItem > &list)
 
virtual void SetCaseSensitive (bool b=true)
 
virtual void SetDictSort (bool b=true)
 
virtual int Compare (const GItem &obj1, const GItem &obj2) const
 
virtual bool ExistName (const string &obj_name) const
 
virtual GListIterT< GItemFindName (const string &obj_name, const char smod= 'f') const
 
virtual GListIterT< GItemFindNameFirst (const string &obj_name) const
 
virtual GListIterT< GItemFindNameLast (const string &obj_name) const
 
virtual GListIterT< GItemFindNameNext (const string &obj_name) const
 
virtual GListIterT< GItemFindNamePrevious (const string &obj_name) const
 
virtual string * CreateNamesTable () const
 
virtual void SetNamesTable (string table[]) const
 
virtual void Print (FILE *fp=stdout, const string &prefix="") const
 
virtual void Print (ostream &os, const string &prefix="") const
 
- Protected Member Functions inherited from GSortListT< GItem >
virtual GListIterT< GItem__AddSorted (GItem *item)
 
bool IsInstanceOf () const
 
bool IsInstanceOf ()
 
 GSortListT (u_int fl=0)
 
 GSortListT (const GSortListT< GItem > &list)
 
 GSortListT (const GListT< GItem > &list)
 
 GSortListT (const GListT< GItem > &list, u_int fl)
 
GSortListT< GItem > & operator= (const GListT< GItem > &list)
 
virtual void ReverseSort ()
 
virtual void Sort ()
 
virtual bool IsSorted () const
 
- Protected Member Functions inherited from GListT< GItem >
virtual GListIterT< GItem > * __Exist (const GItem *ptr, GListIterT< GItem > *except=NULL) const
 
virtual GListIterT< GItem > * __Find (const GItem *ptr, GListIterT< GItem > *except=NULL) const
 
virtual GItem__Take ()
 
virtual void __Swap (GListIterT< GItem > *iter)
 
virtual bool __MoveUp ()
 
virtual bool __MoveDown ()
 
bool IsInstanceOf () const
 
bool IsInstanceOf ()
 
 GListT (u_int opts=0)
 
 GListT (const GListT< GItem > &list)
 
 GListT (const GListT< GItem > &list, u_int opts)
 
GListT< GItem > & operator= (const GListT< GItem > &list)
 
virtual GListIterT< GItemBegin () const
 
virtual GListIterT< GItemEnd () const
 
virtual bool Exist (const GItem *ptr) const
 
virtual GListIterT< GItemFind (const GItem *ptr) const
 
virtual GListIterT< GItemFindNext (const GItem *ptr) const
 
virtual GListIterT< GItemFindPrevious (const GItem *ptr) const
 
virtual GListIterT< GItemFindFirst (const GItem *ptr) const
 
virtual GListIterT< GItemFindLast (const GItem *ptr) const
 
GListIterT< GItemCurrent () const
 
GListIterT< GItemPrevious () const
 
GListIterT< GItemNext () const
 
GListIterT< GItemFirst () const
 
GListIterT< GItemLast () const
 
GListIterT< GItemGoto (u_int n=0) const
 
GItemAt (u_int n) const
 
int Index () const
 
virtual int Move (int n)
 
virtual bool MoveUp ()
 
virtual bool MoveDown ()
 
virtual bool MoveTop ()
 
virtual bool MoveBottom ()
 
virtual GListIterT< GItemAdd (GItem *obj_ptr)
 
virtual GListIterT< GItemAdd (GItem &obj_ptr)
 
virtual GListIterT< GItemInsert (GItem *obj_ptr)
 
virtual GListIterT< GItemInsert (GItem &obj_ptr)
 
virtual GListIterT< GItemAppend (GItem *obj_ptr)
 
virtual GListIterT< GItemAppend (GItem &obj_ptr)
 
virtual GListIterT< GItemPrepend (GItem *obj_ptr)
 
virtual GListIterT< GItemPrepend (GItem &obj_ptr)
 
virtual GItemTake ()
 
virtual GItemTake (const GItem *ptr)
 
virtual bool Remove (const GItem *ptr, bool all=true)
 
virtual void Empty ()
 
- Protected Member Functions inherited from GCollectionT< GItem >
bool IsInstanceOf () const
 
bool IsInstanceOf ()
 
 GCollectionT (u_int flg=0)
 
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
 
- Static Protected Member Functions inherited from GNamedListT< GItem >
static const char * StaticClassName ()
 
- Static Protected Member Functions inherited from GSortListT< GItem >
static const char * StaticClassName ()
 
- Static Protected Member Functions inherited from GListT< GItem >
static const char * StaticClassName ()
 
static GListIterT< GItemNull ()
 
- Static Protected Member Functions inherited from GCollectionT< GItem >
static const char * StaticClassName ()
 
- Protected Attributes inherited from GListT< GItem >
GListIterT< GItem > ** first_item
 Iterator on first object in the list.
 
GListIterT< GItem > ** last_item
 Iterator on last object in the list.
 
GListIterT< GItem > ** current_item
 Iterator on current object in the list.
 
- Protected Attributes inherited from GCollectionT< GItem >
u_int options
 Collection option flags.
 
u_int count_item
 Number of objects in the collection.
 

Detailed Description

This class defines a list of GItem objects.

It should be considered as a list of pointers on objects of any type, including base types.

Constructor & Destructor Documentation

GItemList::GItemList ( const u_int  fl = 0)
inline

Constructor.

Parameters
floption flags (bit gcollection::gDeepCopy is set anyway)
GItemList::GItemList ( const GItemList original)
inline

Copy constructor.

Parameters
originalobject to copy
GItemList::~GItemList ( )
inlinevirtual

Destructor.

Member Function Documentation

GItem * GItemList::AddItem ( const GItem item)
inlinevirtual

Add an element at the end of the list (the item is cloned).

Parameters
itemelement

References GListT< GItem >::Append().

Referenced by GTreeNodeT< T >::CreateItemList().

GItem * GItemList::AddItem ( GItem item)
inlinevirtual

Add an element at the end of the list (the item is adopted).

Parameters
itemitem pointer

References GListT< GItem >::Append().

GItem * GItemList::AddItem ( const string &  s,
void *  ptr = NULL 
)
inlinevirtual

Add an element at the end of the list.

Parameters
selement name
ptrpointer associated to the element

References GListT< GItem >::Append().

int GItemList::GetSelectedNumber ( ) const
virtual

Return the number of selected elements in the list.

References GListT< GItem >::First(), and GListT< GItem >::Null().

template<class Q >
bool GItemList::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.
GItemList & GItemList::operator= ( const GItemList original)
inline

Affectation operator.

Parameters
originalobject to copy

References G_AFFECT_MOTHER.

bool GItemList::Remove ( )
inlinevirtual

Overloaded function from the base class.

Reimplemented from GListT< GItem >.

GItem * GItemList::Select ( const u_int  n,
const bool  b = true 
)
virtual

Set the selection status of a list element. If the element exists, it becomes the current element.

Parameters
nelement index in the list
bselection status (ON/OFF)

References GListT< GItem >::Current(), and GListT< GItem >::Null().

void GItemList::SelectAll ( const bool  b = true)
inlinevirtual

Set the selection status for all list elements.

Parameters
bselection ON/OFF

References GListT< GItem >::Begin(), and GListT< GItem >::Null().


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