Class MemPoolCollectionMemoryBlock
Defined in File mempool_collection_memory_block.hpp
Inheritance Relationships
Base Type
public iox::roudi::MemoryBlock(Class MemoryBlock)
Class Documentation
-
class MemPoolCollectionMemoryBlock : public iox::roudi::MemoryBlock
The MemPoolCollectionMemoryBlock is an implementation of a MemoryBlock for a MemPool MemoryManager.
Public Functions
-
MemPoolCollectionMemoryBlock(const mepoo::MePooConfig &memPoolConfig) noexcept
-
~MemPoolCollectionMemoryBlock() noexcept
-
MemPoolCollectionMemoryBlock(const MemPoolCollectionMemoryBlock&) = delete
-
MemPoolCollectionMemoryBlock(MemPoolCollectionMemoryBlock&&) = delete
-
MemPoolCollectionMemoryBlock &operator=(const MemPoolCollectionMemoryBlock&) = delete
-
MemPoolCollectionMemoryBlock &operator=(MemPoolCollectionMemoryBlock&&) = delete
-
virtual uint64_t size() const noexcept override
This function provides the size of the required memory for the underlying data. It is needed for the MemoryProvider to calculate the total size of memory.
Note
The size for all the MemPools
- Returns:
the required memory as multiple of the alignment
-
virtual uint64_t alignment() const noexcept override
This function provides the alignment of the memory for the underlying data. This information is needed for the MemoryProvider.
Note
The memory alignment for the MemPools
- Returns:
the alignment of the underlying data.
-
cxx::optional<mepoo::MemoryManager*> memoryManager() const noexcept
This function enables the access to the MemoryManager for the MemPools.
- Returns:
an optional pointer to the underlying type, cxx::nullopt_t if value is not initialized
Protected Functions
-
virtual void onMemoryAvailable(cxx::not_null<void*> memory) noexcept override
This function is called once the memory is available and is therefore the earliest possibility to use the memory.
Note
This will create the MemPools at the location
memorypoints to- Parameters:
memory – [in] pointer to a valid memory block, the same one that the memory() member function would return
-
virtual void destroy() noexcept override
The MemoryProvider calls this either when MemoryProvider::destroy is called or in its destructor.
Note
This function can be called multiple times. Make sure that the implementation can handle this.
Note
This will clean up the MemPools
-
MemPoolCollectionMemoryBlock(const mepoo::MePooConfig &memPoolConfig) noexcept