ReactOS  0.4.15-dev-2153-g62b4c61
_Base_bitset< 1UL > Struct Reference

#include <_bitset.h>

Public Types

typedef unsigned long _WordT
 
typedef _Base_bitset< 1UL > _Self
 

Public Member Functions

 _Base_bitset (void)
 
 _Base_bitset (unsigned long __val)
 
_WordT_M_getword (size_t)
 
_WordT _M_getword (size_t) const
 
_WordT_M_hiword ()
 
_WordT _M_hiword () const
 
void _M_do_and (const _Self &__x)
 
void _M_do_or (const _Self &__x)
 
void _M_do_xor (const _Self &__x)
 
void _M_do_left_shift (size_t __shift)
 
void _M_do_right_shift (size_t __shift)
 
void _M_do_flip ()
 
void _M_do_set ()
 
void _M_do_reset ()
 
bool _M_is_equal (const _Self &__x) const
 
bool _M_is_any () const
 
size_t _M_do_count () const
 
unsigned long _M_do_to_ulong () const
 
size_t _M_do_find_first (size_t __not_found) const
 
size_t _M_do_find_next (size_t __prev, size_t __not_found) const
 

Static Public Member Functions

static size_t _STLP_CALL _S_whichword (size_t __pos)
 
static size_t _STLP_CALL _S_whichbyte (size_t __pos)
 
static size_t _STLP_CALL _S_whichbit (size_t __pos)
 
static _WordT _STLP_CALL _S_maskbit (size_t __pos)
 

Public Attributes

_WordT _M_w
 

Detailed Description

Definition at line 210 of file _bitset.h.

Member Typedef Documentation

◆ _Self

typedef _Base_bitset<1UL> _Base_bitset< 1UL >::_Self

Definition at line 212 of file _bitset.h.

◆ _WordT

typedef unsigned long _Base_bitset< 1UL >::_WordT

Definition at line 211 of file _bitset.h.

Constructor & Destructor Documentation

◆ _Base_bitset() [1/2]

_Base_bitset< 1UL >::_Base_bitset ( void  )
inline

Definition at line 216 of file _bitset.h.

216 : _M_w(0) {}

◆ _Base_bitset() [2/2]

_Base_bitset< 1UL >::_Base_bitset ( unsigned long  __val)
inline

Definition at line 217 of file _bitset.h.

217 : _M_w(__val) {}
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656

Member Function Documentation

◆ _M_do_and()

void _Base_bitset< 1UL >::_M_do_and ( const _Self __x)
inline

Definition at line 238 of file _bitset.h.

238 { _M_w &= __x._M_w; }

◆ _M_do_count()

size_t _Base_bitset< 1UL >::_M_do_count ( ) const
inline

Definition at line 254 of file _bitset.h.

254  {
255  const unsigned char* __byte_ptr = (const unsigned char*)&_M_w;
256  const unsigned char* __end_ptr = ((const unsigned char*)&_M_w)+sizeof(_M_w);
257  return _Bs_G::_S_count(__byte_ptr, __end_ptr);
258  }
static size_t _S_count(const unsigned char *__beg, const unsigned char *__end)
Definition: bitset.cpp:30

◆ _M_do_find_first()

size_t _Base_bitset< 1UL >::_M_do_find_first ( size_t  __not_found) const
inline

Definition at line 275 of file _bitset.h.

275  {
276  // typedef unsigned long _WordT;
277  _WordT __thisword = _M_w;
278 
279  if ( __thisword != __STATIC_CAST(_WordT,0) ) {
280  // find byte within word
281  for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
282  unsigned char __this_byte
283  = __STATIC_CAST(unsigned char,(__thisword & (~(unsigned char)0)));
284  if ( __this_byte )
285  return __j*CHAR_BIT + _Bs_G::_S_first_one(__this_byte);
286 
287  __thisword >>= CHAR_BIT;
288  }
289  }
290  // not found, so return a value that indicates failure.
291  return __not_found;
292 }
unsigned long _WordT
Definition: _bitset.h:211
static unsigned char _S_first_one(unsigned char __x)
Definition: bitset.cpp:95
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
#define CHAR_BIT
Definition: urlcache.c:62

◆ _M_do_find_next()

size_t _Base_bitset< 1UL >::_M_do_find_next ( size_t  __prev,
size_t  __not_found 
) const
inline

Definition at line 295 of file _bitset.h.

296  {
297  // make bound inclusive
298  ++__prev;
299 
300  // check out of bounds
301  if ( __prev >= __BITS_PER_WORD )
302  return __not_found;
303 
304  // search first (and only) word
305  _WordT __thisword = _M_w;
306 
307  // mask off bits below bound
308  __thisword &= (~__STATIC_CAST(_WordT,0)) << _S_whichbit(__prev);
309 
310  if ( __thisword != __STATIC_CAST(_WordT,0) ) {
311  // find byte within word
312  // get first byte into place
313  __thisword >>= _S_whichbyte(__prev) * CHAR_BIT;
314  for ( size_t __j = _S_whichbyte(__prev); __j < sizeof(_WordT); __j++ ) {
315  unsigned char __this_byte
316  = __STATIC_CAST(unsigned char,(__thisword & (~(unsigned char)0)));
317  if ( __this_byte )
318  return __j*CHAR_BIT + _Bs_G::_S_first_one(__this_byte);
319 
320  __thisword >>= CHAR_BIT;
321  }
322  }
323 
324  // not found, so return a value that indicates failure.
325  return __not_found;
326 } // end _M_do_find_next
unsigned long _WordT
Definition: _bitset.h:211
static unsigned char _S_first_one(unsigned char __x)
Definition: bitset.cpp:95
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
#define CHAR_BIT
Definition: urlcache.c:62
static size_t _STLP_CALL _S_whichbit(size_t __pos)
Definition: _bitset.h:225
#define __BITS_PER_WORD
Definition: _bitset.h:62
static size_t _STLP_CALL _S_whichbyte(size_t __pos)
Definition: _bitset.h:222

◆ _M_do_flip()

void _Base_bitset< 1UL >::_M_do_flip ( )
inline

Definition at line 243 of file _bitset.h.

243 { _M_w = ~_M_w; }

◆ _M_do_left_shift()

void _Base_bitset< 1UL >::_M_do_left_shift ( size_t  __shift)
inline

Definition at line 241 of file _bitset.h.

241 { _M_w <<= __shift; }

◆ _M_do_or()

void _Base_bitset< 1UL >::_M_do_or ( const _Self __x)
inline

Definition at line 239 of file _bitset.h.

239 { _M_w |= __x._M_w; }

◆ _M_do_reset()

void _Base_bitset< 1UL >::_M_do_reset ( )
inline

Definition at line 245 of file _bitset.h.

245 { _M_w = 0; }

◆ _M_do_right_shift()

void _Base_bitset< 1UL >::_M_do_right_shift ( size_t  __shift)
inline

Definition at line 242 of file _bitset.h.

242 { _M_w >>= __shift; }

◆ _M_do_set()

void _Base_bitset< 1UL >::_M_do_set ( )
inline

Definition at line 244 of file _bitset.h.

244 { _M_w = ~__STATIC_CAST(_WordT,0); }
unsigned long _WordT
Definition: _bitset.h:211
#define __STATIC_CAST(__x, __y)
Definition: features.h:585

◆ _M_do_to_ulong()

unsigned long _Base_bitset< 1UL >::_M_do_to_ulong ( ) const
inline

Definition at line 260 of file _bitset.h.

260 { return _M_w; }

◆ _M_do_xor()

void _Base_bitset< 1UL >::_M_do_xor ( const _Self __x)
inline

Definition at line 240 of file _bitset.h.

240 { _M_w ^= __x._M_w; }

◆ _M_getword() [1/2]

_WordT& _Base_bitset< 1UL >::_M_getword ( size_t  )
inline

Definition at line 232 of file _bitset.h.

232 { return _M_w; }

◆ _M_getword() [2/2]

_WordT _Base_bitset< 1UL >::_M_getword ( size_t  ) const
inline

Definition at line 233 of file _bitset.h.

233 { return _M_w; }

◆ _M_hiword() [1/2]

_WordT& _Base_bitset< 1UL >::_M_hiword ( )
inline

Definition at line 235 of file _bitset.h.

235 { return _M_w; }

◆ _M_hiword() [2/2]

_WordT _Base_bitset< 1UL >::_M_hiword ( ) const
inline

Definition at line 236 of file _bitset.h.

236 { return _M_w; }

◆ _M_is_any()

bool _Base_bitset< 1UL >::_M_is_any ( ) const
inline

Definition at line 250 of file _bitset.h.

250  {
251  return _M_w != 0;
252  }

◆ _M_is_equal()

bool _Base_bitset< 1UL >::_M_is_equal ( const _Self __x) const
inline

Definition at line 247 of file _bitset.h.

247  {
248  return _M_w == __x._M_w;
249  }

◆ _S_maskbit()

static _WordT _STLP_CALL _Base_bitset< 1UL >::_S_maskbit ( size_t  __pos)
inlinestatic

Definition at line 228 of file _bitset.h.

228  {
229  return (__STATIC_CAST(_WordT,1)) << _S_whichbit(__pos);
230  }
unsigned long _WordT
Definition: _bitset.h:211
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
static size_t _STLP_CALL _S_whichbit(size_t __pos)
Definition: _bitset.h:225

◆ _S_whichbit()

static size_t _STLP_CALL _Base_bitset< 1UL >::_S_whichbit ( size_t  __pos)
inlinestatic

Definition at line 225 of file _bitset.h.

225  {
226  return __pos % __BITS_PER_WORD;
227  }
#define __BITS_PER_WORD
Definition: _bitset.h:62

◆ _S_whichbyte()

static size_t _STLP_CALL _Base_bitset< 1UL >::_S_whichbyte ( size_t  __pos)
inlinestatic

Definition at line 222 of file _bitset.h.

222  {
223  return (__pos % __BITS_PER_WORD) / CHAR_BIT;
224  }
#define CHAR_BIT
Definition: urlcache.c:62
#define __BITS_PER_WORD
Definition: _bitset.h:62

◆ _S_whichword()

static size_t _STLP_CALL _Base_bitset< 1UL >::_S_whichword ( size_t  __pos)
inlinestatic

Definition at line 219 of file _bitset.h.

219  {
220  return __pos / __BITS_PER_WORD ;
221  }
#define __BITS_PER_WORD
Definition: _bitset.h:62

Member Data Documentation

◆ _M_w

_WordT _Base_bitset< 1UL >::_M_w

Definition at line 214 of file _bitset.h.

Referenced by _M_do_and(), _M_do_or(), _M_do_xor(), and _M_is_equal().


The documentation for this struct was generated from the following file: