claraty::Bits::reference Class Reference
#include <bits.h>
Public Member Functions | |
| reference (Bits &b, size_t pos) | |
| ~reference () | |
| reference & | operator= (bool x) |
| reference & | operator= (const reference &j) |
| bool | operator~ () const |
| operator bool () const | |
| reference & | toggle () |
Private Member Functions | |
| reference () | |
Private Attributes | |
| unsigned long * | _data_p |
| size_t | _bit_pos |
Friends | |
| class | Bits |
Detailed Description
Definition at line 192 of file bits.h.
Constructor & Destructor Documentation
| claraty::Bits::reference::reference | ( | ) | [private] |
| claraty::Bits::reference::reference | ( | Bits & | b, | |
| size_t | pos | |||
| ) | [inline] |
| claraty::Bits::reference::~reference | ( | ) | [inline] |
Member Function Documentation
| Bits::reference & claraty::Bits::reference::operator= | ( | bool | x | ) | [inline] |
Definition at line 246 of file bits.h.
References _bit_pos, _data_p, and claraty::_maskbit().
00247 { 00248 // for b[i] = x 00249 // 00250 if ( x ) 00251 *_data_p |= _maskbit(_bit_pos); 00252 else 00253 *_data_p &= ~_maskbit(_bit_pos); 00254 00255 return *this; 00256 }
Here is the call graph for this function:

| Bits::reference & claraty::Bits::reference::operator= | ( | const reference & | j | ) | [inline] |
Definition at line 258 of file bits.h.
References _bit_pos, _data_p, and claraty::_maskbit().
00259 { 00260 // for b[i] = b[j]; 00261 // 00262 if ( *j._data_p & _maskbit(j._bit_pos) ) 00263 *_data_p |= _maskbit(_bit_pos); 00264 else 00265 *_data_p &= ~_maskbit(_bit_pos); 00266 00267 return *this; 00268 }
Here is the call graph for this function:

| bool claraty::Bits::reference::operator~ | ( | ) | const [inline] |
| claraty::Bits::reference::operator bool | ( | ) | const [inline] |
Definition at line 277 of file bits.h.
References _bit_pos, _data_p, and claraty::_maskbit().
00278 { 00279 // for x = b[i]; conversion operator to a built-in type bool 00280 // 00281 return (*_data_p & _maskbit(_bit_pos)) != 0; // != has precedence over & 00282 }
Here is the call graph for this function:

| Bits::reference & claraty::Bits::reference::toggle | ( | ) | [inline] |
Friends And Related Function Documentation
Member Data Documentation
unsigned long* claraty::Bits::reference::_data_p [private] |
Definition at line 202 of file bits.h.
Referenced by operator bool(), operator=(), operator~(), and toggle().
size_t claraty::Bits::reference::_bit_pos [private] |
Definition at line 203 of file bits.h.
Referenced by operator bool(), operator=(), operator~(), and toggle().
The documentation for this class was generated from the following file:

