17 #ifndef IOX_UTILS_POSIX_WRAPPER_SHARED_MEMORY_OBJECT_HPP
18 #define IOX_UTILS_POSIX_WRAPPER_SHARED_MEMORY_OBJECT_HPP
20 #include "iceoryx_utils/cxx/optional.hpp"
21 #include "iceoryx_utils/design_pattern/creation.hpp"
22 #include "iceoryx_utils/internal/posix_wrapper/shared_memory_object/allocator.hpp"
23 #include "iceoryx_utils/internal/posix_wrapper/shared_memory_object/memory_map.hpp"
24 #include "iceoryx_utils/internal/posix_wrapper/shared_memory_object/shared_memory.hpp"
25 #include "iceoryx_utils/platform/stat.hpp"
33 using byte_t = uint8_t;
35 enum class SharedMemoryObjectError
38 SHARED_MEMORY_CREATION_FAILED,
39 MAPPING_SHARED_MEMORY_FAILED,
45 static constexpr
void* NO_ADDRESS_HINT =
nullptr;
52 void* allocate(
const uint64_t size,
const uint64_t alignment);
53 void finalizeAllocation();
56 void* getBaseAddress()
const;
58 uint64_t getSizeInBytes()
const;
59 int getFileHandle()
const;
65 const uint64_t memorySizeInBytes,
66 const AccessMode accessMode,
67 const OwnerShip ownerShip,
68 const void* baseAddressHint,
69 const mode_t permissions = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
74 uint64_t m_memorySizeInBytes;
This pattern can be used if you write an abstraction where you have to throw an exception in the cons...
Definition: creation.hpp:99
bool isInitialized() const noexcept
returns true if the object was constructed successfully, otherwise false
Definition: creation.inl:47
Optional implementation from the C++17 standard with C++11. The interface is analog to the C++17 stan...
Definition: optional.hpp:63
Definition: allocator.hpp:28
Definition: shared_memory_object.hpp:43
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:28