Safe DDS
eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS > Class Template Reference

Template class to hold a bitmap and its memory. More...

#include <BitmapSet.hpp>

Public Types

using ExposedBitmapFunctionality = BitmapFunctionality< T, BitmapHelper, NBITS >
 Exposed BitmapFunctionality alias. More...
 
using InnerBitmap = Bitmap< T, ExposedBitmapFunctionality::NITEMS >
 Inner bitmap alias. More...
 

Public Member Functions

 BitmapSet () noexcept
 Default constructor. More...
 
 BitmapSet (const Bitmap< T, ExposedBitmapFunctionality::NITEMS > &bitmap) noexcept
 Constructor from a bitmap. More...
 
virtual ~BitmapSet () noexcept=default
 Default destructor. More...
 
 BitmapSet (const BitmapSet &other) noexcept
 Copy allowed. More...
 
 BitmapSet (const BitmapSet &&other) noexcept
 Movement allowed. More...
 
BitmapSetoperator= (const BitmapSet &other) noexcept=default
 Default copy operator allowed. More...
 
BitmapSetoperator= (BitmapSet &&other) &noexcept=default
 Default movement operator allowed. More...
 
Bitmap< T > get_bitmap () const noexcept override
 Copy the Bitmap contents of this map into another Bitmap instance. More...
 
base () const noexcept override
 Get base of the bitmap. More...
 
void add_range (const T &from, const T &to) noexcept
 Add a range of items to the bitmap. More...
 
void add (const T &item) noexcept
 Add an item to the bitmap. More...
 
void base_update (const T &new_base) noexcept
 Set a new base for the range, keeping old values where possible. More...
 
void base (const T &new_base) noexcept
 Set a new base for the range. More...
 
uint32_t count () const noexcept override
 Counts the number of bits set in the bitmap. More...
 
bool empty () const noexcept override
 Check if the bitmap is empty. More...
 
bool is_set (const T &item) const noexcept override
 Check if an item is set in the bitmap. More...
 
ReturnCode max (T &result) const noexcept override
 Get the maximum value in the bitmap. More...
 
void merge (const Bitmap< T, ExposedBitmapFunctionality::NITEMS > &bitmap) noexcept
 Merge two bitmaps. More...
 
ReturnCode min_max (T &min_value, T &max_value) const noexcept override
 Get the minimum and maximum values in the bitmap. More...
 
ReturnCode min (T &result) const noexcept override
 Get the minimum value in the bitmap. More...
 
void remove_all () noexcept override
 Removes all elements from the bitmap. More...
 
void remove_range (const T &from, const T &to) noexcept override
 Removes a set of consecutive elements from the bitmap. More...
 
void remove (const T &item) noexcept override
 Removes an element from the bitmap. More...
 

Additional Inherited Members

- Protected Member Functions inherited from eprosima::safedds::memory::IRemovableBitmapSet< T >
 ~IRemovableBitmapSet () noexcept=default
 Protected destructor ownership defined on creation. More...
 
 IRemovableBitmapSet () noexcept=default
 Default creation. More...
 
 IRemovableBitmapSet (const IRemovableBitmapSet &) noexcept=default
 Copy allowed. More...
 
 IRemovableBitmapSet (IRemovableBitmapSet &&) noexcept=default
 Movement allowed. More...
 
IRemovableBitmapSetoperator= (const IRemovableBitmapSet &) noexcept=default
 Copy operator allowed. More...
 
IRemovableBitmapSetoperator= (IRemovableBitmapSet &&) noexcept=default
 Movement operator allowed. More...
 
- Protected Member Functions inherited from eprosima::safedds::memory::IBaseBitmapSet< T >
 ~IBaseBitmapSet () noexcept=default
 Protected destructor ownership defined on creation. More...
 
 IBaseBitmapSet () noexcept=default
 Default creation. More...
 
 IBaseBitmapSet (const IBaseBitmapSet &) noexcept=default
 Copy allowed. More...
 
 IBaseBitmapSet (IBaseBitmapSet &&) noexcept=default
 Movement allowed. More...
 
IBaseBitmapSetoperator= (const IBaseBitmapSet &) noexcept=default
 Copy operator allowed. More...
 
IBaseBitmapSetoperator= (IBaseBitmapSet &&) noexcept=default
 Movement operator allowed. More...
 

Detailed Description

template<class T, typename BitmapHelper, uint32_t NBITS = BITMAP_BIT_SIZE>
class eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >

Template class to hold a bitmap and its memory.

Member Typedef Documentation

◆ ExposedBitmapFunctionality

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
using eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::ExposedBitmapFunctionality = BitmapFunctionality<T, BitmapHelper, NBITS>

Exposed BitmapFunctionality alias.

◆ InnerBitmap

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
using eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::InnerBitmap = Bitmap<T, ExposedBitmapFunctionality::NITEMS>

Inner bitmap alias.

Constructor & Destructor Documentation

◆ BitmapSet() [1/4]

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::BitmapSet ( )
inlinenoexcept

Default constructor.

◆ BitmapSet() [2/4]

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::BitmapSet ( const Bitmap< T, ExposedBitmapFunctionality::NITEMS > &  bitmap)
inlineexplicitnoexcept

Constructor from a bitmap.

Parameters
bitmapinput bitmap.

◆ ~BitmapSet()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
virtual eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::~BitmapSet ( )
virtualdefaultnoexcept

Default destructor.

◆ BitmapSet() [3/4]

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::BitmapSet ( const BitmapSet< T, BitmapHelper, NBITS > &  other)
inlinenoexcept

Copy allowed.

Parameters
otherother bitmap.

◆ BitmapSet() [4/4]

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::BitmapSet ( const BitmapSet< T, BitmapHelper, NBITS > &&  other)
inlinenoexcept

Movement allowed.

Parameters
otherother bitmap.

Member Function Documentation

◆ add()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
void eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::add ( const T &  item)
inlinenoexcept

Add an item to the bitmap.

Note
Expose BitmapFunctionality::add
Parameters
itemValue to add.

◆ add_range()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
void eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::add_range ( const T &  from,
const T &  to 
)
inlinenoexcept

Add a range of items to the bitmap.

Note
Expose BitmapFunctionality::add_range
Parameters
fromStarting value of the range to add (Will be added).
toEnding value of the range to add.

◆ base() [1/2]

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
T eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::base ( ) const
inlineoverridevirtualnoexcept

Get base of the bitmap.

Returns
a copy of the bitmap base.

Implements eprosima::safedds::memory::IBaseBitmapSet< T >.

◆ base() [2/2]

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
void eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::base ( const T &  new_base)
inlinenoexcept

Set a new base for the range.

This method resets the bitmap and sets a new value for its base.

Note
Expose BitmapFunctionality::base
Parameters
new_baseNew base value to set.

◆ base_update()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
void eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::base_update ( const T &  new_base)
inlinenoexcept

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.

Note
Expose BitmapFunctionality::base_update
Parameters
new_baseNew base value to set.

◆ count()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
uint32_t eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::count ( ) const
inlineoverridevirtualnoexcept

Counts the number of bits set in the bitmap.

Note
Expose BitmapFunctionality::count
Returns
uint32_t Number of bits set in the bitmap.

Implements eprosima::safedds::memory::IBaseBitmapSet< T >.

◆ empty()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
bool eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::empty ( ) const
inlineoverridevirtualnoexcept

Check if the bitmap is empty.

Note
IBaseBitmapSet interface. Expose BitmapFunctionality::empty
Returns
true if the bitmap is empty, false otherwise.

Implements eprosima::safedds::memory::IBaseBitmapSet< T >.

◆ get_bitmap()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
Bitmap<T> eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::get_bitmap ( ) const
inlineoverridevirtualnoexcept

Copy the Bitmap contents of this map into another Bitmap instance.

Returns
A copy of the Bitmap.

Implements eprosima::safedds::memory::IBaseBitmapSet< T >.

◆ is_set()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
bool eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::is_set ( const T &  item) const
inlineoverridevirtualnoexcept

Check if an item is set in the bitmap.

Note
IBaseBitmapSet interface. Expose BitmapFunctionality::is_set
Parameters
itemValue to check.
Returns
true if the item is set, false otherwise.

Implements eprosima::safedds::memory::IBaseBitmapSet< T >.

◆ max()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
ReturnCode eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::max ( T &  result) const
inlineoverridevirtualnoexcept

Get the maximum value in the bitmap.

Note
IBaseBitmapSet interface. Expose BitmapFunctionality::max
Parameters
resultMaximum value in the bitmap.
Returns
ReturnCode::OK if the maximum value is found, ReturnCode::CONTAINER_BITMAP_IS_EMPTY otherwise.

Implements eprosima::safedds::memory::IBaseBitmapSet< T >.

◆ merge()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
void eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::merge ( const Bitmap< T, ExposedBitmapFunctionality::NITEMS > &  bitmap)
inlinenoexcept

Merge two bitmaps.

Note
Expose BitmapFunctionality::merge
Parameters
bitmapBitmap to merge into.

◆ min()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
ReturnCode eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::min ( T &  result) const
inlineoverridevirtualnoexcept

Get the minimum value in the bitmap.

Note
IBaseBitmapSet interface. Expose BitmapFunctionality::min
Parameters
resultMinimum value in the bitmap.
Returns
ReturnCode::OK if the minimum value is found, ReturnCode::CONTAINER_BITMAP_IS_EMPTY otherwise.

Implements eprosima::safedds::memory::IBaseBitmapSet< T >.

◆ min_max()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
ReturnCode eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::min_max ( T &  min_value,
T &  max_value 
) const
inlineoverridevirtualnoexcept

Get the minimum and maximum values in the bitmap.

Note
IBaseBitmapSet interface. Expose BitmapFunctionality::min_max
Parameters
min_valueMinimum value in the bitmap.
max_valueMaximum value in the bitmap.
Returns
ReturnCode::OK if the minimum and maximum values are found, ReturnCode::CONTAINER_BITMAP_IS_EMPTY otherwise.

Implements eprosima::safedds::memory::IBaseBitmapSet< T >.

◆ operator=() [1/2]

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
BitmapSet& eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::operator= ( BitmapSet< T, BitmapHelper, NBITS > &&  other) &
defaultnoexcept

Default movement operator allowed.

Parameters
otherother bitmap.
Returns
BitmapSet&.

◆ operator=() [2/2]

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
BitmapSet& eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::operator= ( const BitmapSet< T, BitmapHelper, NBITS > &  other)
defaultnoexcept

Default copy operator allowed.

Parameters
otherother bitmap.
Returns
BitmapSet&.

◆ remove()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
void eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::remove ( const T &  item)
inlineoverridevirtualnoexcept

Removes an element from the bitmap.

Note
IRemovableBitmapSet interface. Expose BitmapFunctionality::remove
Parameters
itemValue to be removed.

Implements eprosima::safedds::memory::IRemovableBitmapSet< T >.

◆ remove_all()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
void eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::remove_all ( )
inlineoverridevirtualnoexcept

Removes all elements from the bitmap.

Note
IRemovableBitmapSet interface. Expose BitmapFunctionality::remove_all

Implements eprosima::safedds::memory::IRemovableBitmapSet< T >.

◆ remove_range()

template<class T , typename BitmapHelper , uint32_t NBITS = BITMAP_BIT_SIZE>
void eprosima::safedds::memory::container::BitmapSet< T, BitmapHelper, NBITS >::remove_range ( const T &  from,
const T &  to 
)
inlineoverridevirtualnoexcept

Removes a set of consecutive elements from the bitmap.

Note
IRemovableBitmapSet interface. Expose BitmapFunctionality::remove_range
Parameters
fromStarting value of the range to remove (Will be removed).
toEnding value of the range to remove.

Implements eprosima::safedds::memory::IRemovableBitmapSet< T >.


The documentation for this class was generated from the following file: