diff --git a/doc/design/error-handling.md b/doc/design/error-handling.md index ffdfbd4d37a..f63513405ae 100644 --- a/doc/design/error-handling.md +++ b/doc/design/error-handling.md @@ -217,7 +217,7 @@ int32_t myAlgorithm(int32_t* ptr) { } ``` -Note that in the case of ``nullptr`` checks it is also an option to use references in arguments (or ``not_null`` if it is supposed to be stored since references are not copyable). It should be considered that ``not_null`` incurs a runtime cost, which may be undesirable. +Note that in the case of ``nullptr`` checks it is also an option to use references in arguments (or ``iox::not_null`` if it is supposed to be stored since references are not copyable). It should be considered that ``iox::not_null`` incurs a runtime cost, which may be undesirable. When Expects and Ensures are implemented to leave no trace in release mode, we do not incur a runtime cost using them. For this reason, it is advised to use them to document and verify assumptions where appropriate. ### `expected` diff --git a/doc/website/release-notes/iceoryx-unreleased.md b/doc/website/release-notes/iceoryx-unreleased.md index d29715c65ad..0e22f52854b 100644 --- a/doc/website/release-notes/iceoryx-unreleased.md +++ b/doc/website/release-notes/iceoryx-unreleased.md @@ -418,7 +418,7 @@ std::cout << SOME_ENUM_STRINGS[static_cast(someEnum)] << std::endl; ``` -17. Replace `strlen2` with more generic `arrayCapacity` +17. Replace `strlen2` with more generic `iox::size` ```cpp constexpr const char LITERAL1[] {"FOO"}; @@ -430,9 +430,9 @@ std::cout << iox::cxx::strlen2(LITERAL2) << std::endl; // prints 19 // after - std::cout << arrayCapacity(LITERAL1) << std::endl; // prints 4 - std::cout << arrayCapacity(LITERAL2) << std::endl; // prints 20 - std::cout << arrayCapacity(ARRAY) << std::endl; // prints 42 + std::cout << iox::size(LITERAL1) << std::endl; // prints 4 + std::cout << iox::size(LITERAL2) << std::endl; // prints 20 + std::cout << iox::size(ARRAY) << std::endl; // prints 42 ``` 18. Rename `cxx::GenericRAII` to `cxx::ScopeGuard` diff --git a/iceoryx_examples/iceperf/uds.cpp b/iceoryx_examples/iceperf/uds.cpp index 0bee67ac2af..645843f0918 100644 --- a/iceoryx_examples/iceperf/uds.cpp +++ b/iceoryx_examples/iceperf/uds.cpp @@ -16,9 +16,9 @@ // SPDX-License-Identifier: Apache-2.0 #include "uds.hpp" -#include "iceoryx_hoofs/cxx/helplets.hpp" #include "iceoryx_hoofs/cxx/requires.hpp" #include "iceoryx_hoofs/posix_wrapper/posix_call.hpp" +#include "iox/size.hpp" #include #include @@ -36,7 +36,7 @@ void UDS::initSocketAddress(sockaddr_un& socketAddr, const std::string& socketNa memset(&socketAddr, 0, sizeof(sockaddr_un)); socketAddr.sun_family = AF_LOCAL; constexpr uint64_t NULL_TERMINATION_SIZE{1}; - const uint64_t maxDestinationLength = iox::cxx::arrayCapacity(socketAddr.sun_path) - NULL_TERMINATION_SIZE; + const uint64_t maxDestinationLength = iox::size(socketAddr.sun_path) - NULL_TERMINATION_SIZE; iox::cxx::Ensures(maxDestinationLength >= socketName.size() && "Socketname too large!"); strncpy(socketAddr.sun_path, socketName.c_str(), socketName.size()); } diff --git a/iceoryx_hoofs/BUILD.bazel b/iceoryx_hoofs/BUILD.bazel index 35a14c20cd5..c1ccc87dbbe 100644 --- a/iceoryx_hoofs/BUILD.bazel +++ b/iceoryx_hoofs/BUILD.bazel @@ -35,7 +35,7 @@ cc_library( "source/**/*.hpp", "memory/source/*.cpp", ]), - hdrs = glob(["include/**"]) + glob(["legacy/**"]) + glob(["memory/**"]) + glob(["container/**"]) + glob(["vocabulary/**"]) + glob(["utility/**"]) + [ + hdrs = glob(["include/**"]) + glob(["legacy/**"]) + glob(["memory/**"]) + glob(["container/**"]) + glob(["vocabulary/**"]) + glob(["utility/**"]) + glob(["primitives/**"]) + [ ":iceoryx_hoofs_deployment_hpp", ], includes = [ @@ -43,6 +43,7 @@ cc_library( "include/", "legacy/include/", "memory/include/", + "primitives/include/", "utility/include/", "vocabulary/include/", ], diff --git a/iceoryx_hoofs/CMakeLists.txt b/iceoryx_hoofs/CMakeLists.txt index 49b87442c86..a4d632e65bc 100644 --- a/iceoryx_hoofs/CMakeLists.txt +++ b/iceoryx_hoofs/CMakeLists.txt @@ -52,6 +52,7 @@ iox_add_library( ${PROJECT_SOURCE_DIR}/container/include ${PROJECT_SOURCE_DIR}/vocabulary/include ${PROJECT_SOURCE_DIR}/utility/include + ${PROJECT_SOURCE_DIR}/primitives/include ${CMAKE_BINARY_DIR}/generated/iceoryx_hoofs/include INSTALL_INTERFACE include/${PREFIX} EXPORT_INCLUDE_DIRS include/ @@ -60,6 +61,7 @@ iox_add_library( container/include/ vocabulary/include/ utility/include/ + primitives/include/ FILES source/concurrent/loffli.cpp source/cxx/adaptive_wait.cpp diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/loffli.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/loffli.hpp index daed94d9187..5a99b556321 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/loffli.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/loffli.hpp @@ -17,8 +17,8 @@ #ifndef IOX_HOOFS_CONCURRENT_LOFFLI_HPP #define IOX_HOOFS_CONCURRENT_LOFFLI_HPP -#include "iceoryx_hoofs/cxx/helplets.hpp" #include "iceoryx_hoofs/memory/relative_pointer.hpp" +#include "iox/not_null.hpp" #include #include @@ -80,7 +80,7 @@ class LoFFLi /// Initializes the lock-free free-list /// @param [in] freeIndicesMemory pointer to a memory with the capacity calculated by requiredMemorySize() /// @param [in] capacity is the number of elements of the free-list; must be the same used at requiredMemorySize() - void init(cxx::not_null freeIndicesMemory, const uint32_t capacity) noexcept; + void init(not_null freeIndicesMemory, const uint32_t capacity) noexcept; /// Pop a value from the free-list /// @param [out] index for an element to use diff --git a/iceoryx_hoofs/primitives/include/iox/size.hpp b/iceoryx_hoofs/primitives/include/iox/size.hpp new file mode 100644 index 00000000000..5fbf3faa009 --- /dev/null +++ b/iceoryx_hoofs/primitives/include/iox/size.hpp @@ -0,0 +1,42 @@ +// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. +// Copyright (c) 2021 - 2022 by Apex.AI Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 +#ifndef IOX_HOOFS_PRIMITIVES_SIZE_HPP +#define IOX_HOOFS_PRIMITIVES_SIZE_HPP + +#include + +namespace iox +{ +/// @brief Get the capacity of a C array at compile time +/// @code +/// constexpr uint32_t FOO[42]{}; +/// IOX_LOG(INFO) << size(FOO); // will print 42 +/// @endcode +/// @tparam T the type of the array filled out by the compiler. +/// @tparam CapacityValue the capacity of the array filled out by the compiler. +/// @param[in] The actual content of the array is not of interest. Its just the capacity of the array that matters. +/// @return Returns the capacity of the array at compile time. +template +// AXIVION Next Construct AutosarC++19_03-A18.1.1:returning capacity of C array at compile time is safe, no +// possibility of out of bounds access +// NOLINTNEXTLINE(hicpp-avoid-c-arrays,cppcoreguidelines-avoid-c-arrays) +static constexpr uint64_t size(T const (&/*notInterested*/)[CapacityValue]) noexcept +{ + return CapacityValue; +} +} // namespace iox +#endif // IOX_HOOFS_PRIMITIVES_SIZE_HPP diff --git a/iceoryx_hoofs/source/concurrent/loffli.cpp b/iceoryx_hoofs/source/concurrent/loffli.cpp index d9971e350d6..72ceaa8827d 100644 --- a/iceoryx_hoofs/source/concurrent/loffli.cpp +++ b/iceoryx_hoofs/source/concurrent/loffli.cpp @@ -23,7 +23,7 @@ namespace iox { namespace concurrent { -void LoFFLi::init(cxx::not_null freeIndicesMemory, const uint32_t capacity) noexcept +void LoFFLi::init(not_null freeIndicesMemory, const uint32_t capacity) noexcept { cxx::Expects(capacity > 0 && "A capacity of 0 is not supported!"); constexpr uint32_t INTERNALLY_RESERVED_INDICES{1U}; diff --git a/iceoryx_hoofs/test/moduletests/test_cxx_helplets.cpp b/iceoryx_hoofs/test/moduletests/test_primitives_size.cpp similarity index 83% rename from iceoryx_hoofs/test/moduletests/test_cxx_helplets.cpp rename to iceoryx_hoofs/test/moduletests/test_primitives_size.cpp index 49b53cd3252..4f8a97f6627 100644 --- a/iceoryx_hoofs/test/moduletests/test_cxx_helplets.cpp +++ b/iceoryx_hoofs/test/moduletests/test_primitives_size.cpp @@ -15,17 +15,14 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_hoofs/cxx/helplets.hpp" -#include "iox/string.hpp" +#include "iox/size.hpp" #include "test.hpp" -#include - namespace { using namespace ::testing; -class Helplets_test : public Test +class Size_test : public Test { public: void SetUp() override @@ -37,7 +34,7 @@ class Helplets_test : public Test } }; -TEST_F(Helplets_test, ArrayCapacityReturnsCorrectValues) +TEST_F(Size_test, ArrayCapacityReturnsCorrectValues) { ::testing::Test::RecordProperty("TEST_ID", "8392b2ba-04ef-45e6-8b47-4c0c90d98f61"); constexpr uint64_t CAPACITY{42}; @@ -45,7 +42,7 @@ TEST_F(Helplets_test, ArrayCapacityReturnsCorrectValues) // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays) constexpr uint32_t SUT[CAPACITY]{}; - EXPECT_EQ(iox::cxx::arrayCapacity(SUT), CAPACITY); + EXPECT_EQ(iox::size(SUT), CAPACITY); } } // namespace diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp b/iceoryx_hoofs/vocabulary/include/iox/not_null.hpp similarity index 58% rename from iceoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp rename to iceoryx_hoofs/vocabulary/include/iox/not_null.hpp index d092a238aec..4fb66daa12b 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp +++ b/iceoryx_hoofs/vocabulary/include/iox/not_null.hpp @@ -14,16 +14,12 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 -#ifndef IOX_HOOFS_CXX_HELPLETS_HPP -#define IOX_HOOFS_CXX_HELPLETS_HPP +#ifndef IOX_HOOFS_VOCABULARY_NOT_NULL_HPP +#define IOX_HOOFS_VOCABULARY_NOT_NULL_HPP #include "iceoryx_hoofs/cxx/type_traits.hpp" -#include "iox/string.hpp" - namespace iox { -namespace cxx -{ template ::value, void>::type> struct not_null { @@ -34,7 +30,7 @@ struct not_null not_null(T t) noexcept : m_value(t) { - Expects(t != nullptr); + cxx::Expects(t != nullptr); } // AXIVION Next Construct AutosarC++19_03-A13.5.2,AutosarC++19_03-A13.5.3:this should behave like a pointer which never can be nullptr, @@ -48,25 +44,5 @@ struct not_null private: T m_value; }; - -/// @brief Get the capacity of a C array at compile time -/// @code -/// constexpr uint32_t FOO[42]{}; -/// IOX_LOG(INFO) << arrayCapacity(FOO); // will print 42 -/// @endcode -/// @tparam T the type of the array filled out by the compiler. -/// @tparam CapacityValue the capacity of the array filled out by the compiler. -/// @param[in] The actual content of the array is not of interest. Its just the capacity of the array that matters. -/// @return Returns the capacity of the array at compile time. -template -// AXIVION Next Construct AutosarC++19_03-A18.1.1:returning capacity of C array at compile time is safe, no -// possibility of out of bounds access -// NOLINTNEXTLINE(hicpp-avoid-c-arrays,cppcoreguidelines-avoid-c-arrays) -static constexpr uint64_t arrayCapacity(T const (&/*notInterested*/)[CapacityValue]) noexcept -{ - return CapacityValue; -} -} // namespace cxx } // namespace iox - -#endif // IOX_HOOFS_CXX_HELPLETS_HPP +#endif // IOX_HOOFS_VOCABULARY_NOT_NULL_HPP diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/chunk_management.hpp b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/chunk_management.hpp index 8a79f5d4bf4..7eee892fc88 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/chunk_management.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/chunk_management.hpp @@ -17,8 +17,8 @@ #ifndef IOX_POSH_MEPOO_CHUNK_MANAGEMENT_HPP #define IOX_POSH_MEPOO_CHUNK_MANAGEMENT_HPP -#include "iceoryx_hoofs/cxx/helplets.hpp" #include "iceoryx_hoofs/memory/relative_pointer.hpp" +#include "iox/not_null.hpp" #include #include @@ -36,9 +36,9 @@ struct ChunkManagement using referenceCounterBase_t = uint64_t; using referenceCounter_t = std::atomic; - ChunkManagement(const cxx::not_null chunkHeader, - const cxx::not_null mempool, - const cxx::not_null chunkManagementPool) noexcept; + ChunkManagement(const not_null chunkHeader, + const not_null mempool, + const not_null chunkManagementPool) noexcept; iox::memory::RelativePointer m_chunkHeader; referenceCounter_t m_referenceCounter{1U}; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.hpp index c1c9cee76dc..e68611c4970 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.hpp @@ -22,6 +22,7 @@ #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp" #include "iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.hpp" #include "iceoryx_posh/internal/popo/building_blocks/chunk_queue_pusher.hpp" +#include "iox/not_null.hpp" #include @@ -66,7 +67,7 @@ class ChunkDistributor using ChunkQueueData_t = typename ChunkDistributorDataType::ChunkQueueData_t; using ChunkQueuePusher_t = typename ChunkDistributorDataType::ChunkQueuePusher_t; - explicit ChunkDistributor(cxx::not_null chunkDistrubutorDataPtr) noexcept; + explicit ChunkDistributor(not_null chunkDistrubutorDataPtr) noexcept; ChunkDistributor(const ChunkDistributor& other) = delete; ChunkDistributor& operator=(const ChunkDistributor&) = delete; @@ -80,13 +81,13 @@ class ChunkDistributor /// @param[in] requestedHistory number of last chunks from history to send if available. If history size is smaller /// then the available history size chunks are provided /// @return if the queue could be added it returns success, otherwiese a ChunkDistributor error - expected tryAddQueue(cxx::not_null queueToAdd, + expected tryAddQueue(not_null queueToAdd, const uint64_t requestedHistory = 0U) noexcept; /// @brief Remove a queue from the internal list of chunk queues /// @param[in] queueToRemove is the queue to remove from the list /// @return if the queue could be removed it returns success, otherwiese a ChunkDistributor error - expected tryRemoveQueue(cxx::not_null queueToRemove) noexcept; + expected tryRemoveQueue(not_null queueToRemove) noexcept; /// @brief Delete all the stored chunk queues void removeAllQueues() noexcept; @@ -142,7 +143,7 @@ class ChunkDistributor const MemberType_t* getMembers() const noexcept; MemberType_t* getMembers() noexcept; - bool pushToQueue(cxx::not_null queue, mepoo::SharedChunk chunk) noexcept; + bool pushToQueue(not_null queue, mepoo::SharedChunk chunk) noexcept; private: MemberType_t* m_chunkDistrubutorDataPtr{nullptr}; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.inl index 5f306617983..006dd0139d3 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.inl @@ -25,7 +25,7 @@ namespace popo { template inline ChunkDistributor::ChunkDistributor( - cxx::not_null chunkDistrubutorDataPtr) noexcept + not_null chunkDistrubutorDataPtr) noexcept : m_chunkDistrubutorDataPtr(chunkDistrubutorDataPtr) { } @@ -46,7 +46,7 @@ ChunkDistributor::getMembers() noexcept template inline expected -ChunkDistributor::tryAddQueue(cxx::not_null queueToAdd, +ChunkDistributor::tryAddQueue(not_null queueToAdd, const uint64_t requestedHistory) noexcept { typename MemberType_t::LockGuard_t lock(*getMembers()); @@ -98,8 +98,8 @@ ChunkDistributor::tryAddQueue(cxx::not_null -inline expected ChunkDistributor::tryRemoveQueue( - cxx::not_null queueToRemove) noexcept +inline expected +ChunkDistributor::tryRemoveQueue(not_null queueToRemove) noexcept { typename MemberType_t::LockGuard_t lock(*getMembers()); @@ -219,7 +219,7 @@ inline uint64_t ChunkDistributor::deliverToAllStoredQu } template -inline bool ChunkDistributor::pushToQueue(cxx::not_null queue, +inline bool ChunkDistributor::pushToQueue(not_null queue, mepoo::SharedChunk chunk) noexcept { return ChunkQueuePusher_t(queue).push(chunk); diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_popper.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_popper.hpp index 017814b5cef..51404cd5f99 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_popper.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_popper.hpp @@ -20,6 +20,7 @@ #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp" #include "iceoryx_posh/internal/popo/building_blocks/chunk_queue_data.hpp" #include "iceoryx_posh/internal/popo/building_blocks/condition_notifier.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" namespace iox @@ -37,7 +38,7 @@ class ChunkQueuePopper public: using MemberType_t = ChunkQueueDataType; - explicit ChunkQueuePopper(cxx::not_null chunkQueueDataPtr) noexcept; + explicit ChunkQueuePopper(not_null chunkQueueDataPtr) noexcept; ChunkQueuePopper(const ChunkQueuePopper& other) = delete; ChunkQueuePopper& operator=(const ChunkQueuePopper&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_popper.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_popper.inl index 2c3fcf4f8ca..29a98330811 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_popper.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_popper.inl @@ -25,8 +25,7 @@ namespace iox namespace popo { template -inline ChunkQueuePopper::ChunkQueuePopper( - cxx::not_null chunkQueueDataPtr) noexcept +inline ChunkQueuePopper::ChunkQueuePopper(not_null chunkQueueDataPtr) noexcept : m_chunkQueueDataPtr(chunkQueueDataPtr) { } diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_pusher.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_pusher.hpp index c56e1fcb9d9..56c32bd4547 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_pusher.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_pusher.hpp @@ -21,6 +21,7 @@ #include "iceoryx_posh/internal/popo/building_blocks/chunk_queue_data.hpp" #include "iceoryx_posh/internal/popo/building_blocks/condition_notifier.hpp" #include "iox/expected.hpp" +#include "iox/not_null.hpp" namespace iox { @@ -36,7 +37,7 @@ class ChunkQueuePusher public: using MemberType_t = ChunkQueueDataType; - explicit ChunkQueuePusher(cxx::not_null chunkQueueDataPtr) noexcept; + explicit ChunkQueuePusher(not_null chunkQueueDataPtr) noexcept; ChunkQueuePusher(const ChunkQueuePusher& other) = delete; ChunkQueuePusher& operator=(const ChunkQueuePusher&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_pusher.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_pusher.inl index 3798e4c5eed..65faf6facae 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_pusher.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_pusher.inl @@ -23,8 +23,7 @@ namespace iox namespace popo { template -inline ChunkQueuePusher::ChunkQueuePusher( - cxx::not_null chunkQueueDataPtr) noexcept +inline ChunkQueuePusher::ChunkQueuePusher(not_null chunkQueueDataPtr) noexcept : m_chunkQueueDataPtr(chunkQueueDataPtr) { } diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp index 95a6a65a0a0..6737600c171 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp @@ -21,6 +21,7 @@ #include "iceoryx_posh/internal/popo/building_blocks/chunk_receiver_data.hpp" #include "iceoryx_posh/mepoo/chunk_header.hpp" #include "iox/expected.hpp" +#include "iox/not_null.hpp" namespace iox { @@ -62,7 +63,7 @@ class ChunkReceiver : public ChunkQueuePopper; - explicit ChunkReceiver(cxx::not_null chunkReceiverDataPtr) noexcept; + explicit ChunkReceiver(not_null chunkReceiverDataPtr) noexcept; ChunkReceiver(const ChunkReceiver& other) = delete; ChunkReceiver& operator=(const ChunkReceiver&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.inl index cf29a5b63bd..a58c10bc911 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.inl @@ -50,8 +50,7 @@ inline log::LogStream& operator<<(log::LogStream& stream, ChunkReceiveResult val } template -inline ChunkReceiver::ChunkReceiver( - cxx::not_null chunkReceiverDataPtr) noexcept +inline ChunkReceiver::ChunkReceiver(not_null chunkReceiverDataPtr) noexcept : Base_t(static_cast(chunkReceiverDataPtr)) { } diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp index dde21227f3c..c513c3141f8 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp @@ -26,6 +26,7 @@ #include "iceoryx_posh/mepoo/chunk_header.hpp" #include "iox/expected.hpp" #include "iox/into.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" namespace iox @@ -78,7 +79,7 @@ class ChunkSender : public ChunkDistributor; - explicit ChunkSender(cxx::not_null chunkSenderDataPtr) noexcept; + explicit ChunkSender(not_null chunkSenderDataPtr) noexcept; ChunkSender(const ChunkSender& other) = delete; ChunkSender& operator=(const ChunkSender&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.inl index afe348dbe22..000cbd01ee6 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.inl @@ -75,7 +75,7 @@ inline log::LogStream& operator<<(log::LogStream& stream, AllocationError value) } template -inline ChunkSender::ChunkSender(cxx::not_null chunkSenderDataPtr) noexcept +inline ChunkSender::ChunkSender(not_null chunkSenderDataPtr) noexcept : Base_t(static_cast(chunkSenderDataPtr)) { } diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.hpp index 77292deeac8..7cf2b28674e 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.hpp @@ -23,6 +23,7 @@ #include "iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.hpp" #include "iceoryx_posh/internal/popo/used_chunk_list.hpp" #include "iceoryx_posh/mepoo/memory_info.hpp" +#include "iox/not_null.hpp" namespace iox { @@ -31,7 +32,7 @@ namespace popo template struct ChunkSenderData : public ChunkDistributorDataType { - explicit ChunkSenderData(cxx::not_null memoryManager, + explicit ChunkSenderData(not_null memoryManager, const ConsumerTooSlowPolicy consumerTooSlowPolicy, const uint64_t historyCapacity = 0U, const mepoo::MemoryInfo& memoryInfo = mepoo::MemoryInfo()) noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.inl index 69a05ea3dff..53952310acd 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.inl @@ -23,7 +23,7 @@ namespace popo { template inline ChunkSenderData::ChunkSenderData( - cxx::not_null memoryManager, + not_null memoryManager, const ConsumerTooSlowPolicy consumerTooSlowPolicy, const uint64_t historyCapacity, const mepoo::MemoryInfo& memoryInfo) noexcept diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/publisher_port_roudi.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/publisher_port_roudi.hpp index 17dad24c29c..b93dcd15082 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/publisher_port_roudi.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/publisher_port_roudi.hpp @@ -22,6 +22,7 @@ #include "iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp" #include "iceoryx_posh/internal/popo/ports/base_port.hpp" #include "iceoryx_posh/internal/popo/ports/publisher_port_data.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" namespace iox @@ -37,7 +38,7 @@ class PublisherPortRouDi : public BasePort public: using MemberType_t = PublisherPortData; - explicit PublisherPortRouDi(cxx::not_null publisherPortDataPtr) noexcept; + explicit PublisherPortRouDi(not_null publisherPortDataPtr) noexcept; PublisherPortRouDi(const PublisherPortRouDi& other) = delete; PublisherPortRouDi& operator=(const PublisherPortRouDi&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/publisher_port_user.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/publisher_port_user.hpp index 34a3f2e1140..a045948e82d 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/publisher_port_user.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/publisher_port_user.hpp @@ -23,6 +23,7 @@ #include "iceoryx_posh/internal/popo/ports/publisher_port_data.hpp" #include "iceoryx_posh/mepoo/chunk_header.hpp" #include "iox/expected.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" namespace iox @@ -38,7 +39,7 @@ class PublisherPortUser : public BasePort public: using MemberType_t = PublisherPortData; - explicit PublisherPortUser(cxx::not_null publisherPortDataPtr) noexcept; + explicit PublisherPortUser(not_null publisherPortDataPtr) noexcept; PublisherPortUser(const PublisherPortUser& other) = delete; PublisherPortUser& operator=(const PublisherPortUser&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_multi_producer.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_multi_producer.hpp index cdefa58771d..7498ae2bd51 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_multi_producer.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_multi_producer.hpp @@ -19,6 +19,7 @@ #include "iceoryx_posh/internal/capro/capro_message.hpp" #include "iceoryx_posh/internal/popo/ports/subscriber_port_roudi.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" namespace iox @@ -33,7 +34,7 @@ class SubscriberPortMultiProducer : public SubscriberPortRouDi public: using MemberType_t = SubscriberPortData; - explicit SubscriberPortMultiProducer(cxx::not_null publisherPortDataPtr) noexcept; + explicit SubscriberPortMultiProducer(not_null publisherPortDataPtr) noexcept; SubscriberPortMultiProducer(const SubscriberPortMultiProducer& other) = delete; SubscriberPortMultiProducer& operator=(const SubscriberPortMultiProducer&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_roudi.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_roudi.hpp index c1330bfdfb8..4972e8563dd 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_roudi.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_roudi.hpp @@ -22,6 +22,7 @@ #include "iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp" #include "iceoryx_posh/internal/popo/ports/base_port.hpp" #include "iceoryx_posh/internal/popo/ports/subscriber_port_data.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" namespace iox @@ -37,7 +38,7 @@ class SubscriberPortRouDi : public BasePort public: using MemberType_t = SubscriberPortData; - explicit SubscriberPortRouDi(cxx::not_null subscriberPortDataPtr) noexcept; + explicit SubscriberPortRouDi(not_null subscriberPortDataPtr) noexcept; SubscriberPortRouDi(const SubscriberPortRouDi& other) = delete; SubscriberPortRouDi& operator=(const SubscriberPortRouDi&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_single_producer.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_single_producer.hpp index b90b2837fa2..abd4336e176 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_single_producer.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_single_producer.hpp @@ -19,6 +19,7 @@ #include "iceoryx_posh/internal/capro/capro_message.hpp" #include "iceoryx_posh/internal/popo/ports/subscriber_port_roudi.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" namespace iox @@ -33,7 +34,7 @@ class SubscriberPortSingleProducer : public SubscriberPortRouDi public: using MemberType_t = SubscriberPortData; - explicit SubscriberPortSingleProducer(cxx::not_null publisherPortDataPtr) noexcept; + explicit SubscriberPortSingleProducer(not_null publisherPortDataPtr) noexcept; SubscriberPortSingleProducer(const SubscriberPortSingleProducer& other) = delete; SubscriberPortSingleProducer& operator=(const SubscriberPortSingleProducer&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp index 3c36870ede2..653b7ef7351 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp @@ -24,6 +24,7 @@ #include "iceoryx_posh/mepoo/chunk_header.hpp" #include "iceoryx_posh/popo/subscriber_options.hpp" #include "iox/expected.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" namespace iox @@ -40,7 +41,7 @@ class SubscriberPortUser : public BasePort public: using MemberType_t = SubscriberPortData; - explicit SubscriberPortUser(cxx::not_null subscriberPortDataPtr) noexcept; + explicit SubscriberPortUser(not_null subscriberPortDataPtr) noexcept; SubscriberPortUser(const SubscriberPortUser& other) = delete; SubscriberPortUser& operator=(const SubscriberPortUser&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_collection_memory_block.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_collection_memory_block.hpp index 45b8f033f12..e9beaa81797 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_collection_memory_block.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_collection_memory_block.hpp @@ -21,6 +21,7 @@ #include "iceoryx_posh/mepoo/mepoo_config.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" #include @@ -61,7 +62,7 @@ class MemPoolCollectionMemoryBlock final : public MemoryBlock protected: /// @copydoc MemoryBlock::onMemoryAvailable /// @note This will create the MemPools at the location `memory` points to - void onMemoryAvailable(cxx::not_null memory) noexcept override; + void onMemoryAvailable(not_null memory) noexcept override; /// @copydoc MemoryBlock::destroy /// @note This will clean up the MemPools diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_segment_manager_memory_block.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_segment_manager_memory_block.hpp index fb0380e7fe6..510f60acb9d 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_segment_manager_memory_block.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_segment_manager_memory_block.hpp @@ -22,6 +22,7 @@ #include "iceoryx_posh/internal/mepoo/segment_manager.hpp" #include "iceoryx_posh/mepoo/segment_config.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" #include @@ -56,7 +57,7 @@ class MemPoolSegmentManagerMemoryBlock : public MemoryBlock protected: /// @copydoc MemoryBlock::onMemoryAvailable /// @note This will create the SegmentManager at the location `memory` points to - void onMemoryAvailable(cxx::not_null memory) noexcept override; + void onMemoryAvailable(not_null memory) noexcept override; /// @copydoc MemoryBlock::destroy /// @note This will clean up the SegmentManager diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/port_pool_memory_block.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/port_pool_memory_block.hpp index 266875bf4bc..7e2d37dc39b 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/port_pool_memory_block.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/port_pool_memory_block.hpp @@ -20,6 +20,7 @@ #include "iceoryx_posh/internal/roudi/port_pool_data.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" #include "iceoryx_posh/roudi/memory/memory_block.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" #include @@ -56,7 +57,7 @@ class PortPoolMemoryBlock : public MemoryBlock protected: /// @copydoc MemoryBlock::onMemoryAvailable /// @note This will create the ports at the location `memory` points to - void onMemoryAvailable(cxx::not_null memory) noexcept override; + void onMemoryAvailable(not_null memory) noexcept override; /// @copydoc MemoryBlock::destroy /// @note This will clean up the ports diff --git a/iceoryx_posh/include/iceoryx_posh/roudi/memory/memory_block.hpp b/iceoryx_posh/include/iceoryx_posh/roudi/memory/memory_block.hpp index c33b5a344e9..3d91bcb62a2 100644 --- a/iceoryx_posh/include/iceoryx_posh/roudi/memory/memory_block.hpp +++ b/iceoryx_posh/include/iceoryx_posh/roudi/memory/memory_block.hpp @@ -17,7 +17,7 @@ #ifndef IOX_POSH_ROUDI_MEMORY_MEMORY_BLOCK_HPP #define IOX_POSH_ROUDI_MEMORY_MEMORY_BLOCK_HPP -#include "iceoryx_hoofs/cxx/helplets.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" #include @@ -68,7 +68,7 @@ class MemoryBlock /// @brief This function is called once the memory is available and is therefore the earliest possibility to use the /// memory. /// @param [in] memory pointer to a valid memory block, the same one that the memory() member function would return - virtual void onMemoryAvailable(cxx::not_null memory) noexcept; + virtual void onMemoryAvailable(not_null memory) noexcept; private: void* m_memory{nullptr}; diff --git a/iceoryx_posh/include/iceoryx_posh/roudi/memory/memory_provider.hpp b/iceoryx_posh/include/iceoryx_posh/roudi/memory/memory_provider.hpp index b04b5493845..67d4a21c0ae 100644 --- a/iceoryx_posh/include/iceoryx_posh/roudi/memory/memory_provider.hpp +++ b/iceoryx_posh/include/iceoryx_posh/roudi/memory/memory_provider.hpp @@ -19,9 +19,9 @@ #include "iceoryx_posh/iceoryx_posh_types.hpp" -#include "iceoryx_hoofs/cxx/helplets.hpp" #include "iceoryx_hoofs/cxx/vector.hpp" #include "iox/expected.hpp" +#include "iox/not_null.hpp" #include "iox/optional.hpp" #include @@ -84,7 +84,7 @@ class MemoryProvider /// @param [in] memoryBlock is a pointer to a user defined MemoryBlock /// @return an MemoryProviderError::MEMORY_BLOCKS_EXHAUSTED error if no further memory blocks can be added, /// otherwise success - expected addMemoryBlock(cxx::not_null memoryBlock) noexcept; + expected addMemoryBlock(not_null memoryBlock) noexcept; /// @brief With this call the memory requested by the MemoryBlocks need to be created. The function should be called /// from a MemoryManager which handles one or more MemoryProvider diff --git a/iceoryx_posh/include/iceoryx_posh/version/version_info.hpp b/iceoryx_posh/include/iceoryx_posh/version/version_info.hpp index ccba5a1dbc1..7d506ee4331 100644 --- a/iceoryx_posh/include/iceoryx_posh/version/version_info.hpp +++ b/iceoryx_posh/include/iceoryx_posh/version/version_info.hpp @@ -18,10 +18,10 @@ #define IOX_POSH_VERSION_VERSION_INFO_HPP #include "iceoryx_dust/cxx/serialization.hpp" -#include "iceoryx_hoofs/cxx/helplets.hpp" #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "iceoryx_posh/version/compatibility_check_level.hpp" #include "iceoryx_versions.hpp" +#include "iox/size.hpp" #include "iox/string.hpp" #include @@ -85,7 +85,7 @@ class VersionInfo static_assert(COMMIT_ID_STRING_SIZE <= SERIALIZATION_STRING_SIZE, "CommitId needs to transfered completely."); static_assert(COMMIT_ID_STRING_SIZE <= BUILD_DATE_STRING_SIZE, "BuildDate needs to transfered completely."); static constexpr uint64_t NULL_TERMINATION_SIZE{1}; - static_assert((cxx::arrayCapacity(ICEORYX_BUILDDATE) - NULL_TERMINATION_SIZE) < BUILD_DATE_STRING_SIZE, + static_assert((size(ICEORYX_BUILDDATE) - NULL_TERMINATION_SIZE) < BUILD_DATE_STRING_SIZE, "COMMIT_BUILD_DATE_STRING_SIZE needs to be bigger."); protected: diff --git a/iceoryx_posh/source/mepoo/chunk_management.cpp b/iceoryx_posh/source/mepoo/chunk_management.cpp index 8b7cfd03d2a..19c908dfc92 100644 --- a/iceoryx_posh/source/mepoo/chunk_management.cpp +++ b/iceoryx_posh/source/mepoo/chunk_management.cpp @@ -22,9 +22,9 @@ namespace iox { namespace mepoo { -ChunkManagement::ChunkManagement(const cxx::not_null chunkHeader, - const cxx::not_null mempool, - const cxx::not_null chunkManagementPool) noexcept +ChunkManagement::ChunkManagement(const not_null chunkHeader, + const not_null mempool, + const not_null chunkManagementPool) noexcept : m_chunkHeader(chunkHeader) , m_mempool(mempool) , m_chunkManagementPool(chunkManagementPool) diff --git a/iceoryx_posh/source/popo/ports/publisher_port_roudi.cpp b/iceoryx_posh/source/popo/ports/publisher_port_roudi.cpp index 9a73c5695c0..3317407a07d 100644 --- a/iceoryx_posh/source/popo/ports/publisher_port_roudi.cpp +++ b/iceoryx_posh/source/popo/ports/publisher_port_roudi.cpp @@ -21,7 +21,7 @@ namespace iox { namespace popo { -PublisherPortRouDi::PublisherPortRouDi(cxx::not_null publisherPortDataPtr) noexcept +PublisherPortRouDi::PublisherPortRouDi(not_null publisherPortDataPtr) noexcept : BasePort(publisherPortDataPtr) , m_chunkSender(&getMembers()->m_chunkSenderData) { diff --git a/iceoryx_posh/source/popo/ports/publisher_port_user.cpp b/iceoryx_posh/source/popo/ports/publisher_port_user.cpp index e7788c065c2..48fa4946357 100644 --- a/iceoryx_posh/source/popo/ports/publisher_port_user.cpp +++ b/iceoryx_posh/source/popo/ports/publisher_port_user.cpp @@ -21,7 +21,7 @@ namespace iox { namespace popo { -PublisherPortUser::PublisherPortUser(cxx::not_null publisherPortDataPtr) noexcept +PublisherPortUser::PublisherPortUser(not_null publisherPortDataPtr) noexcept : BasePort(publisherPortDataPtr) , m_chunkSender(&getMembers()->m_chunkSenderData) diff --git a/iceoryx_posh/source/popo/ports/subscriber_port_multi_producer.cpp b/iceoryx_posh/source/popo/ports/subscriber_port_multi_producer.cpp index b1b1c2f08de..25db2c57f61 100644 --- a/iceoryx_posh/source/popo/ports/subscriber_port_multi_producer.cpp +++ b/iceoryx_posh/source/popo/ports/subscriber_port_multi_producer.cpp @@ -21,8 +21,7 @@ namespace iox { namespace popo { -SubscriberPortMultiProducer::SubscriberPortMultiProducer( - cxx::not_null subscriberPortDataPtr) noexcept +SubscriberPortMultiProducer::SubscriberPortMultiProducer(not_null subscriberPortDataPtr) noexcept : SubscriberPortRouDi(subscriberPortDataPtr) { } diff --git a/iceoryx_posh/source/popo/ports/subscriber_port_roudi.cpp b/iceoryx_posh/source/popo/ports/subscriber_port_roudi.cpp index ad863b8e20d..2304cfdfae6 100644 --- a/iceoryx_posh/source/popo/ports/subscriber_port_roudi.cpp +++ b/iceoryx_posh/source/popo/ports/subscriber_port_roudi.cpp @@ -21,7 +21,7 @@ namespace iox { namespace popo { -SubscriberPortRouDi::SubscriberPortRouDi(cxx::not_null subscriberPortDataPtr) noexcept +SubscriberPortRouDi::SubscriberPortRouDi(not_null subscriberPortDataPtr) noexcept : BasePort(subscriberPortDataPtr) , m_chunkReceiver(&getMembers()->m_chunkReceiverData) { diff --git a/iceoryx_posh/source/popo/ports/subscriber_port_single_producer.cpp b/iceoryx_posh/source/popo/ports/subscriber_port_single_producer.cpp index d1cc3ef26b7..ef3c094ff7b 100644 --- a/iceoryx_posh/source/popo/ports/subscriber_port_single_producer.cpp +++ b/iceoryx_posh/source/popo/ports/subscriber_port_single_producer.cpp @@ -21,8 +21,7 @@ namespace iox { namespace popo { -SubscriberPortSingleProducer::SubscriberPortSingleProducer( - cxx::not_null subscriberPortDataPtr) noexcept +SubscriberPortSingleProducer::SubscriberPortSingleProducer(not_null subscriberPortDataPtr) noexcept : SubscriberPortRouDi(subscriberPortDataPtr) { } diff --git a/iceoryx_posh/source/popo/ports/subscriber_port_user.cpp b/iceoryx_posh/source/popo/ports/subscriber_port_user.cpp index 7e0dc8b65e3..53c89192a41 100644 --- a/iceoryx_posh/source/popo/ports/subscriber_port_user.cpp +++ b/iceoryx_posh/source/popo/ports/subscriber_port_user.cpp @@ -21,7 +21,7 @@ namespace iox { namespace popo { -SubscriberPortUser::SubscriberPortUser(cxx::not_null subscriberPortDataPtr) noexcept +SubscriberPortUser::SubscriberPortUser(not_null subscriberPortDataPtr) noexcept : BasePort(subscriberPortDataPtr) , m_chunkReceiver(&getMembers()->m_chunkReceiverData) diff --git a/iceoryx_posh/source/roudi/memory/memory_block.cpp b/iceoryx_posh/source/roudi/memory/memory_block.cpp index 2cb5fd63203..ef158a97148 100644 --- a/iceoryx_posh/source/roudi/memory/memory_block.cpp +++ b/iceoryx_posh/source/roudi/memory/memory_block.cpp @@ -22,7 +22,7 @@ namespace iox { namespace roudi { -void MemoryBlock::onMemoryAvailable(cxx::not_null memory IOX_MAYBE_UNUSED) noexcept +void MemoryBlock::onMemoryAvailable(not_null memory IOX_MAYBE_UNUSED) noexcept { // nothing to do in the default implementation } diff --git a/iceoryx_posh/source/roudi/memory/memory_provider.cpp b/iceoryx_posh/source/roudi/memory/memory_provider.cpp index 7ad5d591572..4c56dbc10a9 100644 --- a/iceoryx_posh/source/roudi/memory/memory_provider.cpp +++ b/iceoryx_posh/source/roudi/memory/memory_provider.cpp @@ -32,7 +32,7 @@ MemoryProvider::~MemoryProvider() noexcept // destroy has to be called manually from outside, since it calls a pure virtual function } -expected MemoryProvider::addMemoryBlock(cxx::not_null memoryBlock) noexcept +expected MemoryProvider::addMemoryBlock(not_null memoryBlock) noexcept { if (isAvailable()) { diff --git a/iceoryx_posh/source/roudi/memory/mempool_collection_memory_block.cpp b/iceoryx_posh/source/roudi/memory/mempool_collection_memory_block.cpp index 3f6aa259ab2..54419174790 100644 --- a/iceoryx_posh/source/roudi/memory/mempool_collection_memory_block.cpp +++ b/iceoryx_posh/source/roudi/memory/mempool_collection_memory_block.cpp @@ -49,7 +49,7 @@ uint64_t MemPoolCollectionMemoryBlock::alignment() const noexcept return algorithm::maxVal(memoryManagerAlignment, mepoo::MemPool::CHUNK_MEMORY_ALIGNMENT); } -void MemPoolCollectionMemoryBlock::onMemoryAvailable(cxx::not_null memory) noexcept +void MemPoolCollectionMemoryBlock::onMemoryAvailable(not_null memory) noexcept { BumpAllocator allocator(memory, size()); auto allocationResult = allocator.allocate(sizeof(mepoo::MemoryManager), alignof(mepoo::MemoryManager)); diff --git a/iceoryx_posh/source/roudi/memory/mempool_segment_manager_memory_block.cpp b/iceoryx_posh/source/roudi/memory/mempool_segment_manager_memory_block.cpp index 8384324fdd7..fb6f52a71b5 100644 --- a/iceoryx_posh/source/roudi/memory/mempool_segment_manager_memory_block.cpp +++ b/iceoryx_posh/source/roudi/memory/mempool_segment_manager_memory_block.cpp @@ -46,7 +46,7 @@ uint64_t MemPoolSegmentManagerMemoryBlock::alignment() const noexcept return algorithm::maxVal(segmentManagerAlignment, mepoo::MemPool::CHUNK_MEMORY_ALIGNMENT); } -void MemPoolSegmentManagerMemoryBlock::onMemoryAvailable(cxx::not_null memory) noexcept +void MemPoolSegmentManagerMemoryBlock::onMemoryAvailable(not_null memory) noexcept { BumpAllocator allocator(memory, size()); auto allocationResult = allocator.allocate(sizeof(mepoo::SegmentManager<>), alignof(mepoo::SegmentManager<>)); diff --git a/iceoryx_posh/source/roudi/memory/port_pool_memory_block.cpp b/iceoryx_posh/source/roudi/memory/port_pool_memory_block.cpp index f72bd8a440d..e274af11dd7 100644 --- a/iceoryx_posh/source/roudi/memory/port_pool_memory_block.cpp +++ b/iceoryx_posh/source/roudi/memory/port_pool_memory_block.cpp @@ -38,7 +38,7 @@ uint64_t PortPoolMemoryBlock::alignment() const noexcept return alignof(PortPoolData); } -void PortPoolMemoryBlock::onMemoryAvailable(cxx::not_null memory) noexcept +void PortPoolMemoryBlock::onMemoryAvailable(not_null memory) noexcept { m_portPoolData = new (memory) PortPoolData; } diff --git a/iceoryx_posh/test/mocks/roudi_memory_block_mock.hpp b/iceoryx_posh/test/mocks/roudi_memory_block_mock.hpp index b7524f499d7..a8d2d16e999 100644 --- a/iceoryx_posh/test/mocks/roudi_memory_block_mock.hpp +++ b/iceoryx_posh/test/mocks/roudi_memory_block_mock.hpp @@ -30,7 +30,7 @@ class MemoryBlockMock final : public iox::roudi::MemoryBlock #endif MOCK_METHOD(uint64_t, size, (), (const, noexcept, override)); MOCK_METHOD(uint64_t, alignment, (), (const, noexcept, override)); - MOCK_METHOD(void, onMemoryAvailable, (iox::cxx::not_null), (noexcept, override)); + MOCK_METHOD(void, onMemoryAvailable, (iox::not_null), (noexcept, override)); MOCK_METHOD(void, destroy, (), (noexcept, override)); #ifdef __clang__ #pragma GCC diagnostic pop