diff --git a/.lycheeignore b/.lycheeignore index 89eb9f4b0e..fba2101f45 100644 --- a/.lycheeignore +++ b/.lycheeignore @@ -1,4 +1,5 @@ https://github.com/eclipse-iceoryx/iceoryx/compare/vx.x.x...vx.x.x https://github.com/eclipse-iceoryx/iceoryx/tree/vx.x.x +https://www.misra.org.uk/ iceoryx-dev@eclipse.org diff --git a/doc/website/release-notes/iceoryx-unreleased.md b/doc/website/release-notes/iceoryx-unreleased.md index b00ed585c7..330da581d4 100644 --- a/doc/website/release-notes/iceoryx-unreleased.md +++ b/doc/website/release-notes/iceoryx-unreleased.md @@ -1000,7 +1000,7 @@ #include "iceoryx_hoofs/posix_wrapper/internal/message_queue.hpp" // after - #include "iceoryx_dust/posix_wrapper/message_queue.hpp" + #include "iox/posix/message_queue.hpp" ``` ```cpp @@ -1008,7 +1008,7 @@ #include "iceoryx_hoofs/posix_wrapper/named_pipe.hpp" // after - #include "iceoryx_dust/posix_wrapper/named_pipe.hpp" + #include "iox/posix/named_pipe.hpp" ``` ```cpp @@ -1016,7 +1016,7 @@ #include "iceoryx_hoofs/posix_wrapper/signal_watcher.hpp" // after - #include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" + #include "iox/posix/signal_watcher.hpp" ``` ```cpp diff --git a/iceoryx_binding_c/source/c_runtime.cpp b/iceoryx_binding_c/source/c_runtime.cpp index 56174e846b..99a2a1ab47 100644 --- a/iceoryx_binding_c/source/c_runtime.cpp +++ b/iceoryx_binding_c/source/c_runtime.cpp @@ -27,9 +27,9 @@ extern "C" { void iox_runtime_init(const char* const name) { - IOX_EXPECTS(name != nullptr && "Runtime name is a nullptr!"); - IOX_EXPECTS(strnlen(name, iox::MAX_RUNTIME_NAME_LENGTH + 1) <= MAX_RUNTIME_NAME_LENGTH - && "Runtime name has more than 100 characters!"); + IOX_EXPECTS_WITH_MSG(name != nullptr, "Runtime name is a nullptr!"); + IOX_EXPECTS_WITH_MSG(strnlen(name, iox::MAX_RUNTIME_NAME_LENGTH + 1) <= MAX_RUNTIME_NAME_LENGTH, + "Runtime name has more than 100 characters!"); PoshRuntime::initRuntime(RuntimeName_t(iox::TruncateToCapacity, name)); } diff --git a/iceoryx_dust/BUILD.bazel b/iceoryx_dust/BUILD.bazel index a8ad11ef32..fd6f6a8699 100644 --- a/iceoryx_dust/BUILD.bazel +++ b/iceoryx_dust/BUILD.bazel @@ -20,7 +20,7 @@ load("//bazel:configure_file.bzl", "configure_file") configure_file( name = "iceoryx_dust_deployment_hpp", src = "cmake/iceoryx_dust_deployment.hpp.in", - out = "include/iox/iceoryx_dust_deployment.hpp", + out = "generated/include/iox/iceoryx_dust_deployment.hpp", config = { "IOX_MAX_NAMED_PIPE_MESSAGE_SIZE": "4096", "IOX_MAX_NAMED_PIPE_NUMBER_OF_MESSAGES": "10", @@ -32,18 +32,20 @@ cc_library( srcs = glob([ "cli/source/**/*.cpp", "filesystem/source/**/*.cpp", - "source/**/*.cpp", - "source/**/*.hpp", + "posix/ipc/source/**/*.cpp", + "posix/sync/source/**/*.cpp", ]), - hdrs = glob(["include/**"]) + glob(["cli/**"]) + glob(["container/**"]) + glob(["filesystem/**"]) + glob(["memory/**"]) + glob(["utility/**"]) + glob(["vocabulary/**"]) + [ + hdrs = glob(["cli/**"]) + glob(["container/**"]) + glob(["filesystem/**"]) + glob(["memory/**"]) + glob(["utility/**"]) + glob(["posix/ipc/**"]) + glob(["posix/sync/**"]) + glob(["vocabulary/**"]) + [ ":iceoryx_dust_deployment_hpp", ], includes = [ "cli/include/", "container/include/", "filesystem/include/", - "include", + "generated/include/", "memory/include/", + "posix/ipc/include/", + "posix/sync/include/", "utility/include/", "vocabulary/include/", ], diff --git a/iceoryx_dust/CMakeLists.txt b/iceoryx_dust/CMakeLists.txt index 0333330f49..f059e2a5ea 100644 --- a/iceoryx_dust/CMakeLists.txt +++ b/iceoryx_dust/CMakeLists.txt @@ -46,20 +46,22 @@ iox_add_library( PRIVATE_LIBS ${ICEORYX_SANITIZER_FLAGS} PRIVATE_LIBS_LINUX ${CODE_COVERAGE_LIBS} PUBLIC_LIBS iceoryx_hoofs::iceoryx_hoofs - BUILD_INTERFACE ${PROJECT_SOURCE_DIR}/include - ${PROJECT_SOURCE_DIR}/cli/include + BUILD_INTERFACE ${PROJECT_SOURCE_DIR}/cli/include ${PROJECT_SOURCE_DIR}/container/include ${PROJECT_SOURCE_DIR}/filesystem/include ${PROJECT_SOURCE_DIR}/memory/include + ${PROJECT_SOURCE_DIR}/posix/ipc/include + ${PROJECT_SOURCE_DIR}/posix/sync/include ${PROJECT_SOURCE_DIR}/utility/include ${PROJECT_SOURCE_DIR}/vocabulary/include ${CMAKE_BINARY_DIR}/generated/iceoryx_dust/include INSTALL_INTERFACE include/${PREFIX} - EXPORT_INCLUDE_DIRS include/ - cli/include/ + EXPORT_INCLUDE_DIRS cli/include/ container/include/ filesystem/include/ memory/include/ + posix/ipc/include/ + posix/sync/include/ utility/include/ vocabulary/include/ FILES @@ -69,9 +71,9 @@ iox_add_library( cli/source/option_definition.cpp cli/source/option_manager.cpp filesystem/source/file_reader.cpp - source/posix_wrapper/named_pipe.cpp - source/posix_wrapper/signal_watcher.cpp - source/posix_wrapper/message_queue.cpp + posix/ipc/source/message_queue.cpp + posix/ipc/source/named_pipe.cpp + posix/sync/source/signal_watcher.cpp ) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/iceoryx_dust_deployment.hpp.in" diff --git a/iceoryx_dust/container/include/iox/detail/forward_list.inl b/iceoryx_dust/container/include/iox/detail/forward_list.inl index a92807e42a..1da79860ea 100644 --- a/iceoryx_dust/container/include/iox/detail/forward_list.inl +++ b/iceoryx_dust/container/include/iox/detail/forward_list.inl @@ -329,7 +329,7 @@ template inline T& forward_list::front() noexcept { auto iter = begin(); - IOX_EXPECTS(isValidElementIdx(iter.m_iterListNodeIdx) && "Invalid list element"); + IOX_EXPECTS_WITH_MSG(isValidElementIdx(iter.m_iterListNodeIdx), "Invalid list element"); return *iter; } @@ -337,7 +337,7 @@ template inline const T& forward_list::front() const noexcept { auto citer = cbegin(); - IOX_EXPECTS(isValidElementIdx(citer.m_iterListNodeIdx) && "Invalid list element"); + IOX_EXPECTS_WITH_MSG(isValidElementIdx(citer.m_iterListNodeIdx), "Invalid list element"); return *citer; } @@ -556,7 +556,7 @@ inline void forward_list::setNextIdx(const size_type idx, const siz template inline const T* forward_list::getDataPtrFromIdx(const size_type idx) const noexcept { - IOX_EXPECTS(isValidElementIdx(idx) && "Invalid list element"); + IOX_EXPECTS_WITH_MSG(isValidElementIdx(idx), "Invalid list element"); // safe since m_data entries are aligned to T // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) @@ -597,14 +597,14 @@ inline bool forward_list::isInvalidIterator(const const_iterator& i { // iterator's member m_iterListNodeIdx and nextIndex are not checked here to be <= END_INDEX as this // should (can) never happen though normal list operations. - IOX_EXPECTS(!isInvalidElement(iter.m_iterListNodeIdx) && "invalidated iterator"); + IOX_EXPECTS_WITH_MSG(!isInvalidElement(iter.m_iterListNodeIdx), "invalidated iterator"); return false; } template inline bool forward_list::isInvalidIterOrDifferentLists(const const_iterator& iter) const noexcept { - IOX_EXPECTS((this == iter.m_list) && "iterator of other list can't be used"); + IOX_EXPECTS_WITH_MSG((this == iter.m_list), "iterator of other list can't be used"); return isInvalidIterator(iter); } diff --git a/iceoryx_dust/include/iceoryx_dust/posix_wrapper/message_queue.hpp b/iceoryx_dust/posix/ipc/include/iox/posix/message_queue.hpp similarity index 97% rename from iceoryx_dust/include/iceoryx_dust/posix_wrapper/message_queue.hpp rename to iceoryx_dust/posix/ipc/include/iox/posix/message_queue.hpp index 6c57c2593f..1a48f93d65 100644 --- a/iceoryx_dust/include/iceoryx_dust/posix_wrapper/message_queue.hpp +++ b/iceoryx_dust/posix/ipc/include/iox/posix/message_queue.hpp @@ -15,8 +15,9 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 -#ifndef IOX_DUST_POSIX_WRAPPER_MESSAGE_QUEUE_HPP -#define IOX_DUST_POSIX_WRAPPER_MESSAGE_QUEUE_HPP + +#ifndef IOX_DUST_POSIX_IPC_MESSAGE_QUEUE_HPP +#define IOX_DUST_POSIX_IPC_MESSAGE_QUEUE_HPP #include "iceoryx_hoofs/internal/posix_wrapper/ipc_channel.hpp" #include "iceoryx_platform/fcntl.hpp" @@ -149,4 +150,4 @@ class MessageQueueBuilder } // namespace posix } // namespace iox -#endif // IOX_DUST_POSIX_WRAPPER_MESSAGE_QUEUE_HPP +#endif // IOX_DUST_POSIX_IPC_MESSAGE_QUEUE_HPP diff --git a/iceoryx_dust/include/iceoryx_dust/posix_wrapper/named_pipe.hpp b/iceoryx_dust/posix/ipc/include/iox/posix/named_pipe.hpp similarity index 98% rename from iceoryx_dust/include/iceoryx_dust/posix_wrapper/named_pipe.hpp rename to iceoryx_dust/posix/ipc/include/iox/posix/named_pipe.hpp index 5286e2c083..f259ce4f64 100644 --- a/iceoryx_dust/include/iceoryx_dust/posix_wrapper/named_pipe.hpp +++ b/iceoryx_dust/posix/ipc/include/iox/posix/named_pipe.hpp @@ -14,8 +14,9 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 -#ifndef IOX_DUST_POSIX_WRAPPER_NAMED_PIPE_HPP -#define IOX_DUST_POSIX_WRAPPER_NAMED_PIPE_HPP + +#ifndef IOX_DUST_POSIX_IPC_NAMED_PIPE_HPP +#define IOX_DUST_POSIX_IPC_NAMED_PIPE_HPP #include "iceoryx_hoofs/concurrent/lockfree_queue.hpp" #include "iceoryx_hoofs/internal/posix_wrapper/ipc_channel.hpp" @@ -177,4 +178,4 @@ class NamedPipeBuilder } // namespace posix } // namespace iox -#endif +#endif // IOX_DUST_POSIX_IPC_NAMED_PIPE_HPP diff --git a/iceoryx_dust/source/posix_wrapper/message_queue.cpp b/iceoryx_dust/posix/ipc/source/message_queue.cpp similarity index 99% rename from iceoryx_dust/source/posix_wrapper/message_queue.cpp rename to iceoryx_dust/posix/ipc/source/message_queue.cpp index a1e0f3395f..e9336e8c85 100644 --- a/iceoryx_dust/source/posix_wrapper/message_queue.cpp +++ b/iceoryx_dust/posix/ipc/source/message_queue.cpp @@ -16,7 +16,7 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/message_queue.hpp" +#include "iox/posix/message_queue.hpp" #include "iceoryx_hoofs/posix_wrapper/posix_call.hpp" #include "iceoryx_platform/fcntl.hpp" #include "iceoryx_platform/platform_correction.hpp" diff --git a/iceoryx_dust/source/posix_wrapper/named_pipe.cpp b/iceoryx_dust/posix/ipc/source/named_pipe.cpp similarity index 99% rename from iceoryx_dust/source/posix_wrapper/named_pipe.cpp rename to iceoryx_dust/posix/ipc/source/named_pipe.cpp index 710c437fee..b112cbcc1b 100644 --- a/iceoryx_dust/source/posix_wrapper/named_pipe.cpp +++ b/iceoryx_dust/posix/ipc/source/named_pipe.cpp @@ -15,7 +15,7 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/named_pipe.hpp" +#include "iox/posix/named_pipe.hpp" #include "iox/bump_allocator.hpp" #include "iox/deadline_timer.hpp" #include "iox/filesystem.hpp" diff --git a/iceoryx_dust/include/iceoryx_dust/posix_wrapper/signal_watcher.hpp b/iceoryx_dust/posix/sync/include/iox/posix/signal_watcher.hpp similarity index 95% rename from iceoryx_dust/include/iceoryx_dust/posix_wrapper/signal_watcher.hpp rename to iceoryx_dust/posix/sync/include/iox/posix/signal_watcher.hpp index 5afc615b2d..1108f9f3ca 100644 --- a/iceoryx_dust/include/iceoryx_dust/posix_wrapper/signal_watcher.hpp +++ b/iceoryx_dust/posix/sync/include/iox/posix/signal_watcher.hpp @@ -13,8 +13,9 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 -#ifndef IOX_DUST_POSIX_WRAPPER_SIGNAL_WATCHER_HPP -#define IOX_DUST_POSIX_WRAPPER_SIGNAL_WATCHER_HPP + +#ifndef IOX_DUST_POSIX_SYNC_SIGNAL_WATCHER_HPP +#define IOX_DUST_POSIX_SYNC_SIGNAL_WATCHER_HPP #include "iceoryx_hoofs/posix_wrapper/signal_handler.hpp" #include "iceoryx_hoofs/posix_wrapper/unnamed_semaphore.hpp" @@ -85,4 +86,4 @@ bool hasTerminationRequested() noexcept; } // namespace posix } // namespace iox -#endif +#endif // IOX_DUST_POSIX_SYNC_SIGNAL_WATCHER_HPP diff --git a/iceoryx_dust/source/posix_wrapper/signal_watcher.cpp b/iceoryx_dust/posix/sync/source/signal_watcher.cpp similarity index 98% rename from iceoryx_dust/source/posix_wrapper/signal_watcher.cpp rename to iceoryx_dust/posix/sync/source/signal_watcher.cpp index 9427e3a1b9..c83472a521 100644 --- a/iceoryx_dust/source/posix_wrapper/signal_watcher.cpp +++ b/iceoryx_dust/posix/sync/source/signal_watcher.cpp @@ -13,7 +13,8 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" + +#include "iox/posix/signal_watcher.hpp" #include "iceoryx_platform/unistd.hpp" namespace iox diff --git a/iceoryx_dust/test/moduletests/test_posix_signal_watcher.cpp b/iceoryx_dust/test/moduletests/test_posix_sync_signal_watcher.cpp similarity index 98% rename from iceoryx_dust/test/moduletests/test_posix_signal_watcher.cpp rename to iceoryx_dust/test/moduletests/test_posix_sync_signal_watcher.cpp index 89ea8d3eb2..f4c820a67e 100644 --- a/iceoryx_dust/test/moduletests/test_posix_signal_watcher.cpp +++ b/iceoryx_dust/test/moduletests/test_posix_sync_signal_watcher.cpp @@ -14,9 +14,9 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_hoofs/testing/barrier.hpp" #include "iceoryx_hoofs/testing/watch_dog.hpp" +#include "iox/posix/signal_watcher.hpp" #include "test.hpp" #include diff --git a/iceoryx_examples/callbacks/ice_callbacks_listener_as_class_member.cpp b/iceoryx_examples/callbacks/ice_callbacks_listener_as_class_member.cpp index d5048ab7a9..0ca9b26cb6 100644 --- a/iceoryx_examples/callbacks/ice_callbacks_listener_as_class_member.cpp +++ b/iceoryx_examples/callbacks/ice_callbacks_listener_as_class_member.cpp @@ -14,12 +14,12 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/listener.hpp" #include "iceoryx_posh/popo/subscriber.hpp" #include "iceoryx_posh/popo/user_trigger.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" #include "iox/optional.hpp" +#include "iox/posix/signal_watcher.hpp" #include "topic_data.hpp" #include diff --git a/iceoryx_examples/callbacks/ice_callbacks_publisher.cpp b/iceoryx_examples/callbacks/ice_callbacks_publisher.cpp index 8034ef6df9..8ebc494f07 100644 --- a/iceoryx_examples/callbacks/ice_callbacks_publisher.cpp +++ b/iceoryx_examples/callbacks/ice_callbacks_publisher.cpp @@ -14,9 +14,9 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/publisher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" #include "topic_data.hpp" #include diff --git a/iceoryx_examples/callbacks/ice_callbacks_subscriber.cpp b/iceoryx_examples/callbacks/ice_callbacks_subscriber.cpp index e16d147cde..c80e713b09 100644 --- a/iceoryx_examples/callbacks/ice_callbacks_subscriber.cpp +++ b/iceoryx_examples/callbacks/ice_callbacks_subscriber.cpp @@ -14,12 +14,12 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/listener.hpp" #include "iceoryx_posh/popo/subscriber.hpp" #include "iceoryx_posh/popo/user_trigger.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" #include "iox/optional.hpp" +#include "iox/posix/signal_watcher.hpp" #include "topic_data.hpp" #include diff --git a/iceoryx_examples/complexdata/iox_publisher_complexdata.cpp b/iceoryx_examples/complexdata/iox_publisher_complexdata.cpp index b0bc7d3cb9..9ccf54ee4b 100644 --- a/iceoryx_examples/complexdata/iox_publisher_complexdata.cpp +++ b/iceoryx_examples/complexdata/iox_publisher_complexdata.cpp @@ -16,9 +16,9 @@ #include "topic_data.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/publisher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" constexpr char APP_NAME[] = "iox-cpp-publisher-complexdata"; diff --git a/iceoryx_examples/complexdata/iox_publisher_vector.cpp b/iceoryx_examples/complexdata/iox_publisher_vector.cpp index 8be0bad5ec..2e271d2e1e 100644 --- a/iceoryx_examples/complexdata/iox_publisher_vector.cpp +++ b/iceoryx_examples/complexdata/iox_publisher_vector.cpp @@ -16,9 +16,9 @@ #include "iox/vector.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/publisher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" constexpr char APP_NAME[] = "iox-cpp-publisher-vector"; diff --git a/iceoryx_examples/complexdata/iox_subscriber_complexdata.cpp b/iceoryx_examples/complexdata/iox_subscriber_complexdata.cpp index 5cefb1fea6..0ca1156fc2 100644 --- a/iceoryx_examples/complexdata/iox_subscriber_complexdata.cpp +++ b/iceoryx_examples/complexdata/iox_subscriber_complexdata.cpp @@ -16,9 +16,9 @@ #include "topic_data.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/subscriber.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" #include "iox/string.hpp" constexpr char APP_NAME[] = "iox-cpp-subscriber-complexdata"; diff --git a/iceoryx_examples/complexdata/iox_subscriber_vector.cpp b/iceoryx_examples/complexdata/iox_subscriber_vector.cpp index c167e23835..ba2bb825e9 100644 --- a/iceoryx_examples/complexdata/iox_subscriber_vector.cpp +++ b/iceoryx_examples/complexdata/iox_subscriber_vector.cpp @@ -14,9 +14,9 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/subscriber.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" #include "iox/string.hpp" #include "iox/vector.hpp" diff --git a/iceoryx_examples/ice_access_control/iox_display_app.cpp b/iceoryx_examples/ice_access_control/iox_display_app.cpp index 79cd6f7312..bba273145f 100644 --- a/iceoryx_examples/ice_access_control/iox_display_app.cpp +++ b/iceoryx_examples/ice_access_control/iox_display_app.cpp @@ -16,10 +16,10 @@ #include "topic_data.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/publisher.hpp" #include "iceoryx_posh/popo/subscriber.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" #include diff --git a/iceoryx_examples/ice_access_control/iox_radar_app.cpp b/iceoryx_examples/ice_access_control/iox_radar_app.cpp index 72b2f2fb6d..8222c840b0 100644 --- a/iceoryx_examples/ice_access_control/iox_radar_app.cpp +++ b/iceoryx_examples/ice_access_control/iox_radar_app.cpp @@ -16,9 +16,9 @@ #include "topic_data.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/publisher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" #include diff --git a/iceoryx_examples/icedelivery/iox_publisher.cpp b/iceoryx_examples/icedelivery/iox_publisher.cpp index 6d32a94a2d..6f50237688 100644 --- a/iceoryx_examples/icedelivery/iox_publisher.cpp +++ b/iceoryx_examples/icedelivery/iox_publisher.cpp @@ -20,8 +20,8 @@ //! [include publisher] #include "iceoryx_posh/popo/publisher.hpp" //! [include publisher] -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" #include diff --git a/iceoryx_examples/icedelivery/iox_publisher_untyped.cpp b/iceoryx_examples/icedelivery/iox_publisher_untyped.cpp index 735da37808..f5ce53fdf2 100644 --- a/iceoryx_examples/icedelivery/iox_publisher_untyped.cpp +++ b/iceoryx_examples/icedelivery/iox_publisher_untyped.cpp @@ -20,9 +20,9 @@ //! [include topic data] //! [includes] -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/untyped_publisher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [includes] #include diff --git a/iceoryx_examples/icedelivery/iox_subscriber.cpp b/iceoryx_examples/icedelivery/iox_subscriber.cpp index 8c79034f53..4477fd0b37 100644 --- a/iceoryx_examples/icedelivery/iox_subscriber.cpp +++ b/iceoryx_examples/icedelivery/iox_subscriber.cpp @@ -20,8 +20,8 @@ //! [include subscriber] #include "iceoryx_posh/popo/subscriber.hpp" //! [include subscriber] -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" #include diff --git a/iceoryx_examples/icedelivery/iox_subscriber_untyped.cpp b/iceoryx_examples/icedelivery/iox_subscriber_untyped.cpp index b667027406..10b82b9f6f 100644 --- a/iceoryx_examples/icedelivery/iox_subscriber_untyped.cpp +++ b/iceoryx_examples/icedelivery/iox_subscriber_untyped.cpp @@ -18,9 +18,9 @@ //! [includes] #include "topic_data.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/untyped_subscriber.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [includes] #include diff --git a/iceoryx_examples/icediscovery/iox_discovery_monitor.cpp b/iceoryx_examples/icediscovery/iox_discovery_monitor.cpp index 88fbbdb939..daf68248d6 100644 --- a/iceoryx_examples/icediscovery/iox_discovery_monitor.cpp +++ b/iceoryx_examples/icediscovery/iox_discovery_monitor.cpp @@ -18,8 +18,8 @@ #include "discovery_monitor.hpp" //! [include custom discovery] -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" #include diff --git a/iceoryx_examples/icediscovery/iox_find_service.cpp b/iceoryx_examples/icediscovery/iox_find_service.cpp index dea81f9550..0b3769d05d 100644 --- a/iceoryx_examples/icediscovery/iox_find_service.cpp +++ b/iceoryx_examples/icediscovery/iox_find_service.cpp @@ -14,8 +14,8 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [include ServiceDiscovery] #include "iceoryx_posh/runtime/service_discovery.hpp" //! [include ServiceDiscovery] diff --git a/iceoryx_examples/icediscovery/iox_offer_service.cpp b/iceoryx_examples/icediscovery/iox_offer_service.cpp index 0477015cd6..3643011a6a 100644 --- a/iceoryx_examples/icediscovery/iox_offer_service.cpp +++ b/iceoryx_examples/icediscovery/iox_offer_service.cpp @@ -14,9 +14,9 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/publisher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" constexpr char APP_NAME[] = "iox-offer-service"; diff --git a/iceoryx_examples/icediscovery/iox_wait_for_service.cpp b/iceoryx_examples/icediscovery/iox_wait_for_service.cpp index adde0acfa7..12f5928923 100644 --- a/iceoryx_examples/icediscovery/iox_wait_for_service.cpp +++ b/iceoryx_examples/icediscovery/iox_wait_for_service.cpp @@ -18,8 +18,8 @@ #include "discovery_blocking.hpp" //! [include custom discovery] -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" #include diff --git a/iceoryx_examples/icehello/iox_publisher_helloworld.cpp b/iceoryx_examples/icehello/iox_publisher_helloworld.cpp index 160f8d7d91..134057c1af 100644 --- a/iceoryx_examples/icehello/iox_publisher_helloworld.cpp +++ b/iceoryx_examples/icehello/iox_publisher_helloworld.cpp @@ -19,7 +19,7 @@ //! [include topic] //! [include sig watcher] -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" +#include "iox/posix/signal_watcher.hpp" //! [include sig watcher] //! [include] diff --git a/iceoryx_examples/icehello/iox_subscriber_helloworld.cpp b/iceoryx_examples/icehello/iox_subscriber_helloworld.cpp index 68a6c87050..1e850d58d0 100644 --- a/iceoryx_examples/icehello/iox_subscriber_helloworld.cpp +++ b/iceoryx_examples/icehello/iox_subscriber_helloworld.cpp @@ -17,9 +17,9 @@ //! [include] #include "topic_data.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/subscriber.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [include] #include diff --git a/iceoryx_examples/iceoptions/iox_publisher_with_options.cpp b/iceoryx_examples/iceoptions/iox_publisher_with_options.cpp index 357f7692ee..0e4da4d37e 100644 --- a/iceoryx_examples/iceoptions/iox_publisher_with_options.cpp +++ b/iceoryx_examples/iceoptions/iox_publisher_with_options.cpp @@ -16,9 +16,9 @@ #include "topic_data.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/publisher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" #include diff --git a/iceoryx_examples/iceoptions/iox_subscriber_with_options.cpp b/iceoryx_examples/iceoptions/iox_subscriber_with_options.cpp index f33931b915..b5d7204054 100644 --- a/iceoryx_examples/iceoptions/iox_subscriber_with_options.cpp +++ b/iceoryx_examples/iceoptions/iox_subscriber_with_options.cpp @@ -16,9 +16,9 @@ #include "topic_data.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/subscriber.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" #include diff --git a/iceoryx_examples/request_response/client_cxx_basic.cpp b/iceoryx_examples/request_response/client_cxx_basic.cpp index 7cbbfb2ff3..66dea43202 100644 --- a/iceoryx_examples/request_response/client_cxx_basic.cpp +++ b/iceoryx_examples/request_response/client_cxx_basic.cpp @@ -17,9 +17,9 @@ //! [iceoryx includes] #include "request_and_response_types.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/client.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [iceoryx includes] #include diff --git a/iceoryx_examples/request_response/client_cxx_untyped.cpp b/iceoryx_examples/request_response/client_cxx_untyped.cpp index 811d376d70..70d657ea1d 100644 --- a/iceoryx_examples/request_response/client_cxx_untyped.cpp +++ b/iceoryx_examples/request_response/client_cxx_untyped.cpp @@ -17,9 +17,9 @@ //! [iceoryx includes] #include "request_and_response_types.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/untyped_client.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [iceoryx includes] #include diff --git a/iceoryx_examples/request_response/client_cxx_waitset.cpp b/iceoryx_examples/request_response/client_cxx_waitset.cpp index 1490699007..040485f7eb 100644 --- a/iceoryx_examples/request_response/client_cxx_waitset.cpp +++ b/iceoryx_examples/request_response/client_cxx_waitset.cpp @@ -17,11 +17,11 @@ //! [iceoryx includes] #include "request_and_response_types.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_hoofs/posix_wrapper/signal_handler.hpp" #include "iceoryx_posh/popo/client.hpp" #include "iceoryx_posh/popo/wait_set.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [iceoryx includes] #include diff --git a/iceoryx_examples/request_response/server_cxx_basic.cpp b/iceoryx_examples/request_response/server_cxx_basic.cpp index 02c5e600a6..322a63a886 100644 --- a/iceoryx_examples/request_response/server_cxx_basic.cpp +++ b/iceoryx_examples/request_response/server_cxx_basic.cpp @@ -17,9 +17,9 @@ //! [iceoryx includes] #include "request_and_response_types.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/server.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [iceoryx includes] #include diff --git a/iceoryx_examples/request_response/server_cxx_listener.cpp b/iceoryx_examples/request_response/server_cxx_listener.cpp index 45842cba3e..96d87ab025 100644 --- a/iceoryx_examples/request_response/server_cxx_listener.cpp +++ b/iceoryx_examples/request_response/server_cxx_listener.cpp @@ -17,10 +17,10 @@ //! [iceoryx includes] #include "request_and_response_types.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/listener.hpp" #include "iceoryx_posh/popo/server.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [iceoryx includes] #include diff --git a/iceoryx_examples/request_response/server_cxx_untyped.cpp b/iceoryx_examples/request_response/server_cxx_untyped.cpp index 3fd6a6debb..577a1ce8c6 100644 --- a/iceoryx_examples/request_response/server_cxx_untyped.cpp +++ b/iceoryx_examples/request_response/server_cxx_untyped.cpp @@ -17,9 +17,9 @@ //! [iceoryx includes] #include "request_and_response_types.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/untyped_server.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [iceoryx includes] #include diff --git a/iceoryx_examples/singleprocess/single_process.cpp b/iceoryx_examples/singleprocess/single_process.cpp index 0a338bb641..626821e1b2 100644 --- a/iceoryx_examples/singleprocess/single_process.cpp +++ b/iceoryx_examples/singleprocess/single_process.cpp @@ -15,7 +15,6 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/iceoryx_posh_config.hpp" #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "iceoryx_posh/internal/roudi/roudi.hpp" @@ -25,6 +24,7 @@ #include "iceoryx_posh/runtime/posh_runtime_single_process.hpp" #include "iox/detail/convert.hpp" #include "iox/logging.hpp" +#include "iox/posix/signal_watcher.hpp" #include #include diff --git a/iceoryx_examples/user_header/publisher_cxx_api.cpp b/iceoryx_examples/user_header/publisher_cxx_api.cpp index e3dfb7b728..6543a08d11 100644 --- a/iceoryx_examples/user_header/publisher_cxx_api.cpp +++ b/iceoryx_examples/user_header/publisher_cxx_api.cpp @@ -17,9 +17,9 @@ //! [iceoryx includes] #include "user_header_and_payload_types.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/publisher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [iceoryx includes] #include diff --git a/iceoryx_examples/user_header/publisher_untyped_cxx_api.cpp b/iceoryx_examples/user_header/publisher_untyped_cxx_api.cpp index c52d7cc3a7..8aa4e66d95 100644 --- a/iceoryx_examples/user_header/publisher_untyped_cxx_api.cpp +++ b/iceoryx_examples/user_header/publisher_untyped_cxx_api.cpp @@ -17,7 +17,7 @@ //! [iceoryx includes] #include "user_header_and_payload_types.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" +#include "iox/posix/signal_watcher.hpp" //! [include differs from typed C++ API] #include "iceoryx_posh/popo/untyped_publisher.hpp" //! [include differs from typed C++ API] diff --git a/iceoryx_examples/user_header/subscriber_cxx_api.cpp b/iceoryx_examples/user_header/subscriber_cxx_api.cpp index 4737620610..886ce16806 100644 --- a/iceoryx_examples/user_header/subscriber_cxx_api.cpp +++ b/iceoryx_examples/user_header/subscriber_cxx_api.cpp @@ -17,9 +17,9 @@ //! [iceoryx includes] #include "user_header_and_payload_types.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/subscriber.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [iceoryx includes] #include diff --git a/iceoryx_examples/user_header/subscriber_untyped_cxx_api.cpp b/iceoryx_examples/user_header/subscriber_untyped_cxx_api.cpp index ee176ce48a..51e41838c3 100644 --- a/iceoryx_examples/user_header/subscriber_untyped_cxx_api.cpp +++ b/iceoryx_examples/user_header/subscriber_untyped_cxx_api.cpp @@ -17,9 +17,9 @@ //! [iceoryx includes] #include "user_header_and_payload_types.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/untyped_subscriber.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" //! [iceoryx includes] #include diff --git a/iceoryx_examples/waitset/ice_waitset_publisher.cpp b/iceoryx_examples/waitset/ice_waitset_publisher.cpp index 9a692d41db..968e06163f 100644 --- a/iceoryx_examples/waitset/ice_waitset_publisher.cpp +++ b/iceoryx_examples/waitset/ice_waitset_publisher.cpp @@ -14,9 +14,9 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/popo/publisher.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" +#include "iox/posix/signal_watcher.hpp" #include "topic_data.hpp" #include diff --git a/iceoryx_hoofs/BUILD.bazel b/iceoryx_hoofs/BUILD.bazel index 9de62f34d6..fb1d1d2bbf 100644 --- a/iceoryx_hoofs/BUILD.bazel +++ b/iceoryx_hoofs/BUILD.bazel @@ -21,7 +21,7 @@ load("//bazel:configure_version.bzl", "configure_version") configure_file( name = "iceoryx_hoofs_deployment_hpp", src = "cmake/iceoryx_hoofs_deployment.hpp.in", - out = "include/iox/iceoryx_hoofs_deployment.hpp", + out = "generated/include/iox/iceoryx_hoofs_deployment.hpp", config = { # FIXME: for values see "iceoryx_hoofs/cmake/IceoryxHoofsDeployment.cmake" ... for now some nice defaults "IOX_MINIMAL_LOG_LEVEL": "TRACE", @@ -31,7 +31,7 @@ configure_file( configure_version( name = "iceoryx_versions_h", src = "cmake/iceoryx_versions.h.in", - out = "include/iceoryx_versions.h", + out = "generated/include/iceoryx_versions.h", version_from = "//:VERSION", ) @@ -62,6 +62,7 @@ cc_library( "design/include", "filesystem/include", "functional/include", + "generated/include", "include/", "legacy/include/", "memory/include/", diff --git a/iceoryx_hoofs/cmake/IceoryxPlatform.cmake b/iceoryx_hoofs/cmake/IceoryxPlatform.cmake index 27f9dd7ae0..293920bb46 100644 --- a/iceoryx_hoofs/cmake/IceoryxPlatform.cmake +++ b/iceoryx_hoofs/cmake/IceoryxPlatform.cmake @@ -131,7 +131,7 @@ if(ADDRESS_SANITIZER OR THREAD_SANITIZER) elseif(THREAD_SANITIZER) set(ICEORYX_SANITIZER_FLAGS ${ICEORYX_SANITIZER_COMMON_FLAGS} ${ICEORYX_THREAD_SANITIZER_FLAGS} CACHE INTERNAL "") endif() - + # unset local variables , to avoid polluting global space unset(ICEORYX_SANITIZER_BLACKLIST) unset(ICEORYX_SANITIZER_COMMON_FLAGS) diff --git a/iceoryx_hoofs/container/include/iox/detail/list.inl b/iceoryx_hoofs/container/include/iox/detail/list.inl index 8c51c82d76..a46db49325 100644 --- a/iceoryx_hoofs/container/include/iox/detail/list.inl +++ b/iceoryx_hoofs/container/include/iox/detail/list.inl @@ -330,7 +330,7 @@ template inline T& list::front() noexcept { auto iter = begin(); - IOX_EXPECTS(isValidElementIdx(iter.m_iterListNodeIdx) && "invalid list element"); + IOX_EXPECTS_WITH_MSG(isValidElementIdx(iter.m_iterListNodeIdx), "invalid list element"); return *iter; } @@ -338,7 +338,7 @@ template inline const T& list::front() const noexcept { auto citer = cbegin(); - IOX_EXPECTS(isValidElementIdx(citer.m_iterListNodeIdx) && "invalid list element"); + IOX_EXPECTS_WITH_MSG(isValidElementIdx(citer.m_iterListNodeIdx), "invalid list element"); return *citer; } @@ -346,7 +346,7 @@ template inline T& list::back() noexcept { auto iter = end(); - IOX_EXPECTS(isValidElementIdx((--iter).m_iterListNodeIdx) && "invalid list element"); + IOX_EXPECTS_WITH_MSG(isValidElementIdx((--iter).m_iterListNodeIdx), "invalid list element"); return *iter; } @@ -354,7 +354,7 @@ template inline const T& list::back() const noexcept { auto citer = cend(); - IOX_EXPECTS(isValidElementIdx((--citer).m_iterListNodeIdx) && "invalid list element"); + IOX_EXPECTS_WITH_MSG(isValidElementIdx((--citer).m_iterListNodeIdx), "invalid list element"); return *citer; } @@ -653,7 +653,7 @@ inline void list::setNextIdx(const size_type idx, const size_type n template inline const T* list::getDataPtrFromIdx(const size_type idx) const noexcept { - IOX_EXPECTS(isValidElementIdx(idx) && "invalid list element"); + IOX_EXPECTS_WITH_MSG(isValidElementIdx(idx), "invalid list element"); /// @NOLINTJUSTIFICATION provide type safe access to the encapsulated untyped m_data array /// @NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) @@ -684,14 +684,14 @@ inline bool list::isInvalidIterator(const const_iterator& iter) con // freeList / invalid elements will have the prevIdx set to INVALID_INDEX // additional check on e.g. nextIdx or m_iterListNodeIdx ( inline bool list::isInvalidIterOrDifferentLists(const const_iterator& iter) const noexcept { - IOX_EXPECTS((this == iter.m_list) && "iterator of other list can't be used"); + IOX_EXPECTS_WITH_MSG((this == iter.m_list), "iterator of other list can't be used"); return isInvalidIterator(iter); } diff --git a/iceoryx_hoofs/source/concurrent/loffli.cpp b/iceoryx_hoofs/source/concurrent/loffli.cpp index 30b2fda26a..b0128cb0dd 100644 --- a/iceoryx_hoofs/source/concurrent/loffli.cpp +++ b/iceoryx_hoofs/source/concurrent/loffli.cpp @@ -25,11 +25,11 @@ namespace concurrent { void LoFFLi::init(not_null freeIndicesMemory, const uint32_t capacity) noexcept { - IOX_EXPECTS(capacity > 0 && "A capacity of 0 is not supported!"); + IOX_EXPECTS_WITH_MSG(capacity > 0, "A capacity of 0 is not supported!"); constexpr uint32_t INTERNALLY_RESERVED_INDICES{1U}; - IOX_EXPECTS(capacity < (std::numeric_limits::max() - INTERNALLY_RESERVED_INDICES) - && "Requested capacity exceeds limits!"); - IOX_EXPECTS(m_head.is_lock_free() && "std::atomic must be lock-free!"); + IOX_EXPECTS_WITH_MSG(capacity < (std::numeric_limits::max() - INTERNALLY_RESERVED_INDICES), + "Requested capacity exceeds limits!"); + IOX_EXPECTS_WITH_MSG(m_head.is_lock_free(), "std::atomic must be lock-free!"); m_nextFreeIndex = freeIndicesMemory; m_size = capacity; diff --git a/iceoryx_hoofs/vocabulary/include/iox/expected.hpp b/iceoryx_hoofs/vocabulary/include/iox/expected.hpp index 12f4a529b4..f4d026070b 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/expected.hpp +++ b/iceoryx_hoofs/vocabulary/include/iox/expected.hpp @@ -18,6 +18,7 @@ #define IOX_HOOFS_VOCABULARY_EXPECTED_HPP #include "iox/attributes.hpp" +#include "iox/detail/deprecation_marker.hpp" #include "iox/detail/expected_helper.hpp" #include "iox/functional_interface.hpp" #include "iox/optional.hpp" @@ -243,15 +244,15 @@ class IOX_NO_DISCARD expected final : public FunctionalInterface #include diff --git a/iceoryx_posh/include/iceoryx_posh/roudi/roudi_app.hpp b/iceoryx_posh/include/iceoryx_posh/roudi/roudi_app.hpp index f7b27751a8..dafe078176 100644 --- a/iceoryx_posh/include/iceoryx_posh/roudi/roudi_app.hpp +++ b/iceoryx_posh/include/iceoryx_posh/roudi/roudi_app.hpp @@ -21,6 +21,7 @@ #include "iceoryx_posh/iceoryx_posh_config.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" #include "iceoryx_posh/roudi/cmd_line_args.hpp" +#include "iox/detail/deprecation_marker.hpp" #include "iox/logging.hpp" #include @@ -47,9 +48,8 @@ class RouDiApp protected: /// @brief waits for the next signal to RouDi daemon - [[deprecated("in 3.0, removed in 4.0, use iox::posix::waitForTerminationRequest() from " - "'iceoryx_dust/posix_wrapper/signal_watcher.hpp'")]] bool - waitForSignal() noexcept; + IOX_DEPRECATED_SINCE(3, "Please use iox::posix::waitForTerminationRequest() from 'iox/posix/signal_watcher.hpp'") + bool waitForSignal() noexcept; iox::log::LogLevel m_logLevel{iox::log::LogLevel::WARN}; roudi::MonitoringMode m_monitoringMode{roudi::MonitoringMode::ON}; diff --git a/iceoryx_posh/roudi_env/source/runtime_test_interface.cpp b/iceoryx_posh/roudi_env/source/runtime_test_interface.cpp index 84dfd87ca6..de0845c1de 100644 --- a/iceoryx_posh/roudi_env/source/runtime_test_interface.cpp +++ b/iceoryx_posh/roudi_env/source/runtime_test_interface.cpp @@ -36,9 +36,9 @@ RuntimeTestInterface::RuntimeTestInterface() { std::lock_guard lock(RuntimeTestInterface::s_runtimeAccessMutex); - IOX_EXPECTS(PoshRuntime::getRuntimeFactory() == PoshRuntime::defaultRuntimeFactory - && "The RuntimeTestInterface can only be used in combination with the " - "PoshRuntime::defaultRuntimeFactory! Someone else already switched the factory!"); + IOX_EXPECTS_WITH_MSG(PoshRuntime::getRuntimeFactory() == PoshRuntime::defaultRuntimeFactory, + "The RuntimeTestInterface can only be used in combination with the " + "PoshRuntime::defaultRuntimeFactory! Someone else already switched the factory!"); PoshRuntime::setRuntimeFactory(RuntimeTestInterface::runtimeFactoryGetInstance); } diff --git a/iceoryx_posh/source/popo/ports/client_port_roudi.cpp b/iceoryx_posh/source/popo/ports/client_port_roudi.cpp index e7677bedd7..dc3d0e76bd 100644 --- a/iceoryx_posh/source/popo/ports/client_port_roudi.cpp +++ b/iceoryx_posh/source/popo/ports/client_port_roudi.cpp @@ -150,7 +150,7 @@ ClientPortRouDi::handleCaProMessageForStateConnectRequested(const capro::CaproMe switch (caProMessage.m_type) { case capro::CaproMessageType::ACK: - IOX_EXPECTS(caProMessage.m_chunkQueueData != nullptr && "Invalid request queue passed to client"); + IOX_EXPECTS_WITH_MSG(caProMessage.m_chunkQueueData != nullptr, "Invalid request queue passed to client"); IOX_EXPECTS(!m_chunkSender .tryAddQueue(static_cast(caProMessage.m_chunkQueueData), caProMessage.m_historyCapacity) diff --git a/iceoryx_posh/source/roudi/application/iceoryx_roudi_app.cpp b/iceoryx_posh/source/roudi/application/iceoryx_roudi_app.cpp index 19cd9d183f..5841e2eff8 100644 --- a/iceoryx_posh/source/roudi/application/iceoryx_roudi_app.cpp +++ b/iceoryx_posh/source/roudi/application/iceoryx_roudi_app.cpp @@ -17,10 +17,10 @@ #include "iceoryx_posh/roudi/iceoryx_roudi_app.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_posh/internal/roudi/roudi.hpp" #include "iceoryx_posh/roudi/iceoryx_roudi_components.hpp" #include "iox/optional.hpp" +#include "iox/posix/signal_watcher.hpp" #include "iox/scoped_static.hpp" namespace iox diff --git a/iceoryx_posh/source/roudi/application/roudi_app.cpp b/iceoryx_posh/source/roudi/application/roudi_app.cpp index a7ed7fff71..9fd29f0e6f 100644 --- a/iceoryx_posh/source/roudi/application/roudi_app.cpp +++ b/iceoryx_posh/source/roudi/application/roudi_app.cpp @@ -17,7 +17,6 @@ #include "iceoryx_posh/roudi/roudi_app.hpp" -#include "iceoryx_dust/posix_wrapper/signal_watcher.hpp" #include "iceoryx_platform/getopt.hpp" #include "iceoryx_platform/resource.hpp" #include "iceoryx_platform/semaphore.hpp" @@ -26,6 +25,7 @@ #include "iceoryx_posh/roudi/cmd_line_args.hpp" #include "iox/logging.hpp" #include "iox/optional.hpp" +#include "iox/posix/signal_watcher.hpp" namespace iox { diff --git a/iceoryx_posh/test/integrationtests/test_mq_interface_startup_race.cpp b/iceoryx_posh/test/integrationtests/test_mq_interface_startup_race.cpp index c2d3145351..24aa9d59e4 100644 --- a/iceoryx_posh/test/integrationtests/test_mq_interface_startup_race.cpp +++ b/iceoryx_posh/test/integrationtests/test_mq_interface_startup_race.cpp @@ -18,11 +18,11 @@ #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "test.hpp" -#include "iceoryx_dust/posix_wrapper/message_queue.hpp" #include "iceoryx_hoofs/posix_wrapper/posix_call.hpp" #include "iceoryx_posh/internal/runtime/ipc_message.hpp" #include "iceoryx_posh/internal/runtime/ipc_runtime_interface.hpp" #include "iox/duration.hpp" +#include "iox/posix/message_queue.hpp" #include "iox/std_string_support.hpp" diff --git a/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp b/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp index 44c7a08e75..31fcf6c8ca 100644 --- a/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp +++ b/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp @@ -111,9 +111,9 @@ class PortUser_IntegrationTest : public Test Watchdog m_deadlockWatchdog{DEADLOCK_TIMEOUT}; - uint64_t m_receiveCounter{0U}; + std::atomic m_receiveCounter{0U}; std::atomic m_sendCounter{0U}; - std::atomic m_publisherRunFinished{0U}; + std::atomic m_publisherRunFinished{false}; // Memory objects iox::BumpAllocator m_memoryAllocator{g_memory, MEMORY_SIZE}; @@ -178,9 +178,7 @@ class PortUser_IntegrationTest : public Test } template - void subscriberThread(uint32_t numberOfPublishers, - SubscriberPortType& subscriberPortRouDi, - SubscriberPortUser& subscriberPortUser) + void subscriberThread(SubscriberPortType& subscriberPortRouDi, SubscriberPortUser& subscriberPortUser) { bool finished{false}; @@ -213,17 +211,14 @@ class PortUser_IntegrationTest : public Test // Try to receive chunk subscriberPortUser.tryGetChunk() .and_then([&](auto& chunkHeader) { - m_receiveCounter++; + m_receiveCounter.fetch_add(1, std::memory_order_relaxed); subscriberPortUser.releaseChunk(chunkHeader); }) .or_else([&](auto& result) { if (result == ChunkReceiveResult::NO_CHUNK_AVAILABLE) { // Nothing received -> check if publisher(s) still running - if (m_publisherRunFinished.load(std::memory_order_relaxed) == numberOfPublishers) - { - finished = true; - } + finished = m_publisherRunFinished.load(std::memory_order_relaxed); } else { @@ -298,8 +293,17 @@ class PortUser_IntegrationTest : public Test } // Subscriber is ready to receive -> start sending samples - for (size_t i = 0U; i < ITERATIONS; i++) + size_t i = 0U; + while (i < ITERATIONS) { + // slow down to ensure there is no overflow + auto receiveCounter = m_receiveCounter.load(std::memory_order_relaxed); + auto sendCounter = m_sendCounter.load(std::memory_order_seq_cst); + if (sendCounter - receiveCounter > 100) + { + std::this_thread::yield(); + continue; + } publisherPortUser .tryAllocateChunk(sizeof(DummySample), alignof(DummySample), @@ -310,56 +314,59 @@ class PortUser_IntegrationTest : public Test new (sample) DummySample(); static_cast(sample)->m_dummy = i; publisherPortUser.sendChunk(chunkHeader); - m_sendCounter++; + m_sendCounter.fetch_add(1, std::memory_order_relaxed); }) .or_else([](auto error) { // Errors shall never occur GTEST_FAIL() << "Error in tryAllocateChunk(): " << static_cast(error); }); + ++i; + /// Add some jitter to make thread breathe - std::this_thread::sleep_for(std::chrono::milliseconds(rand() % 4)); + /// On Windows even when asked for short sleeps the OS suspends the execution for multiple milliseconds; + /// therefore lets sleep only every second iteration + if (i % 2 == 0) + { + std::this_thread::sleep_for(std::chrono::microseconds(100 + rand() % 50)); + } } - - // Signal the subscriber thread we're done - m_publisherRunFinished++; } }; -TIMING_TEST_F(PortUser_IntegrationTest, SingleProducer, Repeat(5), [&] { +TEST_F(PortUser_IntegrationTest, SingleProducer) +{ ::testing::Test::RecordProperty("TEST_ID", "bb62ac02-2b7d-4d1c-8699-9f5ba4d9bd5a"); - std::thread subscribingThread([this] { - constexpr uint32_t NUMBER_OF_PUBLISHERS_SINGLE_PRODUCER = 1U; - subscriberThread(NUMBER_OF_PUBLISHERS_SINGLE_PRODUCER, - m_subscriberPortRouDiSingleProducer, - m_subscriberPortUserSingleProducer); - }); + std::thread subscribingThread( + [this] { subscriberThread(m_subscriberPortRouDiSingleProducer, m_subscriberPortUserSingleProducer); }); std::thread publishingThread([this] { constexpr uint32_t INDEX_OF_PUBLISHER_SINGLE_PRODUCER = 0U; publisherThread( INDEX_OF_PUBLISHER_SINGLE_PRODUCER, m_publisherPortRouDiVector.front(), m_publisherPortUserVector.front()); }); - if (subscribingThread.joinable()) + if (publishingThread.joinable()) { - subscribingThread.join(); + publishingThread.join(); } + m_publisherRunFinished.store(true, std::memory_order_relaxed); - if (publishingThread.joinable()) + if (subscribingThread.joinable()) { - publishingThread.join(); + subscribingThread.join(); } - TIMING_TEST_EXPECT_TRUE(m_sendCounter.load(std::memory_order_relaxed) == m_receiveCounter); - TIMING_TEST_EXPECT_FALSE(PortUser_IntegrationTest::m_subscriberPortUserMultiProducer.hasLostChunksSinceLastCall()); -}) + EXPECT_THAT(m_receiveCounter.load(std::memory_order_relaxed), Eq(m_sendCounter.load(std::memory_order_relaxed))); + EXPECT_FALSE(PortUser_IntegrationTest::m_subscriberPortUserMultiProducer.hasLostChunksSinceLastCall()); +} -TIMING_TEST_F(PortUser_IntegrationTest, MultiProducer, Repeat(5), [&] { +TEST_F(PortUser_IntegrationTest, MultiProducer) +{ ::testing::Test::RecordProperty("TEST_ID", "d27279d3-26c0-4489-9208-bd361120525a"); - std::thread subscribingThread([this] { - subscriberThread(NUMBER_OF_PUBLISHERS, m_subscriberPortRouDiMultiProducer, m_subscriberPortUserMultiProducer); - }); + + std::thread subscribingThread( + [this] { subscriberThread(m_subscriberPortRouDiMultiProducer, m_subscriberPortUserMultiProducer); }); for (uint32_t i = 0U; i < NUMBER_OF_PUBLISHERS; i++) { @@ -367,11 +374,6 @@ TIMING_TEST_F(PortUser_IntegrationTest, MultiProducer, Repeat(5), [&] { [i, this] { publisherThread(i, m_publisherPortRouDiVector[i], m_publisherPortUserVector[i]); }); } - if (subscribingThread.joinable()) - { - subscribingThread.join(); - } - for (uint32_t i = 0U; i < NUMBER_OF_PUBLISHERS; i++) { if (m_publisherThreadVector[i].joinable()) @@ -379,9 +381,15 @@ TIMING_TEST_F(PortUser_IntegrationTest, MultiProducer, Repeat(5), [&] { m_publisherThreadVector[i].join(); } } + m_publisherRunFinished.store(true, std::memory_order_relaxed); + + if (subscribingThread.joinable()) + { + subscribingThread.join(); + } - TIMING_TEST_EXPECT_TRUE(m_sendCounter.load(std::memory_order_relaxed) == m_receiveCounter); - TIMING_TEST_EXPECT_FALSE(PortUser_IntegrationTest::m_subscriberPortUserMultiProducer.hasLostChunksSinceLastCall()); -}) + EXPECT_THAT(m_receiveCounter.load(std::memory_order_relaxed), Eq(m_sendCounter.load(std::memory_order_relaxed))); + EXPECT_FALSE(PortUser_IntegrationTest::m_subscriberPortUserMultiProducer.hasLostChunksSinceLastCall()); +} } // namespace diff --git a/iceoryx_posh/test/moduletests/test_runtime_ipc_interface.cpp b/iceoryx_posh/test/moduletests/test_runtime_ipc_interface.cpp index cc0082b298..77bbf6efed 100644 --- a/iceoryx_posh/test/moduletests/test_runtime_ipc_interface.cpp +++ b/iceoryx_posh/test/moduletests/test_runtime_ipc_interface.cpp @@ -15,11 +15,11 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_dust/posix_wrapper/message_queue.hpp" -#include "iceoryx_dust/posix_wrapper/named_pipe.hpp" #include "iceoryx_hoofs/internal/posix_wrapper/unix_domain_socket.hpp" #include "iceoryx_platform/platform_settings.hpp" #include "iceoryx_posh/internal/runtime/ipc_interface_base.hpp" +#include "iox/posix/message_queue.hpp" +#include "iox/posix/named_pipe.hpp" #include "iox/std_chrono_support.hpp" #include "test.hpp" diff --git a/iceoryx_posh/testing/include/iceoryx_posh/testing/mocks/posh_runtime_mock.hpp b/iceoryx_posh/testing/include/iceoryx_posh/testing/mocks/posh_runtime_mock.hpp index 881957d3de..5dd5464a43 100644 --- a/iceoryx_posh/testing/include/iceoryx_posh/testing/mocks/posh_runtime_mock.hpp +++ b/iceoryx_posh/testing/include/iceoryx_posh/testing/mocks/posh_runtime_mock.hpp @@ -28,10 +28,10 @@ class PoshRuntimeMock : public iox::runtime::PoshRuntime static std::unique_ptr create(const iox::RuntimeName_t& name) { auto& runtime = mockRuntime(); - IOX_EXPECTS(!runtime.has_value() && "Using multiple PoshRuntimeMock in parallel is not supported!"); - IOX_EXPECTS(PoshRuntime::getRuntimeFactory() == PoshRuntime::defaultRuntimeFactory - && "The PoshRuntimeMock can only be used in combination with the " - "PoshRuntime::defaultRuntimeFactory! Someone else already switched the factory!"); + IOX_EXPECTS_WITH_MSG(!runtime.has_value(), "Using multiple PoshRuntimeMock in parallel is not supported!"); + IOX_EXPECTS_WITH_MSG(PoshRuntime::getRuntimeFactory() == PoshRuntime::defaultRuntimeFactory, + "The PoshRuntimeMock can only be used in combination with the " + "PoshRuntime::defaultRuntimeFactory! Someone else already switched the factory!"); runtime = new PoshRuntimeMock(name); PoshRuntime::setRuntimeFactory(mockRuntimeFactory); @@ -88,8 +88,9 @@ class PoshRuntimeMock : public iox::runtime::PoshRuntime static PoshRuntime& mockRuntimeFactory(iox::optional name) noexcept { auto& runtime = mockRuntime(); - IOX_EXPECTS(!name.has_value() && "PoshRuntime::initRuntime must not be used with a PoshRuntimeMock!"); - IOX_EXPECTS(runtime.has_value() && "This should never happen! If you see this, something went horribly wrong!"); + IOX_EXPECTS_WITH_MSG(!name.has_value(), "PoshRuntime::initRuntime must not be used with a PoshRuntimeMock!"); + IOX_EXPECTS_WITH_MSG(runtime.has_value(), + "This should never happen! If you see this, something went horribly wrong!"); return *runtime.value(); } diff --git a/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_environment/roudi_environment.hpp b/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_environment/roudi_environment.hpp index 142081490c..594842ec98 100644 --- a/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_environment/roudi_environment.hpp +++ b/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_environment/roudi_environment.hpp @@ -19,6 +19,7 @@ #define IOX_POSH_ROUDI_ENVIRONMENT_ROUDI_ENVIRONMENT_HPP #include "iceoryx_posh/roudi_env/roudi_env.hpp" +#include "iox/detail/deprecation_marker.hpp" #include @@ -27,8 +28,7 @@ namespace iox namespace roudi { /// @deprecated Deprecated in 3.0, removed in 4.0, please port to 'iox::roudi_env::RouDiEnv' -class [[deprecated("Deprecated in 3.0, removed in 4.0, please port to 'iox::roudi_env::RouDiEnv'")]] RouDiEnvironment - : public roudi_env::RouDiEnv +class IOX_DEPRECATED_SINCE(3, "Please port to 'iox::roudi_env::RouDiEnv'") RouDiEnvironment : public roudi_env::RouDiEnv { public: using ParentType = roudi_env::RouDiEnv; @@ -36,22 +36,21 @@ class [[deprecated("Deprecated in 3.0, removed in 4.0, please port to 'iox::roud using ParentType::operator=; /// @deprecated Deprecated in 3.0, removed in 4.0, please port to 'setDiscoveryLoopWaitToFinishTimeout' - [[deprecated("Deprecated in 3.0, removed in 4.0, please port to 'setDiscoveryLoopWaitToFinishTimeout'")]] void - SetInterOpWaitingTime(const std::chrono::milliseconds& v) noexcept + IOX_DEPRECATED_SINCE(3, "Please port to 'setDiscoveryLoopWaitToFinishTimeout'") + void SetInterOpWaitingTime(const std::chrono::milliseconds& v) noexcept { setDiscoveryLoopWaitToFinishTimeout(units::Duration::fromMilliseconds(v.count())); } /// @deprecated Deprecated in 3.0, removed in 4.0, please port to 'triggerDiscoveryLoopAndWaitToFinish' - [[deprecated("Deprecated in 3.0, removed in 4.0, please port to 'triggerDiscoveryLoopAndWaitToFinish'")]] void - InterOpWait() noexcept + IOX_DEPRECATED_SINCE(3, "Please port to 'triggerDiscoveryLoopAndWaitToFinish'") void InterOpWait() noexcept { triggerDiscoveryLoopAndWaitToFinish(); } /// @deprecated Deprecated in 3.0, removed in 4.0, please port to 'cleanupAppResources' - [[deprecated("Deprecated in 3.0, removed in 4.0, please port to 'cleanupAppResources'")]] void CleanupAppResources( - const RuntimeName_t& name) noexcept + IOX_DEPRECATED_SINCE(3, "Please port to 'cleanupAppResources'") + void CleanupAppResources(const RuntimeName_t& name) noexcept { cleanupAppResources(name); } diff --git a/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_gtest.hpp b/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_gtest.hpp index 50a6dea74a..ccf8dd5bef 100644 --- a/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_gtest.hpp +++ b/iceoryx_posh/testing/include/iceoryx_posh/testing/roudi_gtest.hpp @@ -18,6 +18,7 @@ #define IOX_POSH_TESTUTILS_ROUDI_GTEST_HPP #include "iceoryx_posh/roudi_env/roudi_env.hpp" +#include "iox/detail/deprecation_marker.hpp" #include #include @@ -33,16 +34,15 @@ class RouDi_GTest : public iox::roudi_env::RouDiEnv, public ::testing::Test RouDi_GTest(const iox::RouDiConfig_t& roudiConfig) noexcept; /// @deprecated Deprecated in 3.0, removed in 4.0, please port to 'setDiscoveryLoopWaitToFinishTimeout' - [[deprecated("Deprecated in 3.0, removed in 4.0, please port to 'setDiscoveryLoopWaitToFinishTimeout'")]] void - SetInterOpWaitingTime(const std::chrono::milliseconds& v) noexcept; + IOX_DEPRECATED_SINCE(3, "Please port to 'setDiscoveryLoopWaitToFinishTimeout'") + void SetInterOpWaitingTime(const std::chrono::milliseconds& v) noexcept; /// @deprecated Deprecated in 3.0, removed in 4.0, please port to 'triggerDiscoveryLoopAndWaitToFinish' - [[deprecated("Deprecated in 3.0, removed in 4.0, please port to 'triggerDiscoveryLoopAndWaitToFinish'")]] void - InterOpWait() noexcept; + IOX_DEPRECATED_SINCE(3, "Please port to 'triggerDiscoveryLoopAndWaitToFinish'") void InterOpWait() noexcept; /// @deprecated Deprecated in 3.0, removed in 4.0, please port to 'cleanupAppResources' - [[deprecated("Deprecated in 3.0, removed in 4.0, please port to 'cleanupAppResources'")]] void - CleanupAppResources(const RuntimeName_t& name) noexcept; + IOX_DEPRECATED_SINCE(3, "Please port to 'cleanupAppResources'") + void CleanupAppResources(const RuntimeName_t& name) noexcept; }; } // namespace testing