00001
00002 #ifndef d_Collection_h
00003 #define d_Collection_h 1
00004
00005
00006 #include "oDynaObject.h"
00007 #include "d_Ref.h"
00008 #include "d_Object.h"
00009
00010
00011 template <class T> class _ODLL oCollBlock;
00012 template< class T > class _ODLL d_Iterator;
00013 class _ODLL d_Database;
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 template <class T>
00029 class _ODLL d_Collection : public d_Object
00030 {
00031 public:
00032
00033
00034
00035
00036
00037
00038
00039
00040 d_Collection (oUInt2 iBlockSize = dBlockSize);
00041
00042
00043
00044
00045
00046
00047 virtual ~d_Collection();
00048
00049 virtual void d_deactivate();
00050
00051
00052
00053
00054
00055
00056 void insert_element (const T& iElem);
00057
00058
00059
00060
00061
00062
00063
00064 d_Iterator<T> create_iterator () const;
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074 d_Iterator<T> begin () const;
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 d_Iterator<T> end () const;
00085
00086
00087
00088
00089
00090
00091 void remove_all ();
00092
00093
00094
00095
00096
00097
00098 d_ULong cardinality () const;
00099
00100 virtual d_Boolean allows_duplicates () const = 0;
00101 virtual d_Boolean is_ordered () const = 0;
00102
00103
00104
00105
00106
00107
00108
00109 d_Boolean is_empty () const;
00110
00111
00112 oUInt2 blockSize;
00113
00114 d_Ref<oCollBlock<T> > head;
00115
00116 d_Ref<oCollBlock<T> > tail;
00117
00118 protected:
00119
00120 oUInt2 blocks;
00121
00122 oUInt4 total;
00123
00124 oDynaObject* dynaObject;
00125
00126 private:
00127
00128 static oUInt2 dBlockSize;
00129 };
00130
00131
00132 template <class T>
00133 inline d_ULong d_Collection<T>::cardinality () const
00134 {
00135 return total;
00136 }
00137
00138
00139 #include "d_Collection.cti"
00140
00141
00142
00143
00144 #endif