00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef INC_MI32_BITSETD_H
00046 #define INC_MI32_BITSETD_H
00047
00048 #ifndef INC_MI32_STDDEFNS_H
00049 #include <mi32/stddefns.h>
00050 #endif
00051
00052 #ifdef MISYSTEMDLL
00053 #define CLASSLIBEXPORT MI_DLLCLASSEXPORT
00054 #else
00055 #define CLASSLIBEXPORT MI_DLLCLASSIMPORT
00056 #endif
00057
00058 class CLASSLIBEXPORT BITSET_DEQUE {
00059 public:
00060
00061
00062 class CLASSLIBEXPORT ITERATOR {
00063 public:
00064
00065
00066 UINT32 operator* (
00067 ) const;
00068
00069
00070 operator UINT32 (
00071 ) const;
00072
00073
00074 ITERATOR& operator++ (
00075 );
00076
00077
00078 bool operator== (
00079 const ITERATOR& rhs
00080 ) const;
00081
00082
00083 bool operator!= (
00084 const ITERATOR& rhs
00085 ) const;
00086
00087 private:
00088 #ifndef GENERATING_DOXYGEN_OUTPUT
00089 const BITSET_DEQUE* m_BitSet;
00090 UINT32 m_SetItemIndex;
00091 UINT8 m_TestBit;
00092 UINT8 m_SkipByte;
00093
00094
00095 ITERATOR (const BITSET_DEQUE* BitSet, bool testvalue);
00096
00097 ITERATOR (const BITSET_DEQUE* BitSet);
00098
00099 friend class BITSET_DEQUE;
00100 #endif // GENERATING_DOXYGEN_OUTPUT
00101 };
00102
00103 BITSET_DEQUE (
00104 );
00105
00106 BITSET_DEQUE (
00107 const BITSET_DEQUE& rhs
00108 );
00109
00110 ~BITSET_DEQUE (
00111 );
00112
00113 BITSET_DEQUE& operator= (
00114 const BITSET_DEQUE& rhs
00115 );
00116
00117
00118
00119 ITERATOR Begin (
00120 bool value = true
00121 ) const;
00122
00123
00124 void Clear (
00125 UINT32 posn
00126 );
00127
00128
00129
00130 void ClearAll (
00131 );
00132
00133
00134 void ClearRange (
00135 UINT32 min,
00136 UINT32 max
00137 );
00138
00139
00140
00141 INT32 CountValues (
00142 bool value = true
00143 ) const;
00144
00145
00146
00147 void CopyBit (
00148 UINT32 DestPosn,
00149 UINT32 SourcePosn
00150 );
00151
00152
00153
00154 ITERATOR End (
00155 ) const;
00156
00157
00158 void Free (
00159 );
00160
00161
00162
00163 bool GetBit (
00164 UINT32 posn
00165 ) const;
00166
00167
00168
00169 INT32 GetBitArray (
00170 UINT8*& array
00171 ) const;
00172
00173
00174 UINT32 GetNumEntries (
00175 ) const;
00176
00177
00178
00179 bool GetRange (
00180 UINT32 StartPosn,
00181 UINT32 MaxEnd,
00182 UINT32& EndPosn
00183 ) const;
00184
00185
00186 bool HasEntries (
00187 ) const;
00188
00189
00190 bool HasMultiple (
00191 bool value
00192 ) const;
00193
00194
00195 bool HasValue (
00196 bool value
00197 ) const;
00198
00199
00200 void Invert (
00201 UINT32 posn
00202 );
00203
00204
00205 void InvertAll (
00206 );
00207
00208
00209 void InvertRange (
00210 UINT32 min,
00211 UINT32 max
00212 );
00213
00214
00215 ERRVALUE Resize (
00216 UINT32 NumEntries
00217 );
00218
00219
00220
00221 void Set (
00222 UINT32 posn
00223 );
00224
00225
00226
00227 void SetAll (
00228 );
00229
00230
00231
00232 void SetBit (
00233 UINT32 posn,
00234 bool value
00235 );
00236
00237
00238 void SetRange (
00239 UINT32 min,
00240 UINT32 max
00241 );
00242
00243 private:
00244 #ifndef GENERATING_DOXYGEN_OUTPUT
00245 struct TILE {
00246 UINT8* m_Array;
00247 bool m_IsValid;
00248 bool m_IsSet;
00249 };
00250
00251 TILE* m_Tiles;
00252 UINT32 m_NumEntries;
00253 UINT32 m_NumTiles;
00254 UINT32 m_NumFreeTiles;
00255 static const UINT32 s_TileSize;
00256
00257 ERRVALUE GetTile (UINT32 ti);
00258
00259 friend class ITERATOR;
00260 #endif // GENERATING_DOXYGEN_OUTPUT
00261 };
00262
00263 #undef CLASSLIBEXPORT
00264
00265 #endif // INC_MI32_BITSETD_H