libtasks Documentation
1.6
|
A thread safe lock free bitset. More...
#include <bitset.h>
Public Types | |
using | data_type = std::atomic< bool > |
using | int_type = std::vector< data_type >::size_type |
Public Member Functions | |
bitset (int_type bits=8) | |
int_type | bits () const |
size_t | buckets () const |
void | toggle (int_type p) |
Toggle a bit. More... | |
void | set (int_type p) |
Set a bit. More... | |
void | unset (int_type p) |
Unset a bit. More... | |
bool | test (int_type p) const |
Test if a bit is set. More... | |
bool | any (int_type &offset) const |
bool | first (int_type &idx) const |
bool | next (int_type &idx, int_type start=0) const |
std::string | to_string () |
Return a string representation. More... | |
Private Attributes | |
std::vector< data_type > | m_bitset |
int_type | m_bits |
using tasks::tools::bitset::data_type = std::atomic<bool> |
using tasks::tools::bitset::int_type = std::vector<data_type>::size_type |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Find a bit that is set. The full bitset will be searched as worst case.
idx | The index of the first bit is stored to idx. |
start | Uses start as starting point to search. |
Definition at line 84 of file bitset.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |