Skip to content

iox::roudi::GenericMemoryBlock🔗

The GenericMemoryBlock is an implementation of a MemoryBlock for a common use case. More...

#include <generic_memory_block.hpp>

Inherits from iox::roudi::MemoryBlock

Public Functions🔗

Name
GenericMemoryBlock() =default
~GenericMemoryBlock()
GenericMemoryBlock(const GenericMemoryBlock & )
GenericMemoryBlock(GenericMemoryBlock && )
GenericMemoryBlock & operator=(const GenericMemoryBlock & )
GenericMemoryBlock & operator=(GenericMemoryBlock && )
virtual uint64_t size() const override
Implementation of MemoryBlock::size.
virtual uint64_t alignment() const override
Implementation of MemoryBlock::alignment.
virtual void destroy() override
Implementation of MemoryBlock::destroy.
template \<typename... Targs>
cxx::optional< T * >
emplace(Targs &&... args)
A new element is constructed by forwarding the arguments to the constructor of T. If the MemoryBlock has a value then the destructor of T is called.
cxx::optional< T * > value() const
This function enables the access to the underlying type.

Friends🔗

Name
class MemoryProvider

Additional inherited members🔗

Public Functions inherited from iox::roudi::MemoryBlock

Name
MemoryBlock() =default
MemoryBlock(const MemoryBlock & )
MemoryBlock(MemoryBlock && )
virtual void memoryAvailable(void * memory)
This function is called once the memory is available and is therefore the earliest possibility to use the memory.
cxx::optional< void * > memory() const
This function provides the pointer to the requested memory.

Detailed Description🔗

template <typename T >
class iox::roudi::GenericMemoryBlock;

The GenericMemoryBlock is an implementation of a MemoryBlock for a common use case.

Public Functions Documentation🔗

function GenericMemoryBlock🔗

GenericMemoryBlock() =default

function ~GenericMemoryBlock🔗

~GenericMemoryBlock()

function GenericMemoryBlock🔗

GenericMemoryBlock(
    const GenericMemoryBlock & 
)

function GenericMemoryBlock🔗

GenericMemoryBlock(
    GenericMemoryBlock && 
)

function operator=🔗

GenericMemoryBlock & operator=(
    const GenericMemoryBlock & 
)

function operator=🔗

GenericMemoryBlock & operator=(
    GenericMemoryBlock && 
)

function size🔗

virtual uint64_t size() const override

Implementation of MemoryBlock::size.

Return: the size of type T

Reimplements: iox::roudi::MemoryBlock::size

function alignment🔗

virtual uint64_t alignment() const override

Implementation of MemoryBlock::alignment.

Return: the alignment of type T

Reimplements: iox::roudi::MemoryBlock::alignment

function destroy🔗

virtual void destroy() override

Implementation of MemoryBlock::destroy.

Reimplements: iox::roudi::MemoryBlock::destroy

function emplace🔗

template <typename... Targs>
cxx::optional< T * > emplace(
    Targs &&... args
)

A new element is constructed by forwarding the arguments to the constructor of T. If the MemoryBlock has a value then the destructor of T is called.

Parameters:

  • args are perfectly forwarded to the constructor of T to perform a placement new

Return: an optional pointer to the underlying type, cxx::nullopt_t if memory was not yet available

function value🔗

cxx::optional< T * > value() const

This function enables the access to the underlying type.

Return: an optional pointer to the underlying type, cxx::nullopt_t if value is not initialized

Friends🔗

friend MemoryProvider🔗

friend class MemoryProvider;

Updated on 17 June 2021 at 11:15:27 CEST