00001 #ifndef _FL_TREE_ITEM_ARRAY_H 00002 #define _FL_TREE_ITEM_ARRAY_H 00003 00004 class Fl_Tree_Item; // forward decl must *precede* first doxygen comment block 00005 // or doxygen will not document our class.. 00006 00007 //INSERT-LGPL-HEADER-HERE// 00008 00013 00023 00024 class Fl_Tree_Item_Array { 00025 Fl_Tree_Item **_items; // items array 00026 int _total; // #items in array 00027 int _size; // #items *allocated* for array 00028 int _chunksize; // #items to enlarge mem allocation 00029 void enlarge(int count); 00030 public: 00031 Fl_Tree_Item_Array(int new_chunksize = 10); // CTOR 00032 ~Fl_Tree_Item_Array(); // DTOR 00033 Fl_Tree_Item_Array(const Fl_Tree_Item_Array *o); // COPY CTOR 00035 Fl_Tree_Item *operator[](int i) { 00036 return(_items[i]); 00037 } 00039 const Fl_Tree_Item *operator[](int i) const { 00040 return(_items[i]); 00041 } 00043 int total() const { 00044 return(_total); 00045 } 00047 void swap(int ax, int bx) { 00048 Fl_Tree_Item *asave = _items[ax]; 00049 _items[ax] = _items[bx]; 00050 _items[bx] = asave; 00051 } 00052 void clear(); 00053 void add(Fl_Tree_Item *val); 00054 void insert(int pos, Fl_Tree_Item *new_item); 00055 void remove(int index); 00056 int remove(Fl_Tree_Item *item); 00057 }; 00058 00059 #endif /*_FL_TREE_ITEM_ARRAY_H*/