Simplified split_bitstring algorithm when count is multiple of 8.
More...
#include <cds/algo/split_bitstring.h>
|
|
| byte_splitter (bitstring const &h) |
| | Initializises the splitter with reference to h and zero start bit offset.
|
| |
|
| byte_splitter (bitstring const &h, size_t nBitOffset) |
| | Initializises the splitter with reference to h and start bit offset nBitOffset.
|
| |
|
| operator bool () const |
| | Returns true if end-of-string is not reached yet.
|
| |
|
bool | eos () const |
| | Returns true if end-of-stream encountered.
|
| |
| uint_type | cut (unsigned count) |
| | Cuts next count bits (must be multiplier of 8) from bit-string. More...
|
| |
| uint_type | safe_cut (unsigned count) |
| | Cuts up to count from the bit-string. More...
|
| |
|
void | reset () noexcept |
| | Resets the splitter.
|
| |
|
bitstring const * | source () const |
| | Returns pointer to source bitstring.
|
| |
|
size_t | bit_offset () const |
| | Returns current bit offset from beginning of bit-string.
|
| |
|
size_t | rest_count () const |
| | Returns how many bits remain.
|
| |
|
|
static constexpr bool | is_correct (unsigned count) |
| | Checks if count is multiple of 8.
|
| |
|
|
static constexpr size_t const | c_bitstring_size = BitStringSize ? BitStringSize : sizeof( BitString ) |
| | size of BitString in bytes
|
| |
template<typename BitString, size_t BitStringSize = sizeof( BitString ), typename UInt = unsigned>
class cds::algo::byte_splitter< BitString, BitStringSize, UInt >
Simplified split_bitstring algorithm when count is multiple of 8.
◆ cut()
template<typename BitString , size_t BitStringSize = sizeof( BitString ), typename UInt = unsigned>
Cuts next count bits (must be multiplier of 8) from bit-string.
For performance reason, the function does not manage out-of-bound condition. To control that use safe_cut().
◆ safe_cut()
template<typename BitString , size_t BitStringSize = sizeof( BitString ), typename UInt = unsigned>
Cuts up to count from the bit-string.
Safe analog of cut(): if count is more than the rest of bit-string, only the rest is returned. When eos() condition is met the function returns 0.
The documentation for this class was generated from the following file:
- cds/algo/split_bitstring.h