00001 00048 #ifndef INC_MI32_BITSETD_H 00049 #define INC_MI32_BITSETD_H 00050 00051 #ifndef INC_MI32_STDDEFNS_H 00052 #include <mi32/stddefns.h> 00053 #endif 00054 00055 #ifndef GENERATING_DOXYGEN_OUTPUT 00056 class BITSET_UNOWNED; 00057 class BITSET; 00058 #endif // GENERATING_DOXYGEN_OUTPUT 00059 00060 #ifdef MISYSTEMDLL 00061 #define CLASSLIBEXPORT MI_DLLCLASSEXPORT 00062 #else 00063 #define CLASSLIBEXPORT MI_DLLCLASSIMPORT 00064 #endif 00065 00066 class CLASSLIBEXPORT BITSET_DEQUE { 00067 public: 00068 00070 class CLASSLIBEXPORT ITERATOR { 00071 public: 00072 00074 UINT32 operator* ( 00075 ) const; 00076 00078 operator UINT32 ( 00079 ) const; 00080 00082 ITERATOR& operator++ ( 00083 ); 00084 00086 bool operator== ( 00087 const ITERATOR& rhs 00088 ) const; 00089 00091 bool operator!= ( 00092 const ITERATOR& rhs 00093 ) const; 00094 00095 private: 00096 #ifndef GENERATING_DOXYGEN_OUTPUT 00097 const BITSET_DEQUE* m_BitSet; 00098 UINT32 m_SetItemIndex; 00099 UINT8 m_TestBit; 00100 UINT8 m_SkipByte; 00101 00103 ITERATOR (const BITSET_DEQUE* BitSet, bool testvalue); 00105 ITERATOR (const BITSET_DEQUE* BitSet); 00106 00107 friend class BITSET_DEQUE; 00108 #endif // GENERATING_DOXYGEN_OUTPUT 00109 }; 00110 00111 BITSET_DEQUE ( 00112 ); 00113 00114 BITSET_DEQUE ( 00115 const BITSET_DEQUE& rhs 00116 ); 00117 00118 BITSET_DEQUE ( 00119 const BITSET_UNOWNED& rhs 00120 ); 00121 00122 ~BITSET_DEQUE ( 00123 ); 00124 00125 BITSET_DEQUE& operator= ( 00126 const BITSET_DEQUE& rhs 00127 ); 00128 00129 BITSET_DEQUE& operator= ( 00130 const BITSET_UNOWNED& rhs 00131 ); 00132 00135 ITERATOR Begin ( 00136 bool value = true 00137 ) const; 00138 00140 void Clear ( 00141 UINT32 posn 00142 ); 00143 00146 void ClearAll ( 00147 ); 00148 00150 void ClearRange ( 00151 UINT32 min, 00152 UINT32 max 00153 ); 00154 00157 INT32 CountValues ( 00158 bool value = true 00159 ) const; 00160 00163 void CopyBit ( 00164 UINT32 DestPosn, 00165 UINT32 SourcePosn 00166 ); 00167 00170 ITERATOR End ( 00171 ) const; 00172 00174 void Free ( 00175 ); 00176 00179 bool GetBit ( 00180 UINT32 posn 00181 ) const; 00182 00185 INT32 GetBitArray ( 00186 UINT8*& array 00187 ) const; 00188 00190 ERRVALUE GetBitset ( 00191 BITSET& bitset 00192 ) const; 00193 00195 UINT32 GetNumEntries ( 00196 ) const; 00197 00200 bool GetRange ( 00201 UINT32 StartPosn, 00202 UINT32 MaxEnd, 00203 UINT32& EndPosn 00204 ) const; 00205 00207 bool HasEntries ( 00208 ) const; 00209 00211 bool HasMultiple ( 00212 bool value 00213 ) const; 00214 00216 bool HasValue ( 00217 bool value 00218 ) const; 00219 00221 void Invert ( 00222 UINT32 posn 00223 ); 00224 00226 void InvertAll ( 00227 ); 00228 00230 void InvertRange ( 00231 UINT32 min, 00232 UINT32 max 00233 ); 00234 00236 void LogicalAnd ( 00237 const BITSET_DEQUE& rhs 00238 ); 00239 00241 ERRVALUE LogicalOr ( 00242 const BITSET_DEQUE& rhs 00243 ); 00244 00246 ERRVALUE Resize ( 00247 UINT32 NumEntries 00248 ); 00249 00252 void Set ( 00253 UINT32 posn 00254 ); 00255 00258 void SetAll ( 00259 ); 00260 00263 void SetBit ( 00264 UINT32 posn, 00265 bool value 00266 ); 00267 00269 void SetRange ( 00270 UINT32 min, 00271 UINT32 max 00272 ); 00273 00274 private: 00275 #ifndef GENERATING_DOXYGEN_OUTPUT 00276 struct TILE { 00277 UINT8* m_Array; 00278 bool m_IsValid; 00279 bool m_IsSet; 00280 }; 00281 00282 TILE* m_Tiles; 00283 UINT32 m_NumEntries; 00284 UINT32 m_NumTiles; 00285 UINT32 m_NumFreeTiles; 00286 static const UINT32 s_TileSize; 00287 00288 ERRVALUE GetTile (UINT32 ti); 00289 00290 friend class ITERATOR; 00291 #endif // GENERATING_DOXYGEN_OUTPUT 00292 }; 00293 00294 #undef CLASSLIBEXPORT 00295 00296 #endif // INC_MI32_BITSETD_H
1.6.1