17 #ifndef IOX_UTILS_POSIX_WRAPPER_SHARED_MEMORY_OBJECT_MEMORY_MAP_HPP
18 #define IOX_UTILS_POSIX_WRAPPER_SHARED_MEMORY_OBJECT_MEMORY_MAP_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/shared_memory.hpp"
23 #include "iceoryx_utils/platform/mman.hpp"
31 class SharedMemoryObject;
33 enum class MemoryMapError
38 INVALID_FILE_DESCRIPTOR,
41 OPEN_FILES_SYSTEM_LIMIT_EXCEEDED,
42 FILESYSTEM_DOES_NOT_SUPPORT_MEMORY_MAPPING,
43 NOT_ENOUGH_MEMORY_AVAILABLE,
44 OVERFLOWING_PARAMETERS,
59 void* getBaseAddress()
const noexcept;
65 const uint64_t length,
66 const int32_t fileDescriptor,
67 const AccessMode accessMode,
68 const int32_t flags = MAP_SHARED,
69 const off_t offset = 0) noexcept;
71 bool destroy() noexcept;
72 MemoryMapError errnoToEnum(
const int32_t errnum)
const noexcept;
74 void* m_baseAddress{
nullptr};
75 uint64_t m_length{0U};
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
Definition: memory_map.hpp:51
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:28