container of bits
More...
#include <MRBitSet.h>
|
using | base = boost::dynamic_bitset<std::uint64_t> |
|
using | IndexType = size_t |
|
|
| BitSet (size_t numBits, bool fillValue) |
| creates bitset of given size filled with given value
|
|
bool | test (IndexType n) const |
|
bool | test_set (IndexType n, bool val=true) |
|
BitSet & | set (IndexType n, size_type len, bool val) |
|
BitSet & | set (IndexType n, bool val=true) |
|
BitSet & | set () |
|
BitSet & | reset (IndexType n, size_type len) |
|
BitSet & | reset (IndexType n) |
|
BitSet & | reset () |
|
BitSet & | flip (IndexType n, size_type len) |
|
BitSet & | flip (IndexType n) |
|
BitSet & | flip () |
|
MRMESH_API BitSet & | operator&= (const BitSet &b) |
|
MRMESH_API BitSet & | operator|= (const BitSet &b) |
|
MRMESH_API BitSet & | operator^= (const BitSet &b) |
|
MRMESH_API BitSet & | operator-= (const BitSet &b) |
|
MRMESH_API BitSet & | subtract (const BitSet &b, int bShiftInBlocks) |
| subtracts b from this, considering that bits in b are shifted right on bShiftInBlocks*bits_per_block
|
|
MRMESH_API IndexType | find_last () const |
| return the highest index i such as bit i is set, or npos if *this has no on bits.
|
|
MRMESH_API size_t | nthSetBit (size_t n) const |
| returns the location of nth set bit (where the first bit corresponds to n=0) or npos if there are less bit set
|
|
void | resizeWithReserve (size_t newSize) |
| doubles reserved memory until resize(newSize) can be done without reallocation
|
|
void | autoResizeSet (size_t pos, size_type len, bool val=true) |
| sets elements [pos, pos+len) to given value, adjusting the size of the set to include new elements
|
|
void | autoResizeSet (size_t pos, bool val=true) |
|
bool | autoResizeTestSet (size_t pos, bool val=true) |
| same as autoResizeSet and returns previous value of pos-bit
|
|
size_t | heapBytes () const |
| returns the amount of memory this object occupies on heap
|
|
IndexType | backId () const |
| returns the identifier of the back() element
|
|
IndexType | endId () const |
|
◆ base
◆ IndexType
◆ BitSet()
MR::BitSet::BitSet |
( |
size_t | numBits, |
|
|
bool | fillValue ) |
|
inlineexplicit |
creates bitset of given size filled with given value
◆ autoResizeSet() [1/2]
void MR::BitSet::autoResizeSet |
( |
size_t | pos, |
|
|
bool | val = true ) |
|
inline |
◆ autoResizeSet() [2/2]
void MR::BitSet::autoResizeSet |
( |
size_t | pos, |
|
|
size_type | len, |
|
|
bool | val = true ) |
|
inline |
sets elements [pos, pos+len) to given value, adjusting the size of the set to include new elements
◆ autoResizeTestSet()
bool MR::BitSet::autoResizeTestSet |
( |
size_t | pos, |
|
|
bool | val = true ) |
|
inlinenodiscard |
◆ backId()
returns the identifier of the back() element
◆ beginId()
◆ endId()
◆ find_last()
return the highest index i such as bit i is set, or npos if *this has no on bits.
◆ flip() [1/3]
◆ flip() [2/3]
◆ flip() [3/3]
◆ heapBytes()
size_t MR::BitSet::heapBytes |
( |
| ) |
const |
|
inlinenodiscard |
returns the amount of memory this object occupies on heap
◆ nthSetBit()
MRMESH_API size_t MR::BitSet::nthSetBit |
( |
size_t | n | ) |
const |
|
nodiscard |
returns the location of nth set bit (where the first bit corresponds to n=0) or npos if there are less bit set
◆ operator&=()
◆ operator-=()
◆ operator^=()
◆ operator|=()
◆ reset() [1/3]
BitSet & MR::BitSet::reset |
( |
| ) |
|
|
inline |
◆ reset() [2/3]
◆ reset() [3/3]
◆ resizeWithReserve()
void MR::BitSet::resizeWithReserve |
( |
size_t | newSize | ) |
|
|
inline |
doubles reserved memory until resize(newSize) can be done without reallocation
◆ set() [1/3]
◆ set() [2/3]
◆ set() [3/3]
◆ subtract()
subtracts b from this, considering that bits in b are shifted right on bShiftInBlocks*bits_per_block
◆ test()
◆ test_set()
bool MR::BitSet::test_set |
( |
IndexType | n, |
|
|
bool | val = true ) |
|
inlinenodiscard |
The documentation for this class was generated from the following file: