|
Safe DDS
|
Template class to provide a set of utils for bitmaps. More...
#include <BitmapFunctionality.hpp>
Public Types | |
| using | bitmap_type = Array< uint32_t, NITEMS > |
| Alias to improve readability. More... | |
Static Public Member Functions | |
| static bool | empty (const Bitmap< T, NITEMS > &bitmap) noexcept |
| Check if the bitmap is empty. More... | |
| static ReturnCode | max (const Bitmap< T, NITEMS > &bitmap, T &result) noexcept |
| Get the maximum value in the bitmap. More... | |
| static ReturnCode | min (const Bitmap< T, NITEMS > &bitmap, T &result) noexcept |
| Get the minimum value in the bitmap. More... | |
| static ReturnCode | min_max (const Bitmap< T, NITEMS > &bitmap, T &min_value, T &max_value) noexcept |
| Get the minimum and maximum values in the bitmap. More... | |
| static bool | is_set (const Bitmap< T, NITEMS > &bitmap, const T &item) noexcept |
| Check if an item is set in the bitmap. More... | |
| static void | add (Bitmap< T, NITEMS > &bitmap, const T &item) noexcept |
| Add an item to the bitmap. More... | |
| static void | add_range (Bitmap< T, NITEMS > &bitmap, const T &from, const T &to) noexcept |
| Add a range of items to the bitmap. More... | |
| static void | merge (Bitmap< T, NITEMS > &bitmap_merged, const Bitmap< T, NITEMS > &bitmap) noexcept |
| Merge two bitmaps. More... | |
| static void | remove (Bitmap< T, NITEMS > &bitmap, const T &item) noexcept |
| Removes an element from the bitmap. More... | |
| static void | remove_all (Bitmap< T, NITEMS > &bitmap) noexcept |
| Removes all elements from the bitmap. More... | |
| static void | remove_range (Bitmap< T, NITEMS > &bitmap, const T &from, const T &to) noexcept |
| Removes a set of consecutive elements from the bitmap. More... | |
| static void | base (Bitmap< T, NITEMS > &bitmap, const T &new_base) noexcept |
| Set a new base for the range. More... | |
| static void | base_update (Bitmap< T, NITEMS > &bitmap, const T &new_base) noexcept |
| Set a new base for the range, keeping old values where possible. More... | |
| static uint32_t | count (const Bitmap< T, NITEMS > &bitmap) noexcept |
| Counts the number of bits set in the bitmap. More... | |
Static Public Attributes | |
| static const uint32_t | NITEMS = (NBITS + portable::BITS_IN_LONG - 1) / portable::BITS_IN_LONG |
| Number of items. More... | |
Template class to provide a set of utils for bitmaps.
| using eprosima::safedds::memory::container::BitmapFunctionality< T, BitmapHelper, NBITS >::bitmap_type = Array<uint32_t, NITEMS> |
Alias to improve readability.
|
inlinestaticnoexcept |
Add an item to the bitmap.
| bitmap | Bitmap to modify. |
| item | Value to add. |
|
inlinestaticnoexcept |
Add a range of items to the bitmap.
| bitmap | Bitmap to modify. |
| from | Starting value of the range to add (Will be added). |
| to | Ending value of the range to add. |
|
inlinestaticnoexcept |
Set a new base for the range.
This method resets the bitmap and sets a new value for its base.
| bitmap | Bitmap to modify. |
| new_base | New base value to set. |
|
inlinestaticnoexcept |
Set a new base for the range, keeping old values where possible.
This method implements a sliding window mechanism for changing the base of the range.
| bitmap | Bitmap to modify. |
| new_base | New base value to set. |
|
inlinestaticnoexcept |
Counts the number of bits set in the bitmap.
| bitmap | Bitmap to count. |
|
inlinestaticnoexcept |
Check if the bitmap is empty.
| bitmap | Bitmap to check. |
|
inlinestaticnoexcept |
Check if an item is set in the bitmap.
| bitmap | Bitmap to check. |
| item | Value to check. |
|
inlinestaticnoexcept |
Get the maximum value in the bitmap.
| bitmap | Bitmap to check. |
| result | Maximum value in the bitmap. |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
Get the minimum value in the bitmap.
| bitmap | Bitmap to check. |
| result | Minimum value in the bitmap. |
|
inlinestaticnoexcept |
Get the minimum and maximum values in the bitmap.
| bitmap | Bitmap to check. |
| min_value | Minimum value in the bitmap. |
| max_value | Maximum value in the bitmap. |
|
inlinestaticnoexcept |
Removes an element from the bitmap.
| bitmap | Bitmap to remove the element from. |
| item | Value to be removed. |
|
inlinestaticnoexcept |
Removes all elements from the bitmap.
| bitmap | Bitmap to remove all elements from. |
|
inlinestaticnoexcept |
Removes a set of consecutive elements from the bitmap.
Removes all elements in the [from, to) range. Equivalent to for(T i = from; i < to; i++) remove(i);
| bitmap | Bitmap to remove the range from. |
| from | Starting value of the range to remove (Will be removed). |
| to | Ending value of the range to remove. |
|
static |
Number of items.