iceoryx_doc  1.0.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
iox::concurrent::LoFFLi Class Reference

Public Types

using Index_t = uint32_t
 

Public Member Functions

void init (cxx::not_null< Index_t * > freeIndicesMemory, const uint32_t capacity) noexcept
 
bool pop (Index_t &index) noexcept
 
bool push (const Index_t index) noexcept
 

Static Public Member Functions

static constexpr std::size_t requiredIndexMemorySize (const uint32_t capacity) noexcept
 

Member Function Documentation

◆ init()

void iox::concurrent::LoFFLi::init ( cxx::not_null< Index_t * >  freeIndicesMemory,
const uint32_t  capacity 
)
noexcept
Todo:
: why init not in ctor

Initializes the lock-free free-list

Parameters
[in]freeIndicesMemorypointer to a memory with the capacity calculated by requiredMemorySize()
[in]capacityis the number of elements of the free-list; must be the same used at requiredMemorySize()

◆ pop()

bool iox::concurrent::LoFFLi::pop ( Index_t &  index)
noexcept

Pop a value from the free-list

Parameters
[out]indexfor an element to use
Returns
true if index is valid, false otherwise

◆ push()

bool iox::concurrent::LoFFLi::push ( const Index_t  index)
noexcept

Push previously poped element

Parameters
[in]indexto previously poped element
Returns
true if index is valid or not yet pushed, false otherwise

◆ requiredIndexMemorySize()

constexpr std::size_t iox::concurrent::LoFFLi::requiredIndexMemorySize ( const uint32_t  capacity)
inlinestaticconstexprnoexcept

Calculates the required memory size for a free-list

Parameters
[in]capacityis the number of elements of the free-list
Returns
the required memory size for a free-list with the requested capacity

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