Definition at line 70 of file bool_array.h.
Public Member Functions | |
| _Element (BYTE *__ptr, unsigned long __idx) | |
| operator bool () const | |
| bool | operator= (bool __value) |
Private Attributes | |
| size_t | _M_bit_idx |
| size_t | _M_byte_idx |
| BYTE * | _M_byte_ptr |
| bool_array::_Element::_Element | ( | BYTE * | __ptr, | |
| unsigned long | __idx | |||
| ) | [inline] |
Constructs a reference to an array element.
| __ptr | pointer to the interal boolean data | |
| __idx | index of the array element to access |
Definition at line 116 of file bool_array.h.
References _M_bit_idx, _M_byte_idx, and _M_byte_ptr.
00117 { 00118 _M_byte_ptr = __ptr; 00119 _M_byte_idx = (size_t)(__idx / 8); 00120 _M_bit_idx = (size_t)(__idx % 8); 00121 }
| bool_array::_Element::operator bool | ( | ) | const [inline] |
Reads the boolean value from an array element.
Definition at line 143 of file bool_array.h.
References _M_bit_idx, _M_byte_idx, and _M_byte_ptr.
00144 { 00145 return *(_M_byte_ptr + _M_byte_idx) & (1 << _M_bit_idx) ? true : false; 00146 }
Assigns a new boolean value to an array element.
| __value | the new boolean value |
Definition at line 129 of file bool_array.h.
References _M_bit_idx, _M_byte_idx, and _M_byte_ptr.
00130 { 00131 if (__value) 00132 *(_M_byte_ptr + _M_byte_idx) |= 1 << _M_bit_idx; 00133 else 00134 *(_M_byte_ptr + _M_byte_idx) &= ~(1 << _M_bit_idx); 00135 return __value; 00136 }
size_t bool_array::_Element::_M_bit_idx [private] |
Definition at line 79 of file bool_array.h.
Referenced by _Element(), operator bool(), and operator=().
size_t bool_array::_Element::_M_byte_idx [private] |
Definition at line 78 of file bool_array.h.
Referenced by _Element(), operator bool(), and operator=().
BYTE* bool_array::_Element::_M_byte_ptr [private] |
Definition at line 77 of file bool_array.h.
Referenced by _Element(), operator bool(), and operator=().
1.5.6