17#ifndef IOX_POSH_ROUDI_MEMORY_GENERIC_MEMORY_BLOCK_HPP
18#define IOX_POSH_ROUDI_MEMORY_GENERIC_MEMORY_BLOCK_HPP
20#include "iceoryx_posh/roudi/memory/memory_block.hpp"
22#include "iceoryx_hoofs/cxx/optional.hpp"
32class GenericMemoryBlock final :
public MemoryBlock
34 friend class MemoryProvider;
37 GenericMemoryBlock()
noexcept =
default;
38 ~GenericMemoryBlock()
noexcept;
40 GenericMemoryBlock(
const GenericMemoryBlock&) =
delete;
41 GenericMemoryBlock(GenericMemoryBlock&&) =
delete;
42 GenericMemoryBlock& operator=(
const GenericMemoryBlock&) =
delete;
43 GenericMemoryBlock& operator=(GenericMemoryBlock&&) =
delete;
47 uint64_t
size() const noexcept override;
57 template <typename... Targs>
58 cxx::optional<T*>
emplace(Targs&&... args) noexcept;
62 cxx::optional<T*>
value() const noexcept;
76#include "iceoryx_posh/internal/roudi/memory/generic_memory_block.inl"
cxx::optional< T * > emplace(Targs &&... args) noexcept
A new element is constructed by forwarding the arguments to the constructor of T. If the MemoryBlock ...
uint64_t size() const noexcept override
This function provides the size of the required memory for the underlying data. It is needed for the ...
uint64_t alignment() const noexcept override
This function provides the alignment of the memory for the underlying data. This information is neede...
void destroy() noexcept override
The MemoryProvider calls this either when MemoryProvider::destroy is called or in its destructor.
cxx::optional< T * > value() const noexcept
This function enables the access to the underlying type.
Definition iceoryx_posh_types.hpp:217