From 36385a983d17351b8f3d5274a4e5746efb63ce3f Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Thu, 23 Feb 2023 22:48:21 +0100 Subject: [PATCH] iox-#1394 Rename 'access_control' to 'access_rights' --- .../release-notes/iceoryx-unreleased.md | 4 +- .../include/iox/detail/filesystem.inl | 28 +-- .../filesystem/include/iox/filesystem.hpp | 176 +++++++++--------- .../filesystem/source/filesystem.cpp | 14 +- .../posix_wrapper/shared_memory_object.hpp | 2 +- .../shared_memory_object/shared_memory.hpp | 2 +- .../iceoryx_hoofs/posix_wrapper/file_lock.hpp | 2 +- .../posix_wrapper/named_semaphore.hpp | 2 +- .../include/iceoryx_hoofs/cxx/filesystem.hpp | 4 +- .../source/posix_wrapper/named_semaphore.cpp | 2 +- .../test_filesystem_filesystem.cpp | 36 ++-- .../test_posix_named_semaphore.cpp | 2 +- .../internal/mepoo/mepoo_segment.hpp | 2 +- .../internal/mepoo/mepoo_segment.inl | 2 +- .../internal/runtime/shared_memory_user.hpp | 2 +- .../memory/posix_shm_memory_provider.hpp | 2 +- .../memory/posix_shm_memory_provider.cpp | 2 +- .../source/runtime/shared_memory_user.cpp | 2 +- .../test/moduletests/test_mepoo_segment.cpp | 10 +- 19 files changed, 148 insertions(+), 148 deletions(-) diff --git a/doc/website/release-notes/iceoryx-unreleased.md b/doc/website/release-notes/iceoryx-unreleased.md index 4b98e4d641..c5fd40effa 100644 --- a/doc/website/release-notes/iceoryx-unreleased.md +++ b/doc/website/release-notes/iceoryx-unreleased.md @@ -1024,12 +1024,12 @@ #include "iox/duration.hpp" ``` -46. The `perms` enum is replaced by the `access_control` class +46. The `perms` enum is replaced by the `access_rights` class ```cpp // before iox::perms foo { iox::perms::owner_all | iox::perms::group_read }; // after - iox::access_control foo { iox::perms::owner_all | iox::perms::group_read }; + iox::access_rights foo { iox::perms::owner_all | iox::perms::group_read }; ``` diff --git a/iceoryx_hoofs/filesystem/include/iox/detail/filesystem.inl b/iceoryx_hoofs/filesystem/include/iox/detail/filesystem.inl index 9d50f78254..95e21ff32c 100644 --- a/iceoryx_hoofs/filesystem/include/iox/detail/filesystem.inl +++ b/iceoryx_hoofs/filesystem/include/iox/detail/filesystem.inl @@ -186,53 +186,53 @@ inline bool doesEndWithPathSeparator(const iox::string& name) no return false; } -constexpr access_control::value_type access_control::value() const noexcept +constexpr access_rights::value_type access_rights::value() const noexcept { return m_value; } -constexpr bool operator==(const access_control lhs, const access_control rhs) noexcept +constexpr bool operator==(const access_rights lhs, const access_rights rhs) noexcept { return lhs.value() == rhs.value(); } -constexpr bool operator!=(const access_control lhs, const access_control rhs) noexcept +constexpr bool operator!=(const access_rights lhs, const access_rights rhs) noexcept { return !(lhs == rhs); } -constexpr access_control operator|(const access_control lhs, const access_control rhs) noexcept +constexpr access_rights operator|(const access_rights lhs, const access_rights rhs) noexcept { - return access_control(lhs.value() | rhs.value()); + return access_rights(lhs.value() | rhs.value()); } -constexpr access_control operator&(const access_control lhs, const access_control rhs) noexcept +constexpr access_rights operator&(const access_rights lhs, const access_rights rhs) noexcept { - return access_control(lhs.value() & rhs.value()); + return access_rights(lhs.value() & rhs.value()); } -constexpr access_control operator^(const access_control lhs, const access_control rhs) noexcept +constexpr access_rights operator^(const access_rights lhs, const access_rights rhs) noexcept { - return access_control(lhs.value() ^ rhs.value()); + return access_rights(lhs.value() ^ rhs.value()); } -constexpr access_control operator~(const access_control value) noexcept +constexpr access_rights operator~(const access_rights value) noexcept { // AXIVION Next Construct AutosarC++19_03-A4.7.1, AutosarC++19_03-M0.3.1, FaultDetection-IntegerOverflow : Cast is safe and required due to integer promotion - return access_control(static_cast(~value.value())); + return access_rights(static_cast(~value.value())); } -constexpr access_control operator|=(const access_control lhs, const access_control rhs) noexcept +constexpr access_rights operator|=(const access_rights lhs, const access_rights rhs) noexcept { return operator|(lhs, rhs); } -constexpr access_control operator&=(const access_control lhs, const access_control rhs) noexcept +constexpr access_rights operator&=(const access_rights lhs, const access_rights rhs) noexcept { return operator&(lhs, rhs); } -constexpr access_control operator^=(const access_control lhs, const access_control rhs) noexcept +constexpr access_rights operator^=(const access_rights lhs, const access_rights rhs) noexcept { return operator^(lhs, rhs); } diff --git a/iceoryx_hoofs/filesystem/include/iox/filesystem.hpp b/iceoryx_hoofs/filesystem/include/iox/filesystem.hpp index 8980761d7e..87241101ee 100644 --- a/iceoryx_hoofs/filesystem/include/iox/filesystem.hpp +++ b/iceoryx_hoofs/filesystem/include/iox/filesystem.hpp @@ -98,23 +98,23 @@ bool doesEndWithPathSeparator(const string& name) noexcept; /// #include /// void foo() /// { -/// iox::access_control bar { iox::perms::owner_all | iox::perms::group_read }; +/// iox::access_rights bar { iox::perms::owner_all | iox::perms::group_read }; /// } /// /// @endcode -class access_control final +class access_rights final { public: using value_type = uint16_t; - access_control() noexcept = default; - access_control(const access_control&) noexcept = default; - access_control(access_control&&) noexcept = default; + access_rights() noexcept = default; + access_rights(const access_rights&) noexcept = default; + access_rights(access_rights&&) noexcept = default; - access_control& operator=(const access_control&) noexcept = default; - access_control& operator=(access_control&&) noexcept = default; + access_rights& operator=(const access_rights&) noexcept = default; + access_rights& operator=(access_rights&&) noexcept = default; - ~access_control() noexcept = default; + ~access_rights() noexcept = default; constexpr value_type value() const noexcept; @@ -126,143 +126,143 @@ class access_control final // the respective constants /// @note Implementation detail! Please use 'iox::perms::none'. - static constexpr access_control none() noexcept + static constexpr access_rights none() noexcept { constexpr value_type VALUE{0}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::owner_read'. - static constexpr access_control owner_read() noexcept + static constexpr access_rights owner_read() noexcept { constexpr value_type VALUE{0400}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::owner_write'. - static constexpr access_control owner_write() noexcept + static constexpr access_rights owner_write() noexcept { constexpr value_type VALUE{0200}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::owner_exec'. - static constexpr access_control owner_exec() noexcept + static constexpr access_rights owner_exec() noexcept { constexpr value_type VALUE{0100}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::owner_all'. - static constexpr access_control owner_all() noexcept + static constexpr access_rights owner_all() noexcept { constexpr value_type VALUE{0700}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::group_read'. - static constexpr access_control group_read() noexcept + static constexpr access_rights group_read() noexcept { constexpr value_type VALUE{040}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::group_write'. - static constexpr access_control group_write() noexcept + static constexpr access_rights group_write() noexcept { constexpr value_type VALUE{020}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::group_exec'. - static constexpr access_control group_exec() noexcept + static constexpr access_rights group_exec() noexcept { constexpr value_type VALUE{010}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::group_all'. - static constexpr access_control group_all() noexcept + static constexpr access_rights group_all() noexcept { constexpr value_type VALUE{070}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::others_read'. - static constexpr access_control others_read() noexcept + static constexpr access_rights others_read() noexcept { constexpr value_type VALUE{04}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::others_write'. - static constexpr access_control others_write() noexcept + static constexpr access_rights others_write() noexcept { constexpr value_type VALUE{02}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::others_exec'. - static constexpr access_control others_exec() noexcept + static constexpr access_rights others_exec() noexcept { constexpr value_type VALUE{01}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::others_all'. - static constexpr access_control others_all() noexcept + static constexpr access_rights others_all() noexcept { constexpr value_type VALUE{07}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::all'. - static constexpr access_control all() noexcept + static constexpr access_rights all() noexcept { constexpr value_type VALUE{0777}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::set_uid'. - static constexpr access_control set_uid() noexcept + static constexpr access_rights set_uid() noexcept { constexpr value_type VALUE{04000}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::set_gid'. - static constexpr access_control set_gid() noexcept + static constexpr access_rights set_gid() noexcept { constexpr value_type VALUE{02000}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::sticky_bit'. - static constexpr access_control sticky_bit() noexcept + static constexpr access_rights sticky_bit() noexcept { constexpr value_type VALUE{01000}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::mask'. - static constexpr access_control mask() noexcept + static constexpr access_rights mask() noexcept { constexpr value_type VALUE{07777}; - return access_control{VALUE}; + return access_rights{VALUE}; } /// @note Implementation detail! Please use 'iox::perms::unknown'. - static constexpr access_control unknown() noexcept + static constexpr access_rights unknown() noexcept { constexpr value_type VALUE{0xFFFFU}; - return access_control{VALUE}; + return access_rights{VALUE}; } // AXIVION ENABLE STYLE AutosarC++19_03-M2.13.2 }; - friend constexpr bool operator==(const access_control lhs, const access_control rhs) noexcept; - friend constexpr bool operator!=(const access_control lhs, const access_control rhs) noexcept; + friend constexpr bool operator==(const access_rights lhs, const access_rights rhs) noexcept; + friend constexpr bool operator!=(const access_rights lhs, const access_rights rhs) noexcept; - friend constexpr access_control operator|(const access_control lhs, const access_control rhs) noexcept; - friend constexpr access_control operator&(const access_control lhs, const access_control rhs) noexcept; - friend constexpr access_control operator^(const access_control lhs, const access_control rhs) noexcept; - friend constexpr access_control operator~(const access_control value) noexcept; - friend constexpr access_control operator|=(const access_control lhs, const access_control rhs) noexcept; - friend constexpr access_control operator&=(const access_control lhs, const access_control rhs) noexcept; - friend constexpr access_control operator^=(const access_control lhs, const access_control rhs) noexcept; + friend constexpr access_rights operator|(const access_rights lhs, const access_rights rhs) noexcept; + friend constexpr access_rights operator&(const access_rights lhs, const access_rights rhs) noexcept; + friend constexpr access_rights operator^(const access_rights lhs, const access_rights rhs) noexcept; + friend constexpr access_rights operator~(const access_rights value) noexcept; + friend constexpr access_rights operator|=(const access_rights lhs, const access_rights rhs) noexcept; + friend constexpr access_rights operator&=(const access_rights lhs, const access_rights rhs) noexcept; + friend constexpr access_rights operator^=(const access_rights lhs, const access_rights rhs) noexcept; private: - explicit constexpr access_control(value_type value) noexcept + explicit constexpr access_rights(value_type value) noexcept : m_value(value) { } @@ -276,55 +276,55 @@ namespace perms // AXIVION DISABLE STYLE AutosarC++19_03-A2.10.5 : Name reuse is intentional since they refer to the same value. Additionally, different namespaces are used. /// @brief Deny everything -static constexpr access_control none{access_control::detail::none()}; +static constexpr access_rights none{access_rights::detail::none()}; /// @brief owner has read permission -static constexpr access_control owner_read{access_control::detail::owner_read()}; +static constexpr access_rights owner_read{access_rights::detail::owner_read()}; /// @brief owner has write permission -static constexpr access_control owner_write{access_control::detail::owner_write()}; +static constexpr access_rights owner_write{access_rights::detail::owner_write()}; /// @brief owner has execution permission -static constexpr access_control owner_exec{access_control::detail::owner_exec()}; +static constexpr access_rights owner_exec{access_rights::detail::owner_exec()}; /// @brief owner has all permissions -static constexpr access_control owner_all{access_control::detail::owner_all()}; +static constexpr access_rights owner_all{access_rights::detail::owner_all()}; /// @brief group has read permission -static constexpr access_control group_read{access_control::detail::group_read()}; +static constexpr access_rights group_read{access_rights::detail::group_read()}; /// @brief group has write permission -static constexpr access_control group_write{access_control::detail::group_write()}; +static constexpr access_rights group_write{access_rights::detail::group_write()}; /// @brief group has execution permission -static constexpr access_control group_exec{access_control::detail::group_exec()}; +static constexpr access_rights group_exec{access_rights::detail::group_exec()}; /// @brief group has all permissions -static constexpr access_control group_all{access_control::detail::group_all()}; +static constexpr access_rights group_all{access_rights::detail::group_all()}; /// @brief others have read permission -static constexpr access_control others_read{access_control::detail::others_read()}; +static constexpr access_rights others_read{access_rights::detail::others_read()}; /// @brief others have write permission -static constexpr access_control others_write{access_control::detail::others_write()}; +static constexpr access_rights others_write{access_rights::detail::others_write()}; /// @brief others have execution permission -static constexpr access_control others_exec{access_control::detail::others_exec()}; +static constexpr access_rights others_exec{access_rights::detail::others_exec()}; /// @brief others have all permissions -static constexpr access_control others_all{access_control::detail::others_all()}; +static constexpr access_rights others_all{access_rights::detail::others_all()}; /// @brief all permissions for everyone -static constexpr access_control all{access_control::detail::all()}; +static constexpr access_rights all{access_rights::detail::all()}; /// @brief set uid bit /// @note introduction into setgit/setuid: https://en.wikipedia.org/wiki/Setuid // AXIVION Next Construct AutosarC++19_03-M2.10.1: The constant is in a namespace and mimics the C++17 STL equivalent -static constexpr access_control set_uid{access_control::detail::set_uid()}; +static constexpr access_rights set_uid{access_rights::detail::set_uid()}; /// @brief set gid bit /// @note introduction into setgit/setuid: https://en.wikipedia.org/wiki/Setuid // AXIVION Next Construct AutosarC++19_03-M2.10.1: The constant is in a namespace and mimics the C++17 STL equivalent -static constexpr access_control set_gid{access_control::detail::set_gid()}; +static constexpr access_rights set_gid{access_rights::detail::set_gid()}; /// @brief set sticky bit /// @note sticky bit introduction: https://en.wikipedia.org/wiki/Sticky_bit -static constexpr access_control sticky_bit{access_control::detail::sticky_bit()}; +static constexpr access_rights sticky_bit{access_rights::detail::sticky_bit()}; /// @brief all permissions for everyone as well as uid, gid and sticky bit -static constexpr access_control mask{access_control::detail::mask()}; +static constexpr access_rights mask{access_rights::detail::mask()}; /// @brief unknown permissions -static constexpr access_control unknown{access_control::detail::unknown()}; +static constexpr access_rights unknown{access_rights::detail::unknown()}; // AXIVION ENABLE STYLE AutosarC++19_03-A2.10.5 } // namespace perms @@ -334,68 +334,68 @@ static constexpr access_control unknown{access_control::detail::unknown()}; /// @param[in] lhs left hand side of the operation /// @param[in] rhs right hand side of the operation /// @return lhs == rhs -constexpr bool operator==(const access_control lhs, const access_control rhs) noexcept; +constexpr bool operator==(const access_rights lhs, const access_rights rhs) noexcept; /// @brief Implements the not equal operator /// @param[in] lhs left hand side of the operation /// @param[in] rhs right hand side of the operation /// @return lhs != rhs -constexpr bool operator!=(const access_control lhs, const access_control rhs) noexcept; +constexpr bool operator!=(const access_rights lhs, const access_rights rhs) noexcept; /// @brief Implements the binary or operation /// @param[in] lhs left hand side of the operation /// @param[in] rhs right hand side of the operation /// @return lhs | rhs -constexpr access_control operator|(const access_control lhs, const access_control rhs) noexcept; +constexpr access_rights operator|(const access_rights lhs, const access_rights rhs) noexcept; /// @brief Implements the binary and operation /// @param[in] lhs left hand side of the operation /// @param[in] rhs right hand side of the operation /// @return lhs & rhs -constexpr access_control operator&(const access_control lhs, const access_control rhs) noexcept; +constexpr access_rights operator&(const access_rights lhs, const access_rights rhs) noexcept; /// @brief Implements the binary exclusive or operation /// @param[in] lhs left hand side of the operation /// @param[in] rhs right hand side of the operation /// @return lhs ^ rhs -constexpr access_control operator^(const access_control lhs, const access_control rhs) noexcept; +constexpr access_rights operator^(const access_rights lhs, const access_rights rhs) noexcept; /// @brief Implements the binary complement operation /// @param[in] value the value used for the operation /// @return ~value -constexpr access_control operator~(const access_control value) noexcept; +constexpr access_rights operator~(const access_rights value) noexcept; /// @brief Implements the binary or assignment operation /// @param[in] lhs left hand side of the operation /// @param[in] rhs right hand side of the operation /// @return lhs = lhs | rhs -constexpr access_control operator|=(const access_control lhs, const access_control rhs) noexcept; +constexpr access_rights operator|=(const access_rights lhs, const access_rights rhs) noexcept; /// @brief Implements the binary and assignment operation /// @param[in] lhs left hand side of the operation /// @param[in] rhs right hand side of the operation /// @return lhs = lhs & rhs -constexpr access_control operator&=(const access_control lhs, const access_control rhs) noexcept; +constexpr access_rights operator&=(const access_rights lhs, const access_rights rhs) noexcept; /// @brief Implements the binary exclusive or assignment operation /// @param[in] lhs left hand side of the operation /// @param[in] rhs right hand side of the operation /// @return lhs = lhs ^ rhs -constexpr access_control operator^=(const access_control lhs, const access_control rhs) noexcept; +constexpr access_rights operator^=(const access_rights lhs, const access_rights rhs) noexcept; -/// @brief The 'ostream' operator for the 'access_control' class. It handles the class as if +/// @brief The 'ostream' operator for the 'access_rights' class. It handles the class as if /// it was a bitset and always lists the values for owner, group, others, special bits /// @param[in] stream reference to the 'ostream' /// @param[in] value the file permission /// @return the reference to the stream -std::ostream& operator<<(std::ostream& stream, const access_control value) noexcept; +std::ostream& operator<<(std::ostream& stream, const access_rights value) noexcept; -/// @brief The 'LogStream' operator for the 'access_control' class. It handles the class as if +/// @brief The 'LogStream' operator for the 'access_rights' class. It handles the class as if /// it was a bitset and always lists the values for owner, group, others, special bits /// @param[in] stream reference to the 'LogStream' /// @param[in] value the file permission /// @return the reference to the stream -iox::log::LogStream& operator<<(iox::log::LogStream& stream, const access_control value) noexcept; +iox::log::LogStream& operator<<(iox::log::LogStream& stream, const access_rights value) noexcept; } // namespace iox #include "iox/detail/filesystem.inl" diff --git a/iceoryx_hoofs/filesystem/source/filesystem.cpp b/iceoryx_hoofs/filesystem/source/filesystem.cpp index e9d6a4ef33..024fb03133 100644 --- a/iceoryx_hoofs/filesystem/source/filesystem.cpp +++ b/iceoryx_hoofs/filesystem/source/filesystem.cpp @@ -51,7 +51,7 @@ static void finishEntry(StreamType& stream, const bool hasPrecedingEntry, const } template -static void printOwnerPermissions(StreamType& stream, const access_control value) +static void printOwnerPermissions(StreamType& stream, const access_rights value) { bool hasPrecedingEntry = false; stream << "owner: {"; @@ -75,7 +75,7 @@ static void printOwnerPermissions(StreamType& stream, const access_control value } template -static void printGroupPermissions(StreamType& stream, const access_control value) +static void printGroupPermissions(StreamType& stream, const access_rights value) { bool hasPrecedingEntry = false; stream << "group: {"; @@ -99,7 +99,7 @@ static void printGroupPermissions(StreamType& stream, const access_control value } template -static void printOtherPermissions(StreamType& stream, const access_control value) +static void printOtherPermissions(StreamType& stream, const access_rights value) { bool hasPrecedingEntry = false; stream << "others: {"; @@ -123,7 +123,7 @@ static void printOtherPermissions(StreamType& stream, const access_control value } template -static void printSpecialBits(StreamType& stream, const access_control value) +static void printSpecialBits(StreamType& stream, const access_rights value) { bool hasPrecedingEntry = false; stream << "special bits: {"; @@ -147,7 +147,7 @@ static void printSpecialBits(StreamType& stream, const access_control value) } template -void printAccessControl(StreamType& stream, const access_control value) noexcept +void printAccessControl(StreamType& stream, const access_rights value) noexcept { if (value == perms::unknown) { @@ -161,13 +161,13 @@ void printAccessControl(StreamType& stream, const access_control value) noexcept printSpecialBits(stream, value); } -std::ostream& operator<<(std::ostream& stream, const access_control value) noexcept +std::ostream& operator<<(std::ostream& stream, const access_rights value) noexcept { printAccessControl(stream, value); return stream; } -iox::log::LogStream& operator<<(iox::log::LogStream& stream, const access_control value) noexcept +iox::log::LogStream& operator<<(iox::log::LogStream& stream, const access_rights value) noexcept { printAccessControl(stream, value); return stream; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp index 4affd9b44f..9ff0587536 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp @@ -138,7 +138,7 @@ class SharedMemoryObjectBuilder IOX_BUILDER_PARAMETER(optional, baseAddressHint, nullopt) /// @brief Defines the access permissions of the shared memory - IOX_BUILDER_PARAMETER(access_control, permissions, perms::none) + IOX_BUILDER_PARAMETER(access_rights, permissions, perms::none) public: expected create() noexcept; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/shared_memory.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/shared_memory.hpp index ea9a8ea640..1e23bda57d 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/shared_memory.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/shared_memory.hpp @@ -116,7 +116,7 @@ class SharedMemoryBuilder IOX_BUILDER_PARAMETER(OpenMode, openMode, OpenMode::OPEN_EXISTING) /// @brief Defines the access permissions of the shared memory - IOX_BUILDER_PARAMETER(access_control, filePermissions, perms::none) + IOX_BUILDER_PARAMETER(access_rights, filePermissions, perms::none) /// @brief Defines the size of the shared memory IOX_BUILDER_PARAMETER(uint64_t, size, 0U) diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/file_lock.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/file_lock.hpp index f839a71f96..a52aabf15f 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/file_lock.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/file_lock.hpp @@ -121,7 +121,7 @@ class FileLockBuilder /// @brief Defines the access permissions of the file lock. If they are not /// explicitly set they will be none - IOX_BUILDER_PARAMETER(access_control, permission, perms::none) + IOX_BUILDER_PARAMETER(access_rights, permission, perms::none) public: /// @brief Creates a file lock diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/named_semaphore.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/named_semaphore.hpp index 05186a33a2..11acb86996 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/named_semaphore.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/named_semaphore.hpp @@ -64,7 +64,7 @@ class NamedSemaphoreBuilder IOX_BUILDER_PARAMETER(OpenMode, openMode, OpenMode::OPEN_EXISTING) /// @brief Defines the access permissions of the semaphore - IOX_BUILDER_PARAMETER(access_control, permissions, perms::owner_all) + IOX_BUILDER_PARAMETER(access_rights, permissions, perms::owner_all) /// @brief Set the initial value of the unnamed posix semaphore. This value is only used when a new semaphore is /// created. diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/filesystem.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/filesystem.hpp index 83a1bd658b..989cf24f44 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/filesystem.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/filesystem.hpp @@ -24,8 +24,8 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/filesystem.hpp' instead")]] namespace cxx { -/// @deprecated use 'iox::access_control' instead of 'iox::cxx::perms' -using perms = iox::access_control; +/// @deprecated use 'iox::access_rights' instead of 'iox::cxx::perms' +using perms = iox::access_rights; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/source/posix_wrapper/named_semaphore.cpp b/iceoryx_hoofs/source/posix_wrapper/named_semaphore.cpp index d5e098533e..6157e4dfef 100644 --- a/iceoryx_hoofs/source/posix_wrapper/named_semaphore.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/named_semaphore.cpp @@ -104,7 +104,7 @@ tryOpenExistingSemaphore(optional& uninitializedSemaphore, const static expected createSemaphore(optional& uninitializedSemaphore, const NamedSemaphore::Name_t& name, const OpenMode openMode, - const access_control permissions, + const access_rights permissions, const uint32_t initialValue) noexcept { auto result = posixCall(iox_sem_open_ext)(createNameWithSlash(name).c_str(), diff --git a/iceoryx_hoofs/test/moduletests/test_filesystem_filesystem.cpp b/iceoryx_hoofs/test/moduletests/test_filesystem_filesystem.cpp index a004716e6b..91f6c191ba 100644 --- a/iceoryx_hoofs/test/moduletests/test_filesystem_filesystem.cpp +++ b/iceoryx_hoofs/test/moduletests/test_filesystem_filesystem.cpp @@ -594,8 +594,8 @@ TEST(filesystem_test_isValidPathEntry, StringWithRelativeComponentsIsInvalidWhen TEST(filesystem_test, permsBinaryOrEqualToBinaryOrOfUnderlyingType) { ::testing::Test::RecordProperty("TEST_ID", "0b72fcec-c2b3-4a45-801f-542ff3195a2f"); - constexpr access_control TEST_VALUE_LHS = perms::others_write; - constexpr access_control TEST_VALUE_RHS = perms::group_all; + constexpr access_rights TEST_VALUE_LHS = perms::others_write; + constexpr access_rights TEST_VALUE_RHS = perms::group_all; constexpr auto BASE_VALUE_LHS = TEST_VALUE_LHS.value(); constexpr auto BASE_VALUE_RHS = TEST_VALUE_RHS.value(); @@ -606,8 +606,8 @@ TEST(filesystem_test, permsBinaryOrEqualToBinaryOrOfUnderlyingType) TEST(filesystem_test, permsBinaryAndEqualToBinaryAndOfUnderlyingType) { ::testing::Test::RecordProperty("TEST_ID", "15a02845-21b0-41fb-80bf-ee2ff9a81427"); - constexpr access_control TEST_VALUE_LHS = perms::others_read; - constexpr access_control TEST_VALUE_RHS = perms::mask; + constexpr access_rights TEST_VALUE_LHS = perms::others_read; + constexpr access_rights TEST_VALUE_RHS = perms::mask; constexpr auto BASE_VALUE_LHS = TEST_VALUE_LHS.value(); constexpr auto BASE_VALUE_RHS = TEST_VALUE_RHS.value(); @@ -618,8 +618,8 @@ TEST(filesystem_test, permsBinaryAndEqualToBinaryAndOfUnderlyingType) TEST(filesystem_test, permsBinaryExclusiveOrEqualToBinaryExclusiveOrOfUnderlyingType) { ::testing::Test::RecordProperty("TEST_ID", "8094a263-2861-45ad-aecd-9312d477bc2d"); - constexpr access_control TEST_VALUE_LHS = perms::set_gid; - constexpr access_control TEST_VALUE_RHS = perms::set_uid; + constexpr access_rights TEST_VALUE_LHS = perms::set_gid; + constexpr access_rights TEST_VALUE_RHS = perms::set_uid; constexpr auto BASE_VALUE_LHS = TEST_VALUE_LHS.value(); constexpr auto BASE_VALUE_RHS = TEST_VALUE_RHS.value(); @@ -630,10 +630,10 @@ TEST(filesystem_test, permsBinaryExclusiveOrEqualToBinaryExclusiveOrOfUnderlying TEST(filesystem_test, permsBinaryComplementEqualToBinaryComplementOfUnderlyingType) { ::testing::Test::RecordProperty("TEST_ID", "c313cf42-4cf0-4836-95ff-129111a707b0"); - constexpr access_control TEST_VALUE = perms::owner_read; + constexpr access_rights TEST_VALUE = perms::owner_read; - constexpr access_control::value_type BASE_VALUE = 0x0100; - constexpr access_control::value_type EXPECTED_VALUE = 0xFEFF; + constexpr access_rights::value_type BASE_VALUE = 0x0100; + constexpr access_rights::value_type EXPECTED_VALUE = 0xFEFF; ASSERT_THAT(TEST_VALUE.value(), Eq(BASE_VALUE)); @@ -643,13 +643,13 @@ TEST(filesystem_test, permsBinaryComplementEqualToBinaryComplementOfUnderlyingTy TEST(filesystem_test, permsBinaryOrAssignmentEqualToBinaryOrAssignmentOfUnderlyingType) { ::testing::Test::RecordProperty("TEST_ID", "d3611de8-f932-4485-9e64-6cd8af4526dc"); - constexpr access_control TEST_VALUE = perms::sticky_bit; - constexpr access_control TEST_VALUE_RHS = perms::group_read; + constexpr access_rights TEST_VALUE = perms::sticky_bit; + constexpr access_rights TEST_VALUE_RHS = perms::group_read; auto sutBaseValue = TEST_VALUE.value(); constexpr auto BASE_VALUE_RHS = TEST_VALUE_RHS.value(); - access_control sut = TEST_VALUE; + access_rights sut = TEST_VALUE; EXPECT_THAT((sut |= TEST_VALUE_RHS).value(), Eq(sutBaseValue |= BASE_VALUE_RHS)); } @@ -657,13 +657,13 @@ TEST(filesystem_test, permsBinaryOrAssignmentEqualToBinaryOrAssignmentOfUnderlyi TEST(filesystem_test, permsBinaryAndAssignmentEqualToBinaryAndAssignmentOfUnderlyingType) { ::testing::Test::RecordProperty("TEST_ID", "03c139be-e3ec-477e-8598-5da93699ab75"); - constexpr access_control TEST_VALUE = perms::others_exec; - constexpr access_control TEST_VALUE_RHS = perms::others_all; + constexpr access_rights TEST_VALUE = perms::others_exec; + constexpr access_rights TEST_VALUE_RHS = perms::others_all; auto sutBaseValue = TEST_VALUE.value(); constexpr auto BASE_VALUE_RHS = TEST_VALUE_RHS.value(); - access_control sut = TEST_VALUE; + access_rights sut = TEST_VALUE; EXPECT_THAT((sut &= TEST_VALUE_RHS).value(), Eq(sutBaseValue &= BASE_VALUE_RHS)); } @@ -671,13 +671,13 @@ TEST(filesystem_test, permsBinaryAndAssignmentEqualToBinaryAndAssignmentOfUnderl TEST(filesystem_test, permsBinaryExclusiveOrAssignmentEqualToBinaryExclusiveOrAssignmentOfUnderylingType) { ::testing::Test::RecordProperty("TEST_ID", "dae75205-a635-4535-8e8d-05541bb05b60"); - constexpr access_control TEST_VALUE = perms::none; - constexpr access_control TEST_VALUE_RHS = perms::owner_all; + constexpr access_rights TEST_VALUE = perms::none; + constexpr access_rights TEST_VALUE_RHS = perms::owner_all; auto sutBaseValue = TEST_VALUE.value(); constexpr auto BASE_VALUE_RHS = TEST_VALUE_RHS.value(); - access_control sut = TEST_VALUE; + access_rights sut = TEST_VALUE; EXPECT_THAT((sut ^= TEST_VALUE_RHS).value(), Eq(sutBaseValue ^= BASE_VALUE_RHS)); } diff --git a/iceoryx_hoofs/test/moduletests/test_posix_named_semaphore.cpp b/iceoryx_hoofs/test/moduletests/test_posix_named_semaphore.cpp index bb100fefab..a47c7c0bb5 100644 --- a/iceoryx_hoofs/test/moduletests/test_posix_named_semaphore.cpp +++ b/iceoryx_hoofs/test/moduletests/test_posix_named_semaphore.cpp @@ -38,7 +38,7 @@ class NamedSemaphoreTest : public Test optional sut; NamedSemaphore::Name_t sutName{TruncateToCapacity, "dr.peacock_rocks"}; - const iox::access_control sutPermission = iox::perms::owner_all; + const iox::access_rights sutPermission = iox::perms::owner_all; }; TEST_F(NamedSemaphoreTest, DefaultInitialValueIsZero) diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.hpp b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.hpp index affe7c7e16..916d4a1f02 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.hpp @@ -59,7 +59,7 @@ class MePooSegment uint64_t m_segmentId; iox::mepoo::MemoryInfo m_memoryInfo; - static constexpr access_control SEGMENT_PERMISSIONS = + static constexpr access_rights SEGMENT_PERMISSIONS = perms::owner_read | perms::owner_write | perms::group_read | perms::group_write; private: diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.inl b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.inl index eb02085031..40b33e0acc 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.inl @@ -29,7 +29,7 @@ namespace iox namespace mepoo { template -constexpr access_control MePooSegment::SEGMENT_PERMISSIONS; +constexpr access_rights MePooSegment::SEGMENT_PERMISSIONS; template inline MePooSegment::MePooSegment( diff --git a/iceoryx_posh/include/iceoryx_posh/internal/runtime/shared_memory_user.hpp b/iceoryx_posh/include/iceoryx_posh/internal/runtime/shared_memory_user.hpp index ebbf0ad0dd..93946c60d9 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/runtime/shared_memory_user.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/runtime/shared_memory_user.hpp @@ -49,7 +49,7 @@ class SharedMemoryUser private: optional m_shmObject; vector m_dataShmObjects; - static constexpr access_control SHM_SEGMENT_PERMISSIONS = + static constexpr access_rights SHM_SEGMENT_PERMISSIONS = perms::owner_read | perms::owner_write | perms::group_read | perms::group_write; }; diff --git a/iceoryx_posh/include/iceoryx_posh/roudi/memory/posix_shm_memory_provider.hpp b/iceoryx_posh/include/iceoryx_posh/roudi/memory/posix_shm_memory_provider.hpp index 72c0878e42..dd6b6fcc03 100644 --- a/iceoryx_posh/include/iceoryx_posh/roudi/memory/posix_shm_memory_provider.hpp +++ b/iceoryx_posh/include/iceoryx_posh/roudi/memory/posix_shm_memory_provider.hpp @@ -66,7 +66,7 @@ class PosixShmMemoryProvider : public MemoryProvider posix::OpenMode m_openMode{posix::OpenMode::OPEN_EXISTING}; optional m_shmObject; - static constexpr access_control SHM_MEMORY_PERMISSIONS = + static constexpr access_rights SHM_MEMORY_PERMISSIONS = perms::owner_read | perms::owner_write | perms::group_read | perms::group_write; }; diff --git a/iceoryx_posh/source/roudi/memory/posix_shm_memory_provider.cpp b/iceoryx_posh/source/roudi/memory/posix_shm_memory_provider.cpp index fdadb84c0a..3d19e364a8 100644 --- a/iceoryx_posh/source/roudi/memory/posix_shm_memory_provider.cpp +++ b/iceoryx_posh/source/roudi/memory/posix_shm_memory_provider.cpp @@ -27,7 +27,7 @@ namespace iox { namespace roudi { -constexpr access_control PosixShmMemoryProvider::SHM_MEMORY_PERMISSIONS; +constexpr access_rights PosixShmMemoryProvider::SHM_MEMORY_PERMISSIONS; PosixShmMemoryProvider::PosixShmMemoryProvider(const ShmName_t& shmName, const posix::AccessMode accessMode, diff --git a/iceoryx_posh/source/runtime/shared_memory_user.cpp b/iceoryx_posh/source/runtime/shared_memory_user.cpp index cf8cd073dc..bb4a309c74 100644 --- a/iceoryx_posh/source/runtime/shared_memory_user.cpp +++ b/iceoryx_posh/source/runtime/shared_memory_user.cpp @@ -25,7 +25,7 @@ namespace iox { namespace runtime { -constexpr access_control SharedMemoryUser::SHM_SEGMENT_PERMISSIONS; +constexpr access_rights SharedMemoryUser::SHM_SEGMENT_PERMISSIONS; SharedMemoryUser::SharedMemoryUser(const size_t topicSize, const uint64_t segmentId, diff --git a/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp b/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp index c2dadc3ace..f7f614d961 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp @@ -49,13 +49,13 @@ class MePooSegment_test : public Test const iox::posix::AccessMode, const iox::posix::OpenMode, const void*, - const iox::access_control)>; + const iox::access_rights)>; SharedMemoryObject_MOCK(const SharedMemory::Name_t& name, const uint64_t memorySizeInBytes, const AccessMode accessMode, const OpenMode openMode, const void* baseAddressHint, - const iox::access_control permissions) + const iox::access_rights permissions) : m_memorySizeInBytes(memorySizeInBytes) , m_baseAddressHint(const_cast(baseAddressHint)) { @@ -121,7 +121,7 @@ class MePooSegment_test : public Test IOX_BUILDER_PARAMETER(iox::optional, baseAddressHint, iox::nullopt) - IOX_BUILDER_PARAMETER(iox::access_control, permissions, iox::perms::none) + IOX_BUILDER_PARAMETER(iox::access_rights, permissions, iox::perms::none) public: iox::expected create() noexcept @@ -174,7 +174,7 @@ TEST_F(MePooSegment_test, SharedMemoryCreationParameter) const iox::posix::AccessMode f_accessMode, const iox::posix::OpenMode openMode, const void*, - const iox::access_control) { + const iox::access_rights) { EXPECT_THAT(f_name, Eq(SharedMemory::Name_t("iox_roudi_test2"))); EXPECT_THAT(f_accessMode, Eq(iox::posix::AccessMode::READ_WRITE)); EXPECT_THAT(openMode, Eq(iox::posix::OpenMode::PURGE_AND_CREATE)); @@ -195,7 +195,7 @@ TEST_F(MePooSegment_test, GetSharedMemoryObject) const iox::posix::AccessMode, const iox::posix::OpenMode, const void*, - const iox::access_control) { + const iox::access_rights) { memorySizeInBytes = f_memorySizeInBytes; }; SUT sut{mepooConfig, m_managementAllocator, PosixGroup{"iox_roudi_test1"}, PosixGroup{"iox_roudi_test2"}};