Nugget
|
#include <bitset.h>
Classes | |
class | reference |
Public Types | |
enum | { kBitsPerWord = (8 * sizeof(word_type)) , kBitsPerWordMask = (kBitsPerWord - 1) , kBitsPerWordShift = ((kBitsPerWord == 8) ? 3 : ((kBitsPerWord == 16) ? 4 : ((kBitsPerWord == 32) ? 5 : (((kBitsPerWord == 64) ? 6 : 7))))) , kSize = N , kWordSize = sizeof(word_type) , kWordCount = BITSET_WORD_COUNT(N, WordType) } |
typedef BitsetBase< BITSET_WORD_COUNT(N, WordType), WordType > | base_type |
typedef bitset< N, WordType > | this_type |
typedef WordType | word_type |
typedef base_type::size_type | size_type |
Public Member Functions | |
bitset (uint32_t value) | |
this_type & | operator&= (const this_type &x) |
this_type & | operator|= (const this_type &x) |
this_type & | operator^= (const this_type &x) |
this_type & | operator<<= (size_type n) |
this_type & | operator>>= (size_type n) |
this_type & | set () |
this_type & | set (size_type i, bool value=true) |
this_type & | reset () |
this_type & | reset (size_type i) |
this_type & | flip () |
this_type & | flip (size_type i) |
this_type | operator~ () const |
reference | operator[] (size_type i) |
bool | operator[] (size_type i) const |
const word_type * | data () const |
word_type * | data () |
void | from_uint32 (uint32_t value) |
void | from_uint64 (uint64_t value) |
size_type | size () const |
bool | operator== (const this_type &x) const |
bool | operator!= (const this_type &x) const |
bool | test (size_type i) const |
bool | all () const |
bool | none () const |
this_type | operator<< (size_type n) const |
this_type | operator>> (size_type n) const |
size_type | find_first () const |
size_type | find_next (size_type last_find) const |
size_type | find_last () const |
size_type | find_prev (size_type last_find) const |
word_type & | DoGetWord (size_type i) |
word_type | DoGetWord (size_type i) const |
size_type | DoFindFirst () const |
size_type | DoFindNext (size_type last_find) const |
size_type | DoFindLast () const |
size_type | DoFindPrev (size_type last_find) const |
unsigned long | to_ulong () const |
uint32_t | to_uint32 () const |
uint64_t | to_uint64 () const |
size_type | count () const |
bool | any () const |
Public Attributes | |
word_type | mWord [NW] |
Friends | |
class | reference |
bitset
Implements a bitset much like the C++ std::bitset.
As of this writing we don't implement a specialization of bitset<0>, as it is deemed an academic exercise that nobody would actually use and it would increase code space and provide little practical benefit. Note that this doesn't mean bitset<0> isn't supported; it means that our version of it isn't as efficient as it would be if a specialization was made for it.