GCpp general purpose C++ library
version 1.0
|
#include <GTreeBranchT.hh>
Public Member Functions | |
template<class Q > | |
bool | IsInstanceOf () const |
template<class Q > | |
bool | IsInstanceOf () |
virtual GTreeBranchT< T > * | Clone () const |
virtual const char * | ClassName () const |
Constructors, affectation, destructor | |
GTreeBranchT (const string &branch_name) | |
GTreeBranchT (const GTreeBranchT< T > &original) | |
virtual | ~GTreeBranchT () |
Element information | |
virtual bool | IsBranch () const |
virtual u_int | GetLeafCount () const |
virtual u_int | GetBranchCount () const |
virtual u_int | GetLeafTotalCount () const |
Tree structure exploration | |
virtual GTreeNodeT< T > * | NextNode () |
Tree construction function | |
virtual GTreeBranchT< T > * | AddBranch (const string &bname) |
virtual GTreeLeafT< T > * | AddLeaf (T &object_ref) |
virtual GTreeLeafT< T > * | AddLeaf (T *object_ptr) |
Creation of objects structures from the tree | |
virtual GTreeNodeT< GItem > * | CreateItemTree () const |
virtual GTreeBranchT< T > * | CreateFolderTree () const |
Print out | |
virtual void | Print (FILE *fp=stdout, const string &prefix="", bool info=false) const |
![]() | |
template<class Q > | |
bool | IsInstanceOf () const |
template<class Q > | |
bool | IsInstanceOf () |
GTreeNodeT () | |
GTreeNodeT (const GTreeNodeT< T > &original) | |
virtual | ~GTreeNodeT () |
virtual void | SetParent (GTreeBranchT< T > *parent_ptr) |
virtual void | SetListIter (GListIterT< GTreeNodeT< T > > *iter_ptr) |
virtual const GTreeBranchT< T > * | GetParent () const |
virtual GTreeBranchT< T > * | GetParent () |
virtual const GTreeNodeT< T > * | GetRoot () const |
virtual GTreeNodeT< T > * | GetRoot () |
virtual bool | IsLeaf () const |
void | SetUserData (void *data) |
void * | GetUserData () const |
virtual GListIterT< GTreeNodeT < T > > | GetListIter () const |
virtual GTreeLeafT< T > * | FirstLeaf () |
virtual GTreeLeafT< T > * | NextLeaf () |
virtual GTreeNodeT< T > * | FindNode (const string &name) |
virtual GTreeBranchT< T > * | FindBranch (const string &name) |
virtual GTreeBranchT< T > * | AddBranch (const string &parent, const string &bname) |
virtual GTreeLeafT< T > * | AddLeaf (const string &parent, T &object_ref) |
virtual GTreeLeafT< T > * | AddLeaf (const string &parent, T *object_ptr) |
u_int | GetLevel () const |
virtual string | GetFullName () const |
virtual GNamedListT< T > * | CreateList () |
virtual GItemList * | CreateItemList () |
![]() | |
template<class Q > | |
bool | IsInstanceOf () const |
template<class Q > | |
bool | IsInstanceOf () |
GNamed (const string &object_name="") | |
GNamed (const GNamed &object) | |
virtual | ~GNamed () |
GNamed & | operator= (const GNamed &object) |
virtual const string & | Name () const |
virtual string & | Name () |
virtual string | GetName () const |
virtual string | GetInfo () const |
virtual void | SetName (const string &object_name) |
int | Compare (const GNamed &object) const |
int | CompareDict (const GNamed &object) const |
bool | operator== (const GNamed &object) const |
bool | operator!= (const GNamed &object) const |
bool | operator< (const GNamed &object) const |
bool | operator> (const GNamed &object) const |
bool | operator<= (const GNamed &object) const |
bool | operator>= (const GNamed &object) const |
![]() | |
bool | IsInstanceOf () const |
bool | IsInstanceOf () |
GNamedListT (u_int fl=0) | |
GNamedListT (const GNamedListT< GTreeNodeT< T > > &list) | |
GNamedListT (const GNamedListT< GTreeNodeT< T > > &list, u_int fl) | |
GNamedListT< GTreeNodeT< T > > & | operator= (const GNamedListT< GTreeNodeT< T > > &list) |
virtual void | SetCaseSensitive (bool b=true) |
virtual void | SetDictSort (bool b=true) |
virtual int | Compare (const GTreeNodeT< T > &obj1, const GTreeNodeT< T > &obj2) const |
virtual bool | ExistName (const string &obj_name) const |
virtual GListIterT< GTreeNodeT < T > > | FindName (const string &obj_name, const char smod= 'f') const |
virtual GListIterT< GTreeNodeT < T > > | FindNameFirst (const string &obj_name) const |
virtual GListIterT< GTreeNodeT < T > > | FindNameLast (const string &obj_name) const |
virtual GListIterT< GTreeNodeT < T > > | FindNameNext (const string &obj_name) const |
virtual GListIterT< GTreeNodeT < 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 |
![]() | |
bool | IsInstanceOf () const |
bool | IsInstanceOf () |
GSortListT (u_int fl=0) | |
GSortListT (const GSortListT< GTreeNodeT< T > > &list) | |
GSortListT (const GListT< GTreeNodeT< T > > &list) | |
GSortListT (const GListT< GTreeNodeT< T > > &list, u_int fl) | |
GSortListT< GTreeNodeT< T > > & | operator= (const GListT< GTreeNodeT< T > > &list) |
virtual void | ReverseSort () |
virtual void | Sort () |
virtual bool | IsSorted () const |
![]() | |
bool | IsInstanceOf () const |
bool | IsInstanceOf () |
GListT (u_int opts=0) | |
GListT (const GListT< GTreeNodeT< T > > &list) | |
GListT (const GListT< GTreeNodeT< T > > &list, u_int opts) | |
GListT< GTreeNodeT< T > > & | operator= (const GListT< GTreeNodeT< T > > &list) |
virtual GListIterT< GTreeNodeT < T > > | Begin () const |
virtual GListIterT< GTreeNodeT < T > > | End () const |
virtual bool | Exist (const GTreeNodeT< T > *ptr) const |
virtual GListIterT< GTreeNodeT < T > > | Find (const GTreeNodeT< T > *ptr) const |
virtual GListIterT< GTreeNodeT < T > > | FindNext (const GTreeNodeT< T > *ptr) const |
virtual GListIterT< GTreeNodeT < T > > | FindPrevious (const GTreeNodeT< T > *ptr) const |
virtual GListIterT< GTreeNodeT < T > > | FindFirst (const GTreeNodeT< T > *ptr) const |
virtual GListIterT< GTreeNodeT < T > > | FindLast (const GTreeNodeT< T > *ptr) const |
GListIterT< GTreeNodeT< T > > | Current () const |
GListIterT< GTreeNodeT< T > > | Previous () const |
GListIterT< GTreeNodeT< T > > | Next () const |
GListIterT< GTreeNodeT< T > > | First () const |
GListIterT< GTreeNodeT< T > > | Last () const |
GListIterT< GTreeNodeT< T > > | Goto (u_int n=0) const |
GTreeNodeT< 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< GTreeNodeT < T > > | Add (GTreeNodeT< T > *obj_ptr) |
virtual GListIterT< GTreeNodeT < T > > | Add (GTreeNodeT< T > &obj_ptr) |
virtual GListIterT< GTreeNodeT < T > > | Insert (GTreeNodeT< T > *obj_ptr) |
virtual GListIterT< GTreeNodeT < T > > | Insert (GTreeNodeT< T > &obj_ptr) |
virtual GListIterT< GTreeNodeT < T > > | Append (GTreeNodeT< T > *obj_ptr) |
virtual GListIterT< GTreeNodeT < T > > | Append (GTreeNodeT< T > &obj_ptr) |
virtual GListIterT< GTreeNodeT < T > > | Prepend (GTreeNodeT< T > *obj_ptr) |
virtual GListIterT< GTreeNodeT < T > > | Prepend (GTreeNodeT< T > &obj_ptr) |
virtual GTreeNodeT< T > * | Take () |
virtual GTreeNodeT< T > * | Take (const GTreeNodeT< T > *ptr) |
virtual bool | Remove () |
virtual bool | Remove (const GTreeNodeT< T > *ptr, bool all=true) |
virtual void | Empty () |
![]() | |
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 Public Member Functions | |
static const char * | StaticClassName () |
![]() | |
static const char * | StaticClassName () |
![]() | |
static const char * | StaticClassName () |
![]() | |
static const char * | StaticClassName () |
![]() | |
static const char * | StaticClassName () |
![]() | |
static const char * | StaticClassName () |
static GListIterT< GTreeNodeT < T > > | Null () |
![]() | |
static const char * | StaticClassName () |
Protected Member Functions | |
Internal functions redefined for list behaviour | |
virtual GListIterT< GTreeNodeT < T > > | __Add (GTreeNodeT< T > *item) |
virtual GListIterT< GTreeNodeT < T > > | __Insert (GTreeNodeT< T > *item) |
virtual GTreeNodeT< T > * | __Take () |
![]() | |
virtual GListIterT< GTreeNodeT < T > > * | __FindName (const string &obj_name, const char smod= 'f') const |
![]() | |
virtual GListIterT< GTreeNodeT < T > > | __AddSorted (GTreeNodeT< T > *item) |
![]() | |
virtual GListIterT< GTreeNodeT < T > > * | __Exist (const GTreeNodeT< T > *ptr, GListIterT< GTreeNodeT< T > > *except=NULL) const |
virtual GListIterT< GTreeNodeT < T > > * | __Find (const GTreeNodeT< T > *ptr, GListIterT< GTreeNodeT< T > > *except=NULL) const |
virtual void | __Swap (GListIterT< GTreeNodeT< T > > *iter) |
virtual bool | __MoveUp () |
virtual bool | __MoveDown () |
Additional Inherited Members | |
![]() | |
GTreeBranchT< T > * | parent |
Parent element of the tree. | |
GListIterT< GTreeNodeT< T > > * | list_iter |
Pointer to the iterator in parent list. | |
void * | user_data |
Pointer to a additional user data. | |
![]() | |
string | name |
Object name. | |
![]() | |
GListIterT< GTreeNodeT< T > > ** | first_item |
Iterator on first object in the list. | |
GListIterT< GTreeNodeT< T > > ** | last_item |
Iterator on last object in the list. | |
GListIterT< GTreeNodeT< 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. | |
A tree branch is a tree element itself, and a the list of tree elements that a contained in the branch.
|
inline |
Default constructor.
References GDebugConst, and GNamed::SetName().
|
inline |
|
inlinevirtual |
Destructor.
References GDebugDest.
|
protectedvirtual |
Function redefined from list base class to add an element to the branch, after current element.
obj_ptr | object pointer |
Reimplemented from GNamedListT< GTreeNodeT< T > >.
References GDebugClass, GGetString(), GTreeNodeT< T >::SetListIter(), and GTreeNodeT< T >::SetParent().
|
protectedvirtual |
Function redefined from list base class to insert an element to the branch, before current element.
obj_ptr | object pointer |
Reimplemented from GNamedListT< GTreeNodeT< T > >.
References GDebugClass, GGetString(), GTreeNodeT< T >::SetListIter(), and GTreeNodeT< T >::SetParent().
|
inlineprotectedvirtual |
Function redefined from base class to take the current element out of the list (without deleting it, just removing the connecting pointers).
Reimplemented from GListT< GTreeNodeT< T > >.
References GTreeNodeT< T >::SetListIter(), and GTreeNodeT< T >::SetParent().
|
inlinevirtual |
Add a sub-branch at the end of the current branch.
bname | name of the sub-branch |
Reimplemented from GTreeNodeT< T >.
Referenced by GTreeNodeT< T >::AddBranch().
|
inlinevirtual |
Add a leaf at the end of the current branch. The object is not adopted by the created leaf.
object_ref | object given by reference |
Reimplemented from GTreeNodeT< T >.
Referenced by GTreeNodeT< T >::AddLeaf().
|
inlinevirtual |
Add a leaf at the end of the current branch. The object is adopted by the created leaf.
object_ptr | object given by pointer |
Reimplemented from GTreeNodeT< T >.
|
virtual |
Create a copy of the tree containing only the folders (branches). The user data pointer of the created tree nodes (branches) is copied from the original tree.
References GListT< GTreeNodeT< T > >::Append(), GTreeBranchT< T >::CreateFolderTree(), GTreeNodeT< T >::IsBranch(), and GTreeNodeT< T >::SetUserData().
Referenced by GTreeBranchT< T >::CreateFolderTree().
|
virtual |
Create a GItem tree branch: the tree structure is dupplicated, but with GItem objects pointing on original tree leaf objects. The resulting tree must be deleted by the calling function.
Implements GTreeNodeT< T >.
References GListT< GTreeNodeT< T > >::Append(), and GTreeBranchT< T >::CreateItemTree().
Referenced by GTreeBranchT< T >::CreateItemTree().
|
virtual |
Return the number of (sub-)branches in this branch.
|
virtual |
Return the number of leaves in this branch.
Implements GTreeNodeT< T >.
|
virtual |
Return the total number of leaves, in this branch and in the sub-branches included.
Implements GTreeNodeT< T >.
|
inlinevirtual |
Return true if the node is a branch.
Reimplemented from GTreeNodeT< T >.
Macro from GCpp library that defines the following functions:
|
virtual |
Return the next node: first node in the branch if it exists, else next node in the parent list.
Reimplemented from GTreeNodeT< T >.
References GTreeNodeT< T >::NextNode().
|
virtual |
Print the list: elements are given by their name or associated information.
fp | file pointer |
prefix | text written before each line |
info | if true, the information is printed instead of the name |
Implements GTreeNodeT< T >.
References GTreeNodeT< T >::GetParent().