iceoryx_doc  1.0.1
Public Member Functions | Friends | List of all members
iox::roudi::GenericMemoryBlock< T > Class Template Referencefinal

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

#include <generic_memory_block.hpp>

Inheritance diagram for iox::roudi::GenericMemoryBlock< T >:
Inheritance graph
[legend]
Collaboration diagram for iox::roudi::GenericMemoryBlock< T >:
Collaboration graph
[legend]

Public Member Functions

 GenericMemoryBlock (const GenericMemoryBlock &)=delete
 
 GenericMemoryBlock (GenericMemoryBlock &&)=delete
 
GenericMemoryBlockoperator= (const GenericMemoryBlock &)=delete
 
GenericMemoryBlockoperator= (GenericMemoryBlock &&)=delete
 
uint64_t size () const noexcept override
 Implementation of MemoryBlock::size. More...
 
uint64_t alignment () const noexcept override
 Implementation of MemoryBlock::alignment. More...
 
void destroy () noexcept override
 Implementation of MemoryBlock::destroy.
 
template<typename... Targs>
cxx::optional< T * > emplace (Targs &&... args) noexcept
 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. More...
 
cxx::optional< T * > value () const noexcept
 This function enables the access to the underlying type. More...
 
- Public Member Functions inherited from iox::roudi::MemoryBlock
 MemoryBlock (const MemoryBlock &)=delete
 
 MemoryBlock (MemoryBlock &&)=delete
 
MemoryBlockoperator= (const MemoryBlock &)=delete
 
MemoryBlockoperator= (MemoryBlock &&)=delete
 
virtual void memoryAvailable (void *memory) noexcept
 This function is called once the memory is available and is therefore the earliest possibility to use the memory. More...
 
cxx::optional< void * > memory () const noexcept
 This function provides the pointer to the requested memory. More...
 

Friends

class MemoryProvider
 

Detailed Description

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

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

Member Function Documentation

◆ alignment()

template<typename T >
uint64_t iox::roudi::GenericMemoryBlock< T >::alignment
overridevirtualnoexcept

Implementation of MemoryBlock::alignment.

Returns
the alignment of type T

Implements iox::roudi::MemoryBlock.

◆ emplace()

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

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
[in]argsare perfectly forwarded to the constructor of T to perform a placement new
Returns
an optional pointer to the underlying type, cxx::nullopt_t if memory was not yet available

◆ size()

template<typename T >
uint64_t iox::roudi::GenericMemoryBlock< T >::size
overridevirtualnoexcept

Implementation of MemoryBlock::size.

Returns
the size of type T

Implements iox::roudi::MemoryBlock.

◆ value()

template<typename T >
cxx::optional< T * > iox::roudi::GenericMemoryBlock< T >::value
noexcept

This function enables the access to the underlying type.

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

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