|
| StoredBitSet & | set_bit (unsigned offset, bool value) override |
| | Sets an individual bit to a specific value.
|
| |
| bool | get_bit (unsigned offset) override |
| | Retrieves an individual bit.
|
| |
| StoredBitSet & | set_multi (unsigned offset, unsigned size, unsigned value) override |
| | Sets a block of consecutive bits.
|
| |
| unsigned | get_multi (unsigned offset, unsigned size) override |
| | Returns a block of consecutive bits as an integer value.
|
| |
| unsigned | size () override |
| |
| void | lock_and_flush () override |
| | Grabs a lock and writes the current values to persistent storage.
|
| |
| virtual void | flush ()=0 |
| | Writes the current values to persistent storage.
|
| |
|
| typedef uint8_t | cell_offs_t |
| | Type indexing cells. Must be an unsigned type.
|
| |
| typedef unsigned | bit_offs_t |
| | Type indexing all bits.
|
| |
Definition at line 91 of file StoredBitSet.hxx.
◆ bit_offs_t
◆ cell_offs_t
Type indexing cells. Must be an unsigned type.
Definition at line 215 of file StoredBitSet.hxx.
◆ ShadowedStoredBitSet()
| ShadowedStoredBitSet::ShadowedStoredBitSet |
( |
unsigned |
size, |
|
|
uint8_t |
granularity |
|
) |
| |
|
inlineprotected |
- Parameters
-
| size | is the total number of bits we store. |
| granularity | tells how many bits fit into a single cell. The base class will then keep track of dirty cells. |
Definition at line 198 of file StoredBitSet.hxx.
◆ ~ShadowedStoredBitSet()
| ShadowedStoredBitSet::~ShadowedStoredBitSet |
( |
| ) |
|
|
inlineprotected |
◆ clear_dirty()
| void ShadowedStoredBitSet::clear_dirty |
( |
cell_offs_t |
cell | ) |
|
|
inlineprotected |
Clears the dirty bit for a given cell.
- Parameters
-
Definition at line 254 of file StoredBitSet.hxx.
◆ dirty_size_uint32()
| unsigned ShadowedStoredBitSet::dirty_size_uint32 |
( |
| ) |
|
|
inlineprivate |
- Returns
- how many uint32 are there in the dirty_ array.
Definition at line 276 of file StoredBitSet.hxx.
◆ get_bit()
| bool ShadowedStoredBitSet::get_bit |
( |
unsigned |
offset | ) |
|
|
inlineoverridevirtual |
Retrieves an individual bit.
- Parameters
-
| offset | is the bit number to retrieve. |
- Returns
- the last set bit value.
Implements StoredBitSet.
Definition at line 113 of file StoredBitSet.hxx.
◆ get_multi()
| unsigned ShadowedStoredBitSet::get_multi |
( |
unsigned |
offset, |
|
|
unsigned |
size |
|
) |
| |
|
inlineoverridevirtual |
Returns a block of consecutive bits as an integer value.
- Parameters
-
| offset | is the number of the first bit to retrieve. |
| size | is the number of bits to retrieve. |
- Returns
- the unsigned value that the last set bits represent, with LSB-first (bit 0 will be from offset; bit 1 will be from offset + 1, etc.)
Implements StoredBitSet.
Definition at line 170 of file StoredBitSet.hxx.
◆ is_dirty()
- Returns
- true if the given cell is dirty.
- Parameters
-
Definition at line 264 of file StoredBitSet.hxx.
◆ lock_and_flush()
| void ShadowedStoredBitSet::lock_and_flush |
( |
| ) |
|
|
inlineoverridevirtual |
◆ next_dirty()
- Returns
- the cell number of the next dirty cell, or NO_CELL if nothing is dirty anymore.
Definition at line 223 of file StoredBitSet.hxx.
◆ num_cells()
- Returns
- how many cells we have, each with granularity_ bits stored.
Definition at line 270 of file StoredBitSet.hxx.
◆ set_bit()
Sets an individual bit to a specific value.
This call is thread-safe.
- Parameters
-
| offset | is the bit number to set. |
| value | is the new value for that bit. |
- Returns
- *this.
Implements StoredBitSet.
Definition at line 94 of file StoredBitSet.hxx.
◆ set_multi()
| StoredBitSet & ShadowedStoredBitSet::set_multi |
( |
unsigned |
offset, |
|
|
unsigned |
size, |
|
|
unsigned |
value |
|
) |
| |
|
inlineoverridevirtual |
Sets a block of consecutive bits.
This call is thread-safe.
- Parameters
-
| offset | is the number of the first bit to set. |
| size | is the number of bits to set. |
| value | contains the data to write, LSB (bit 0) goes to "offset", bit 1 goes to offset + 1, etc.; bits at and above size are checked to be zero. |
- Returns
- *this.
Implements StoredBitSet.
Definition at line 118 of file StoredBitSet.hxx.
◆ size()
| unsigned ShadowedStoredBitSet::size |
( |
| ) |
|
|
inlineoverridevirtual |
◆ update_dirty_bounds()
| void ShadowedStoredBitSet::update_dirty_bounds |
( |
cell_offs_t |
d | ) |
|
|
inlineprivate |
updates lowestDirty_ and highestDirty_ for a given cell.
- Parameters
-
| d | cell offset to set dirty |
Definition at line 282 of file StoredBitSet.hxx.
◆ dirty_
| uint32_t* ShadowedStoredBitSet::dirty_ |
|
private |
Bit set telling whether the individual cells are dirty or not (i.e.
need to be flushed). LSB-first in the individual bits, i.e. bit 1 of entry 2 means that the cell numbered (2*32 + 1) is dirty.
Definition at line 313 of file StoredBitSet.hxx.
◆ granularity_
| const uint8_t ShadowedStoredBitSet::granularity_ |
|
private |
◆ highestDirty_
◆ lowestDirty_
| cell_offs_t ShadowedStoredBitSet::lowestDirty_ {NO_CELL} |
|
private |
Helper values for iterating over the dirty bits.
Definition at line 305 of file StoredBitSet.hxx.
◆ NO_CELL
◆ shadow_
| uint32_t* ShadowedStoredBitSet::shadow_ |
|
private |
Data of the actual bits. length is size_ / 32 rounded up.
Definition at line 309 of file StoredBitSet.hxx.
◆ size_
| const unsigned ShadowedStoredBitSet::size_ |
|
private |
The documentation for this class was generated from the following file: