|
BitMagic-C++
|
Visitor calss for bm::for_each_bit() algorithm It is NOT a classic functor (with function call operator() overload) For efficiency it needs to support two methods: add_bits and add_range which corresponds to different internal methods of representation of sets in the bm::bvector<> (bit-stream and D-GAP/RLE representation). More...
Public Types | |
| using | size_type = bm::bvector<>::size_type |
Public Member Functions | |
| int | add_bits (size_type offset, const unsigned char *bits, unsigned size) |
| Decoded bits callback. | |
| int | add_range (size_type offset, size_type size) |
| Decoded range callback. | |
Data Fields | |
| unsigned | cnt = 0 |
Visitor calss for bm::for_each_bit() algorithm It is NOT a classic functor (with function call operator() overload) For efficiency it needs to support two methods: add_bits and add_range which corresponds to different internal methods of representation of sets in the bm::bvector<> (bit-stream and D-GAP/RLE representation).
This method somewhat exposes internals and requires writing a custom object, but it is also the fastest method, used inside BitMagic library a lot.
Definition at line 75 of file sample25.cpp.
| using bit_visitor_functor::size_type = bm::bvector<>::size_type |
Definition at line 77 of file sample25.cpp.
|
inline |
Decoded bits callback.
| offset | - index offset in the bit-vector (decoding address context) |
| bits | - array of set bit indexes within the address context offset + bits[i] gives us global index in the bit_vector |
| size | - number of decoded bits (size of bits array) |
Definition at line 86 of file sample25.cpp.
References cnt.
Decoded range callback.
| offset | - index offset in the bit-vector (decoding address context) |
| size | - number of consequitive ON bits (size of bits array) |
Definition at line 106 of file sample25.cpp.
References cnt.
| unsigned bit_visitor_functor::cnt = 0 |
Definition at line 117 of file sample25.cpp.
Referenced by add_bits(), and add_range().