6 namespace frechet {
namespace data {
188 int next(
int index)
const;
191 int prev(
int off)
const;
210 static int64_t
compare_and_swap(
volatile int64_t* value, int64_t old_value, int64_t update_value);
~BitSet()
destructor, releases all data
an iterator over a BitSet
iterator & operator-=(int n)
skip operator
static int numberOfTrailingZeros(uint64_t word)
compute number of trailing zeros in a 64 bit word
BitSet & operator+=(int offset)
assign true
static int64_t compare_and_swap(volatile int64_t *value, int64_t old_value, int64_t update_value)
atomic compare-and-swap
global definitions for all algorithms.
iterator operator-(int n)
skip operator
int next(int index) const
find next index with a set (true) bit
void remove(int offset)
assign false
iterator & operator+=(int n)
skip operator
iterator operator+(int n) const
skip operator
void stealBits(BitSet &&that)
steal data
int numWords
number of allocated words (1 word = 64 bits)
void clear()
assign false to all bits
void remove_lf(int offset)
lock-free add operator; not used and not tested!
int prev(int off) const
find previos index with a set (true) bit
bool contains(int offset) const
static int numberOfLeadingZeros(uint64_t word)
compute number of leading zeros in a 64 bit word
void add(int offset)
assign true
iterator & operator--()
pre-decrement; move to the previous set (true) bit
int _offset
current offset
BitSet & operator=(const BitSet &that)
assigment operator
bool operator[](int offset) const
static int bitCount(uint64_t word)
compute number of set bits in a 64 bit word
void copyBits(const BitSet &that)
copy data
iterator()
empty constructor; creates an invalid iterator
A simple bit vector of fixed size.
BitSet()
default constructor; creates an empty set
iterator & operator=(const iterator &that)
assignment operator
BitSet & swap(BitSet &that)
swap contents with other object
int _size
number of valid bits
bool operator==(const iterator &that) const
equality comparator
int count() const
This methods is expensive, as it scans the whole array.
void add_lf(int offset)
lock-free add operator; not used and not tested!
const BitSet * parent
parent BitSet
BitSet & operator-=(int offset)
assign false
iterator & operator++()
pre-increment; move to the next set (true) bit