Skip to content

Commit

Permalink
iox-#1036 Add SharedMemoryBuilder documentation and changelog update
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Eltzschig <me@elchris.org>
  • Loading branch information
elfenpiff committed Jan 28, 2022
1 parent a128f7b commit c5c6c13
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
- Remove creation pattern from `MemoryMap` and replace it with `MemoryMapBuilder` [\#1036](https://github.com/eclipse-iceoryx/iceoryx/issues/1036)
- Fix error handling of `TypedUniqueId` and refactor it to `UniquePortId` [\#861](https://github.com/eclipse-iceoryx/iceoryx/issues/861)
- Updating Codecov API and enforce CMake version 3.16 for building iceoryx [\#774](https://github.com/eclipse-iceoryx/iceoryx/issues/774) and [\#1031](https://github.com/eclipse-iceoryx/iceoryx/issues/1031)
- Remove creation pattern from `SharedMemory` and replace it with `SharedMemoryBuilder` [\#1036](https://github.com/eclipse-iceoryx/iceoryx/issues/1036)
- Removed the leading slash requirement from the name of a shared memory in `SharedMemory` and `SharedMemoryObject` [\#439](https://github.com/eclipse-iceoryx/iceoryx/issues/439)

**API Breaking Changes:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,28 @@ class SharedMemory

class SharedMemoryBuilder
{
/// @brief A valid file name for the shared memory with the restriction that
/// no leading dot is allowed since it is not compatible with every
/// file system
IOX_BUILDER_PARAMETER(SharedMemory::Name_t, name, "")

/// @brief Defines if the memory should be mapped read only or with write access.
/// A read only memory section will cause a segmentation fault when written to.
IOX_BUILDER_PARAMETER(AccessMode, accessMode, AccessMode::READ_WRITE)

/// @brief Defines how the shared memory is acquired
IOX_BUILDER_PARAMETER(OpenMode, openMode, OpenMode::OPEN_OR_CREATE)

/// @brief Defines the access permissions of the shared memory
IOX_BUILDER_PARAMETER(cxx::perms, filePermissions, cxx::perms::owner_all | cxx::perms::group_read)

/// @brief Defines the size of the shared memory
IOX_BUILDER_PARAMETER(uint64_t, size, 0U)

public:
/// @brief creates a valid SharedMemory object. If the construction failed the expected
/// contains an enum value describing the error.
/// @return expected containing SharedMemory on success otherwise SharedMemoryError
cxx::expected<SharedMemory, SharedMemoryError> create() noexcept;
};

Expand Down

0 comments on commit c5c6c13

Please sign in to comment.