![]() |
L4Re Operating System Framework
Interface and Usage Documentation
|
Basic bitmap abstraction. More...
#include <bitmap>
Data Structures | |
class | Bit |
A writable bit in a bitmap. More... | |
class | Word |
Helper abstraction for a word contained in the bitmap. More... | |
class | Char |
Helper abstraction for a byte contained in the bitmap. More... |
Public Member Functions | |
void | bit (long bit, bool on) noexcept |
Set the value of bit bit to on. | |
void | clear_bit (long bit) noexcept |
Clear bit bit. | |
void | atomic_clear_bit (long bit) noexcept |
Clear bit bit atomically. | |
word_type | atomic_get_and_clear (long bit) noexcept |
Clear bit bit atomically and return old state. | |
void | set_bit (long bit) noexcept |
Set bit bit. | |
void | atomic_set_bit (long bit) noexcept |
Set bit bit atomically. | |
word_type | atomic_get_and_set (long bit) noexcept |
Set bit bit atomically and return old state. | |
word_type | bit (long bit) const noexcept |
Get the truth value of a bit. | |
word_type | operator[] (long bit) const noexcept |
Get the bit at index bit. | |
Bit | operator[] (long bit) noexcept |
Get the lvalue for the bit at index bit. | |
long | scan_zero (long max_bit, long start_bit=0) const noexcept |
Scan for the first zero bit. |
Protected Types | |
enum | { W_bits = sizeof(word_type) * 8 , C_bits = 8 } |
typedef unsigned long | word_type |
Data type for each element of the bit buffer. |
Static Protected Member Functions | |
static unsigned | word_index (unsigned bit) |
Get the word index for the given bit. | |
static unsigned | bit_index (unsigned bit) |
Get the bit index within word_type for the given bit. |
Protected Attributes | |
word_type * | _bits |
Pointer to the buffer storing the bits. |
Basic bitmap abstraction.
This abstraction keeps a pointer to a memory area that is used as bitmap.
|
protected |
|
inlinenoexcept |
Clear bit bit atomically.
Use this function for multi-threaded access to the bitmap.
bit | The number of the bit to clear. |
Definition at line 269 of file bitmap.
References _bits, bit(), bit_index(), and word_index().
|
inlinenoexcept |
Clear bit bit atomically and return old state.
Use this function for multi-threaded access to the bitmap.
bit | The number of the bit to clear. |
Definition at line 279 of file bitmap.
References _bits, bit(), bit_index(), and word_index().
|
inlinenoexcept |
Set bit bit atomically and return old state.
Use this function for multi-threaded access to the bitmap.
bit | The number of the bit to set. |
Definition at line 308 of file bitmap.
References _bits, bit(), bit_index(), and word_index().
|
inlinenoexcept |
Set bit bit atomically.
Use this function for multi-threaded access to the bitmap.
bit | The number of the bit to set. |
Definition at line 298 of file bitmap.
References _bits, bit(), bit_index(), and word_index().
|
inlinenoexcept |
Get the truth value of a bit.
bit | The number of the bit to read. |
Definition at line 318 of file bitmap.
References _bits, bit(), bit_index(), and word_index().
|
inlinenoexcept |
Set the value of bit bit to on.
bit | The number of the bit. |
on | The boolean value that shall be assigned to the bit. |
Definition at line 251 of file bitmap.
References _bits, bit(), bit_index(), and word_index().
Referenced by atomic_clear_bit(), atomic_get_and_clear(), atomic_get_and_set(), atomic_set_bit(), bit(), bit(), bit_index(), clear_bit(), operator[](), operator[](), set_bit(), and word_index().
|
inlinestaticprotected |
Get the bit index within word_type for the given bit.
bit | The bit index in the bitmap. |
Definition at line 53 of file bitmap.
Referenced by atomic_clear_bit(), atomic_get_and_clear(), atomic_get_and_set(), atomic_set_bit(), bit(), bit(), clear_bit(), and set_bit().
|
inlinenoexcept |
Clear bit bit.
bit | The number of the bit to clear. |
Definition at line 260 of file bitmap.
References _bits, bit(), bit_index(), and word_index().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Scan for the first zero bit.
max_bit | Upper bound (exclusive) for the scanning operation. |
start_bit | Hint at the number of the first bit to look at. Zero bits below start_bit may or may not be taken into account by the implementation. |
>= | 0 Number of first zero bit found. |
-1 | All bits between start_bit and max_bit are set. |
Definition at line 339 of file bitmap.
References _bits, W_bits, and word_index().
Referenced by cxx::Bitmap< BITS >::scan_zero().
|
inlinenoexcept |
Set bit bit.
bit | The number of the bit to set. |
Definition at line 289 of file bitmap.
References _bits, bit(), bit_index(), and word_index().
|
inlinestaticprotected |
Get the word index for the given bit.
bit | The index of the bit in question. |
Definition at line 44 of file bitmap.
Referenced by atomic_clear_bit(), atomic_get_and_clear(), atomic_get_and_set(), atomic_set_bit(), bit(), bit(), clear_bit(), scan_zero(), and set_bit().