17 #ifndef IOX_POSH_MEPOO_TYPED_MEM_POOL_HPP
18 #define IOX_POSH_MEPOO_TYPED_MEM_POOL_HPP
20 #include "iceoryx_posh/iceoryx_posh_types.hpp"
21 #include "iceoryx_posh/internal/mepoo/chunk_management.hpp"
22 #include "iceoryx_posh/internal/mepoo/mem_pool.hpp"
23 #include "iceoryx_posh/internal/mepoo/memory_manager.hpp"
24 #include "iceoryx_posh/internal/mepoo/shared_pointer.hpp"
25 #include "iceoryx_utils/cxx/expected.hpp"
26 #include "iceoryx_utils/cxx/helplets.hpp"
27 #include "iceoryx_utils/cxx/optional.hpp"
28 #include "iceoryx_utils/cxx/variant.hpp"
29 #include "iceoryx_utils/error_handling/error_handling.hpp"
37 enum class TypedMemPoolError
41 FatalErrorReachedInconsistentState
48 TypedMemPool(
const cxx::greater_or_equal<uint32_t, 1> numberOfChunks,
49 posix::Allocator& managementAllocator,
50 posix::Allocator& chunkMemoryAllocator) noexcept;
57 template <
typename... Targs>
58 cxx::expected<SharedPointer<T>, TypedMemPoolError> createObject(Targs&&... args) noexcept;
59 template <
typename ErrorType,
typename... Targs>
60 cxx::expected<SharedPointer<T>, cxx::variant<TypedMemPoolError, ErrorType>>
61 createObjectWithCreationPattern(Targs&&... args) noexcept;
62 uint32_t getChunkCount()
const noexcept;
63 uint32_t getUsedChunks()
const noexcept;
65 static uint64_t requiredManagementMemorySize(
const uint64_t f_numberOfChunks) noexcept;
66 static uint64_t requiredChunkMemorySize(
const uint64_t f_numberOfChunks) noexcept;
67 static uint64_t requiredFullMemorySize(
const uint64_t f_numberOfChunks) noexcept;
70 static uint64_t requiredChunkSize() noexcept;
71 cxx::expected<ChunkManagement*, TypedMemPoolError> acquireChunkManagementPointer() noexcept;
81 #include "typed_mem_pool.inl"
Definition: mem_pool.hpp:48
Definition: typed_mem_pool.hpp:46
Definition: service_description.hpp:29