|
Nemo
2.2.0
|
#include <bitstring.h>
Public Member Functions | |
| reference (bitstring &bs, size_t pos) | |
| ~reference () | |
| reference & | operator= (bool x) |
| reference & | operator= (const reference &j) |
| bool | operator~ () const |
| operator bool () const | |
| reference & | flip () |
Private Member Functions | |
| reference () | |
Private Attributes | |
| _ul * | _word |
| size_t | _bitpos |
Friends | |
| class | bitstring |
Definition at line 57 of file bitstring.h.
| bitstring::reference::reference | ( | ) | [private] |
| bitstring::reference::reference | ( | bitstring & | bs, |
| size_t | pos | ||
| ) | [inline] |
Definition at line 68 of file bitstring.h.
References _bitpos, _word, BITS_PER_WORD, and bitstring::getword_atPos().
{
_word = bs.getword_atPos( pos );
_bitpos = pos % BITS_PER_WORD;
}
| bitstring::reference::~reference | ( | ) | [inline] |
Definition at line 74 of file bitstring.h.
{ }
| reference& bitstring::reference::flip | ( | ) | [inline] |
Definition at line 106 of file bitstring.h.
References _bitpos, _word, and BITS_PER_WORD.
{
*_word ^= ( 1UL << ( _bitpos % BITS_PER_WORD ) );
return *this;
}
| bitstring::reference::operator bool | ( | ) | const [inline] |
Definition at line 102 of file bitstring.h.
References _bitpos, _word, and BITS_PER_WORD.
{ return (*(_word) & ( 1UL << ( _bitpos % BITS_PER_WORD ) ) ) != 0; }
| reference& bitstring::reference::operator= | ( | bool | x | ) | [inline] |
Definition at line 78 of file bitstring.h.
References _bitpos, _word, and BITS_PER_WORD.
{
if (x)
*_word |= ( 1UL << ( _bitpos % BITS_PER_WORD ) );
else
*_word &= ~( 1UL << ( _bitpos % BITS_PER_WORD ) );
return *this;
}
Definition at line 88 of file bitstring.h.
References _bitpos, _word, and BITS_PER_WORD.
{
if ((*(j._word) & ( 1UL << ( j._bitpos % BITS_PER_WORD ) ) ))
*_word |= ( 1UL << ( _bitpos % BITS_PER_WORD ) );
else
*_word &= ~( 1UL << ( _bitpos % BITS_PER_WORD ) );
return *this;
}
| bool bitstring::reference::operator~ | ( | ) | const [inline] |
Definition at line 98 of file bitstring.h.
References _bitpos, _word, and BITS_PER_WORD.
{ return (*(_word) & ( 1UL << ( _bitpos % BITS_PER_WORD ) ) ) == 0; }
friend class bitstring [friend] |
Definition at line 59 of file bitstring.h.
size_t bitstring::reference::_bitpos [private] |
Definition at line 62 of file bitstring.h.
Referenced by flip(), operator bool(), operator=(), operator~(), and reference().
_ul* bitstring::reference::_word [private] |
Definition at line 61 of file bitstring.h.
Referenced by flip(), operator bool(), operator=(), operator~(), and reference().
1.7.5.1 -- Nemo is hosted by