|
Open Model Railroad Network (OpenMRN)
|
Abstract class for representing a set of numbered bits that are stored persistently in some backing store. More...
#include <StoredBitSet.hxx>
Public Member Functions | |
| virtual StoredBitSet & | set_bit (unsigned offset, bool value)=0 |
| Sets an individual bit to a specific value. | |
| virtual bool | get_bit (unsigned offset)=0 |
| Retrieves an individual bit. | |
| virtual StoredBitSet & | set_multi (unsigned offset, unsigned size, unsigned value)=0 |
| Sets a block of consecutive bits. | |
| virtual unsigned | get_multi (unsigned offset, unsigned size)=0 |
| Returns a block of consecutive bits as an integer value. | |
| virtual unsigned | size ()=0 |
| virtual void | flush ()=0 |
| Writes the current values to persistent storage. | |
| virtual void | lock_and_flush ()=0 |
| Grabs a lock and writes the current values to persistent storage. | |
Abstract class for representing a set of numbered bits that are stored persistently in some backing store.
Definition at line 47 of file StoredBitSet.hxx.
|
pure virtual |
Writes the current values to persistent storage.
The caller is responsible for locking.
Implemented in EEPROMStoredBitSet< HW >.
|
pure virtual |
Retrieves an individual bit.
| offset | is the bit number to retrieve. |
Implemented in ShadowedStoredBitSet.
|
pure virtual |
Returns a block of consecutive bits as an integer value.
| offset | is the number of the first bit to retrieve. |
| size | is the number of bits to retrieve. |
Implemented in ShadowedStoredBitSet.
|
pure virtual |
Grabs a lock and writes the current values to persistent storage.
Implemented in ShadowedStoredBitSet.
|
pure virtual |
Sets an individual bit to a specific value.
This call is thread-safe.
| offset | is the bit number to set. |
| value | is the new value for that bit. |
Implemented in ShadowedStoredBitSet.
|
pure virtual |
Sets a block of consecutive bits.
This call is thread-safe.
| 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. |
Implemented in ShadowedStoredBitSet.
|
pure virtual |
Implemented in ShadowedStoredBitSet.