GCpp general purpose C++ library
version 1.0
|
#include <GNamedListT.hh>
Public Member Functions | |
template<class Q > | |
bool | IsInstanceOf () const |
template<class Q > | |
bool | IsInstanceOf () |
virtual GNamedListT< T > * | Clone () const |
virtual const char * | ClassName () const |
GNamedListT (u_int fl=0) | |
GNamedListT (const GNamedListT< T > &list) | |
GNamedListT (const GNamedListT< T > &list, u_int fl) | |
GNamedListT< T > & | operator= (const GNamedListT< T > &list) |
virtual | ~GNamedListT () |
virtual void | SetCaseSensitive (bool b=true) |
virtual void | SetDictSort (bool b=true) |
virtual int | Compare (const T &obj1, const T &obj2) const |
virtual bool | ExistName (const string &obj_name) const |
virtual GListIterT< T > | FindName (const string &obj_name, const char smod= 'f') const |
virtual GListIterT< T > | FindNameFirst (const string &obj_name) const |
virtual GListIterT< T > | FindNameLast (const string &obj_name) const |
virtual GListIterT< T > | FindNameNext (const string &obj_name) const |
virtual GListIterT< T > | FindNamePrevious (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 |
![]() | |
template<class Q > | |
bool | IsInstanceOf () const |
template<class Q > | |
bool | IsInstanceOf () |
GSortListT (u_int fl=0) | |
GSortListT (const GSortListT< T > &list) | |
GSortListT (const GListT< T > &list) | |
GSortListT (const GListT< T > &list, u_int fl) | |
GSortListT< T > & | operator= (const GListT< T > &list) |
virtual | ~GSortListT () |
virtual void | ReverseSort () |
virtual void | Sort () |
virtual bool | IsSorted () const |
![]() | |
template<class Q > | |
bool | IsInstanceOf () const |
template<class Q > | |
bool | IsInstanceOf () |
GListT (u_int opts=0) | |
GListT (const GListT< T > &list) | |
GListT (const GListT< T > &list, u_int opts) | |
GListT< T > & | operator= (const GListT< T > &list) |
virtual | ~GListT () |
virtual GListIterT< T > | Begin () const |
virtual GListIterT< T > | End () const |
virtual bool | Exist (const T *ptr) const |
virtual GListIterT< T > | Find (const T *ptr) const |
virtual GListIterT< T > | FindNext (const T *ptr) const |
virtual GListIterT< T > | FindPrevious (const T *ptr) const |
virtual GListIterT< T > | FindFirst (const T *ptr) const |
virtual GListIterT< T > | FindLast (const T *ptr) const |
GListIterT< T > | Current () const |
GListIterT< T > | Previous () const |
GListIterT< T > | Next () const |
GListIterT< T > | First () const |
GListIterT< T > | Last () const |
GListIterT< T > | Goto (u_int n=0) const |
T & | At (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< T > | Add (T *obj_ptr) |
virtual GListIterT< T > | Insert (T *obj_ptr) |
virtual GListIterT< T > | Append (T *obj_ptr) |
virtual GListIterT< T > | Prepend (T *obj_ptr) |
virtual GListIterT< T > | Add (T &obj_ptr) |
virtual GListIterT< T > | Insert (T &obj_ptr) |
virtual GListIterT< T > | Append (T &obj_ptr) |
virtual GListIterT< T > | Prepend (T &obj_ptr) |
virtual T * | Take () |
virtual T * | Take (const T *ptr) |
virtual bool | Remove () |
virtual bool | Remove (const T *ptr, bool all=true) |
virtual void | Empty () |
![]() | |
template<class Q > | |
bool | IsInstanceOf () const |
template<class Q > | |
bool | IsInstanceOf () |
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 |
Static Public Member Functions | |
static const char * | StaticClassName () |
![]() | |
static const char * | StaticClassName () |
![]() | |
static const char * | StaticClassName () |
static GListIterT< T > | Null () |
![]() | |
static const char * | StaticClassName () |
Protected Member Functions | |
virtual GListIterT< T > | __Add (T *item) |
virtual GListIterT< T > | __Insert (T *item) |
virtual GListIterT< T > * | __FindName (const string &obj_name, const char smod= 'f') const |
![]() | |
virtual GListIterT< T > | __AddSorted (T *item) |
![]() | |
virtual GListIterT< T > * | __Exist (const T *ptr, GListIterT< T > *except=NULL) const |
virtual GListIterT< T > * | __Find (const T *ptr, GListIterT< T > *except=NULL) const |
virtual T * | __Take () |
virtual void | __Swap (GListIterT< T > *iter) |
virtual bool | __MoveUp () |
virtual bool | __MoveDown () |
Additional Inherited Members | |
![]() | |
GListIterT< T > ** | first_item |
Iterator on first object in the list. | |
GListIterT< T > ** | last_item |
Iterator on last object in the list. | |
GListIterT< T > ** | current_item |
Iterator on current object in the list. | |
![]() | |
u_int | options |
Collection option flags. | |
u_int | count_item |
Number of objects in the collection. | |
Template class to define a sortable list (see GSortListT) of named objects, inheriting from the GNamed class (in order to define the required functions).
See GCpp template classes for more information about the template classes.
|
inline |
Default constructor of an empty sortable list.
fl | option flags (the bit gcollection::gIsSortable is set anyway) |
References GDebugConst.
|
inline |
|
inline |
Constructor copying the argument list.
list | list to copy |
fl | option flags (the bit gcollection::gIsSortable is set anyway) |
References GDebugConst.
|
inlinevirtual |
Destructor: does not more than the base class.
References GDebugDest.
|
protectedvirtual |
Function redefined from base class to check for existence of the object name.
obj_ptr | object pointer |
Reimplemented from GSortListT< T >.
Reimplemented in GTreeBranchT< T >.
References GSortListT< T >::__Add(), GClassWarning, GDebugClass, and GGetString().
|
protectedvirtual |
Return a pointer to an iterator on an object with the argument name, or NULL if no ebject with this name is found.
obj_name | object name |
smod | search mod: 'f'=first, 'n'=next, 'p'=previous, "l"=last |
References GNamed::Compare(), GNamed::CompareDict(), GDebugClass, GListIterT< T >::NextIterPtr(), GListIterT< T >::PreviousIterPtr(), and GNamed::SetName().
|
protectedvirtual |
Function redefined from base class to check for existence of the object name.
obj_ptr | object pointer |
Reimplemented from GSortListT< T >.
Reimplemented in GTreeBranchT< T >.
References GSortListT< T >::__Insert(), GClassWarning, GDebugClass, and GGetString().
|
virtual |
Function redefined from the base class, to compare 2 named objects, according to the comparison mode: case sensitive or not, dictionary or ascii code comparison.
obj1 | first object |
obj2 | second object |
Reimplemented from GSortListT< T >.
References GString::Compare(), and GString::CompareDict().
|
virtual |
Allocates an array of strings with names of the objects. The array must be deleted by the calling program.
|
inlinevirtual |
Return true if an object with the argument name is found in the list.
obj_name | object name |
|
inlinevirtual |
Return an iterator on an object with the argument name. If the object is found, the current element is set on the object.
obj_name | object name |
smod | search mod: 'f'=first, 'n'=next, 'p'=previous, "l"=last |
|
inlinevirtual |
Return an iterator on the first object with the argument name. If the object is found, the current element is set on the object.
obj_name | object name |
|
inlinevirtual |
Return an iterator on the last object with the argument name. If the object is found, the current element is set on the object.
obj_name | object name |
|
inlinevirtual |
Return an iterator on the next object with the argument name. If the object is found, the current element is set on the object.
obj_name | object name |
|
inlinevirtual |
Return an iterator on the previous object with the argument name. If the object is found, the current element is set on the object.
obj_name | object name |
Macro from GCpp library that defines the following functions:
|
inline |
|
virtual |
Print the list.
fp | file pointer |
prefix | text written before each line |
|
virtual |
Print the list.
os | output stream |
prefix | text written before each line |
|
virtual |
|
virtual |
Set the sorting mode (dictionary or ascii code).
b | option ON/OFF |
References gcollection::gDictSort.
|
virtual |
Fills an array of strings with names of the objects. The array array size must large enough.