Skip to content

iox::concurrent::LoFFLi🔗

Public Types🔗

Name
using uint32_t Index_t

Public Functions🔗

Name
LoFFLi() =default
void init(cxx::not_null< Index_t * > freeIndicesMemory, const uint32_t capacity)
bool pop(Index_t & index)
bool push(const Index_t index)
constexpr std::size_t requiredIndexMemorySize(const uint32_t capacity)

Public Types Documentation🔗

using Index_t🔗

using iox::concurrent::LoFFLi::Index_t =  uint32_t;

Public Functions Documentation🔗

function LoFFLi🔗

LoFFLi() =default

function init🔗

void init(
    cxx::not_null< Index_t * > freeIndicesMemory,
    const uint32_t capacity
)

Parameters:

  • freeIndicesMemory pointer to a memory with the capacity calculated by requiredMemorySize()
  • capacity is the number of elements of the free-list; must be the same used at requiredMemorySize()

Todo: : why init not in ctor

Initializes the lock-free free-list

function pop🔗

bool pop(
    Index_t & index
)

Parameters:

  • index for an element to use

Return: true if index is valid, false otherwise

Pop a value from the free-list

function push🔗

bool push(
    const Index_t index
)

Parameters:

  • index to previously poped element

Return: true if index is valid or not yet pushed, false otherwise

Push previously poped element

function requiredIndexMemorySize🔗

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

Parameters:

  • capacity is the number of elements of the free-list

Return: the required memory size for a free-list with the requested capacity

Calculates the required memory size for a free-list


Updated on 31 May 2022 at 15:29:15 CEST