From 7b21b22c293cfc30ec30108d7772dc77a2fefd64 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Wed, 1 Sep 2021 13:16:42 +0200 Subject: [PATCH 1/5] iox-#902 noexcept all the things Signed-off-by: Simon Hoinkis --- .../internal/c2cpp_enum_translation.hpp | 4 +- .../internal/cpp2c_enum_translation.hpp | 4 +- .../internal/cpp2c_publisher.hpp | 2 +- .../internal/cpp2c_subscriber.hpp | 4 +- .../source/c2cpp_enum_translation.cpp | 4 +- .../source/cpp2c_enum_translation.cpp | 4 +- .../concurrent/lockfree_queue.hpp | 6 +-- .../concurrent/resizeable_lockfree_queue.hpp | 4 +- .../include/iceoryx_hoofs/cxx/algorithm.hpp | 2 +- .../include/iceoryx_hoofs/cxx/convert.hpp | 10 ++--- .../include/iceoryx_hoofs/cxx/expected.hpp | 6 +-- .../include/iceoryx_hoofs/cxx/helplets.hpp | 36 +++++++-------- .../include/iceoryx_hoofs/cxx/list.hpp | 2 +- .../iceoryx_hoofs/cxx/method_callback.hpp | 16 +++---- .../iceoryx_hoofs/cxx/scoped_static.hpp | 2 +- .../include/iceoryx_hoofs/cxx/string.hpp | 22 +++++----- .../include/iceoryx_hoofs/cxx/type_traits.hpp | 8 ++-- .../include/iceoryx_hoofs/cxx/variant.hpp | 2 +- .../error_handling/error_handling.hpp | 14 +++--- .../concurrent/lockfree_queue/buffer.hpp | 4 +- .../lockfree_queue/cyclic_index.hpp | 10 ++--- .../lockfree_queue/cyclic_index.inl | 2 +- .../concurrent/lockfree_queue/index_queue.hpp | 4 +- .../concurrent/lockfree_queue/index_queue.inl | 2 +- .../lockfree_queue/lockfree_queue.inl | 4 +- .../internal/concurrent/loffli.hpp | 2 +- .../iceoryx_hoofs/internal/cxx/algorithm.inl | 2 +- .../iceoryx_hoofs/internal/cxx/convert.inl | 44 +++++++++---------- .../iceoryx_hoofs/internal/cxx/list.inl | 2 +- .../internal/cxx/method_callback.inl | 4 +- .../internal/cxx/scoped_static.inl | 2 +- .../iceoryx_hoofs/internal/cxx/set.hpp | 8 ++-- .../iceoryx_hoofs/internal/cxx/string.inl | 20 ++++----- .../iceoryx_hoofs/internal/cxx/unique_ptr.inl | 12 ++--- .../internal/cxx/variant_internal.hpp | 20 ++++----- .../internal/file_reader/file_reader.hpp | 8 ++-- .../internal/posix_wrapper/access_control.hpp | 12 ++--- .../internal/posix_wrapper/message_queue.hpp | 34 +++++++------- .../internal/posix_wrapper/mutex.hpp | 10 ++--- .../posix_wrapper/shared_memory_object.hpp | 6 +-- .../shared_memory_object/allocator.hpp | 4 +- .../shared_memory_object/memory_map.hpp | 2 +- .../internal/posix_wrapper/timespec.hpp | 4 +- .../include/iceoryx_hoofs/log/logcommon.hpp | 8 ++-- .../include/iceoryx_hoofs/log/logger.hpp | 10 ++--- .../include/iceoryx_hoofs/log/logging.hpp | 32 +++++++------- .../logging_free_function_building_block.hpp | 2 +- .../include/iceoryx_hoofs/log/logmanager.hpp | 6 +-- .../include/iceoryx_hoofs/log/logstream.hpp | 22 +++++----- .../posix_wrapper/posix_access_rights.hpp | 38 ++++++++-------- .../iceoryx_hoofs/posix_wrapper/thread.hpp | 4 +- .../iceoryx_hoofs/posix_wrapper/timer.hpp | 2 +- iceoryx_hoofs/source/cxx/helplets.cpp | 2 +- .../source/error_handling/error_handling.cpp | 12 ++--- .../source/file_reader/file_reader.cpp | 6 +-- iceoryx_hoofs/source/log/logcommon.cpp | 8 ++-- iceoryx_hoofs/source/log/logger.cpp | 10 ++--- iceoryx_hoofs/source/log/logmanager.cpp | 2 +- iceoryx_hoofs/source/log/logstream.cpp | 4 +- .../source/posix_wrapper/access_control.cpp | 12 ++--- .../source/posix_wrapper/message_queue.cpp | 32 +++++++------- iceoryx_hoofs/source/posix_wrapper/mutex.cpp | 8 ++-- .../posix_wrapper/posix_access_rights.cpp | 38 ++++++++-------- .../posix_wrapper/shared_memory_object.cpp | 2 +- iceoryx_hoofs/source/posix_wrapper/thread.cpp | 4 +- iceoryx_hoofs/source/posix_wrapper/timer.cpp | 2 +- .../source/posix_wrapper/timespec.cpp | 4 +- .../capro/service_description.hpp | 12 ++--- .../iceoryx_posh/gateway/gateway_base.hpp | 4 +- .../gateway/toml_gateway_config_parser.hpp | 4 +- .../iceoryx_posh/iceoryx_posh_types.hpp | 6 +-- .../iceoryx_posh/iceoryx_posh_types.inl | 6 +-- .../internal/capro/capro_message.hpp | 6 +-- .../internal/capro/capro_message.inl | 4 +- .../internal/mepoo/shared_chunk.hpp | 2 +- .../internal/popo/base_subscriber.inl | 2 +- .../building_blocks/chunk_distributor.hpp | 6 +-- .../chunk_distributor_data.inl | 2 +- .../building_blocks/chunk_queue_popper.hpp | 6 +-- .../building_blocks/chunk_queue_pusher.hpp | 6 +-- .../popo/building_blocks/chunk_receiver.hpp | 6 +-- .../popo/building_blocks/chunk_sender.hpp | 6 +-- .../condition_variable_data.hpp | 2 +- .../internal/popo/notification_callback.inl | 4 +- .../internal/popo/ports/application_port.hpp | 4 +- .../popo/ports/application_port_data.hpp | 2 +- .../internal/popo/ports/base_port_data.hpp | 4 +- .../internal/popo/ports/client_port_roudi.hpp | 4 +- .../internal/popo/ports/client_port_user.hpp | 4 +- .../internal/popo/ports/interface_port.hpp | 4 +- .../popo/ports/interface_port_data.hpp | 2 +- .../popo/ports/publisher_port_roudi.hpp | 4 +- .../popo/ports/publisher_port_user.hpp | 4 +- .../internal/popo/ports/server_port_roudi.hpp | 4 +- .../internal/popo/ports/server_port_user.hpp | 4 +- .../ports/subscriber_port_multi_producer.hpp | 4 +- .../popo/ports/subscriber_port_roudi.hpp | 4 +- .../ports/subscriber_port_single_producer.hpp | 4 +- .../popo/ports/subscriber_port_user.hpp | 4 +- .../internal/popo/sample_deleter.hpp | 6 +-- .../internal/popo/sample_deleter.inl | 6 +-- .../iceoryx_posh/internal/popo/subscriber.inl | 2 +- .../introspection/fixed_size_container.hpp | 18 ++++---- .../introspection/mempool_introspection.hpp | 4 +- .../introspection/mempool_introspection.inl | 4 +- .../introspection/port_introspection.hpp | 26 +++++------ .../introspection/port_introspection.inl | 20 ++++----- .../internal/roudi/port_manager.hpp | 2 +- .../internal/roudi/port_pool_data.hpp | 8 ++-- .../internal/roudi/port_pool_data.inl | 8 ++-- .../iceoryx_posh/internal/roudi/process.hpp | 2 +- .../iceoryx_posh/internal/roudi/roudi.hpp | 24 +++++----- .../internal/roudi/service_registry.hpp | 8 ++-- .../runtime/ipc_interface_creator.hpp | 2 +- .../internal/runtime/shared_memory_user.hpp | 2 +- .../iceoryx_posh/mepoo/memory_info.hpp | 10 ++--- .../iceoryx_posh/mepoo/mepoo_config.hpp | 2 +- .../iceoryx_posh/mepoo/segment_config.hpp | 2 +- .../iceoryx_posh/popo/base_subscriber.hpp | 2 +- .../include/iceoryx_posh/popo/listener.hpp | 4 +- .../popo/notification_callback.hpp | 4 +- .../iceoryx_posh/popo/notification_info.hpp | 4 +- .../include/iceoryx_posh/popo/rpc_header.hpp | 18 ++++---- .../include/iceoryx_posh/popo/subscriber.hpp | 2 +- .../include/iceoryx_posh/popo/trigger.hpp | 2 +- .../iceoryx_posh/popo/trigger_handle.hpp | 4 +- .../roudi/memory/default_roudi_memory.hpp | 2 +- .../roudi/memory/memory_provider.hpp | 2 +- .../roudi/memory/roudi_memory_manager.hpp | 4 +- .../iceoryx_posh/roudi/roudi_config.hpp | 4 +- .../roudi/roudi_config_file_provider.hpp | 2 +- .../roudi/roudi_config_toml_file_provider.hpp | 4 +- .../iceoryx_posh/runtime/port_config_info.hpp | 10 ++--- .../version/compatibility_check_level.hpp | 2 +- .../source/capro/service_description.cpp | 8 ++-- .../gateway/toml_gateway_config_parser.cpp | 4 +- iceoryx_posh/source/mepoo/memory_info.cpp | 2 +- .../source/roudi/application/roudi_main.cpp | 2 +- .../roudi/memory/default_roudi_memory.cpp | 2 +- .../source/roudi/memory/memory_provider.cpp | 2 +- .../roudi/memory/roudi_memory_manager.cpp | 2 +- iceoryx_posh/source/roudi/roudi.cpp | 22 +++++----- iceoryx_posh/source/roudi/roudi_config.cpp | 4 +- .../roudi/roudi_config_toml_file_provider.cpp | 4 +- .../source/roudi/service_registry.cpp | 8 ++-- .../source/runtime/ipc_interface_creator.cpp | 2 +- .../source/runtime/port_config_info.cpp | 2 +- .../runtime/posh_runtime_single_process.cpp | 4 +- .../source/runtime/shared_memory_user.cpp | 2 +- 149 files changed, 540 insertions(+), 540 deletions(-) diff --git a/iceoryx_binding_c/include/iceoryx_binding_c/internal/c2cpp_enum_translation.hpp b/iceoryx_binding_c/include/iceoryx_binding_c/internal/c2cpp_enum_translation.hpp index cdafd4befe..0a593410b3 100644 --- a/iceoryx_binding_c/include/iceoryx_binding_c/internal/c2cpp_enum_translation.hpp +++ b/iceoryx_binding_c/include/iceoryx_binding_c/internal/c2cpp_enum_translation.hpp @@ -24,8 +24,8 @@ namespace c2cpp { -iox::popo::SubscriberTooSlowPolicy subscriberTooSlowPolicy(const ENUM iox_SubscriberTooSlowPolicy policy); -iox::popo::QueueFullPolicy queueFullPolicy(const ENUM iox_QueueFullPolicy policy); +iox::popo::SubscriberTooSlowPolicy subscriberTooSlowPolicy(const ENUM iox_SubscriberTooSlowPolicy policy) noexcept; +iox::popo::QueueFullPolicy queueFullPolicy(const ENUM iox_QueueFullPolicy policy) noexcept; iox::popo::SubscriberEvent subscriberEvent(const iox_SubscriberEvent value) noexcept; iox::popo::SubscriberState subscriberState(const iox_SubscriberState value) noexcept; } // namespace c2cpp diff --git a/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_enum_translation.hpp b/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_enum_translation.hpp index 3f57af5c6a..ba55307d97 100644 --- a/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_enum_translation.hpp +++ b/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_enum_translation.hpp @@ -33,8 +33,8 @@ iox_ChunkReceiveResult chunkReceiveResult(const iox::popo::ChunkReceiveResult va iox_AllocationResult allocationResult(const iox::popo::AllocationError value) noexcept; iox_WaitSetResult waitSetResult(const iox::popo::WaitSetError value) noexcept; iox_ListenerResult listenerResult(const iox::popo::ListenerError value) noexcept; -iox_SubscriberTooSlowPolicy subscriberTooSlowPolicy(const iox::popo::SubscriberTooSlowPolicy policy); -iox_QueueFullPolicy queueFullPolicy(const iox::popo::QueueFullPolicy policy); +iox_SubscriberTooSlowPolicy subscriberTooSlowPolicy(const iox::popo::SubscriberTooSlowPolicy policy) noexcept; +iox_QueueFullPolicy queueFullPolicy(const iox::popo::QueueFullPolicy policy) noexcept; } // namespace cpp2c #endif diff --git a/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_publisher.hpp b/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_publisher.hpp index 50b7169dfa..e07a9e114e 100644 --- a/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_publisher.hpp +++ b/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_publisher.hpp @@ -22,7 +22,7 @@ struct cpp2c_Publisher { - cpp2c_Publisher() = default; + cpp2c_Publisher() noexcept = default; cpp2c_Publisher(const cpp2c_Publisher&) = delete; cpp2c_Publisher(cpp2c_Publisher&& rhs) noexcept; ~cpp2c_Publisher(); diff --git a/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_subscriber.hpp b/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_subscriber.hpp index 72b7a971aa..c362d01075 100644 --- a/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_subscriber.hpp +++ b/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_subscriber.hpp @@ -26,10 +26,10 @@ struct cpp2c_Subscriber { - cpp2c_Subscriber() = default; + cpp2c_Subscriber() noexcept = default; cpp2c_Subscriber(const cpp2c_Subscriber&) = delete; cpp2c_Subscriber(cpp2c_Subscriber&& rhs) = delete; - ~cpp2c_Subscriber(); + ~cpp2c_Subscriber() noexcept; cpp2c_Subscriber& operator=(const cpp2c_Subscriber&) = delete; cpp2c_Subscriber& operator=(cpp2c_Subscriber&& rhs) = delete; diff --git a/iceoryx_binding_c/source/c2cpp_enum_translation.cpp b/iceoryx_binding_c/source/c2cpp_enum_translation.cpp index d3688c1bbb..125330c714 100644 --- a/iceoryx_binding_c/source/c2cpp_enum_translation.cpp +++ b/iceoryx_binding_c/source/c2cpp_enum_translation.cpp @@ -20,7 +20,7 @@ namespace c2cpp { -iox::popo::SubscriberTooSlowPolicy subscriberTooSlowPolicy(const ENUM iox_SubscriberTooSlowPolicy policy) +iox::popo::SubscriberTooSlowPolicy subscriberTooSlowPolicy(const ENUM iox_SubscriberTooSlowPolicy policy) noexcept { switch (policy) { @@ -35,7 +35,7 @@ iox::popo::SubscriberTooSlowPolicy subscriberTooSlowPolicy(const ENUM iox_Subscr return iox::popo::SubscriberTooSlowPolicy::DISCARD_OLDEST_DATA; } -iox::popo::QueueFullPolicy queueFullPolicy(const ENUM iox_QueueFullPolicy policy) +iox::popo::QueueFullPolicy queueFullPolicy(const ENUM iox_QueueFullPolicy policy) noexcept { switch (policy) { diff --git a/iceoryx_binding_c/source/cpp2c_enum_translation.cpp b/iceoryx_binding_c/source/cpp2c_enum_translation.cpp index 194320907e..eb17138c87 100644 --- a/iceoryx_binding_c/source/cpp2c_enum_translation.cpp +++ b/iceoryx_binding_c/source/cpp2c_enum_translation.cpp @@ -101,7 +101,7 @@ iox_ListenerResult listenerResult(const iox::popo::ListenerError value) noexcept return ListenerResult_UNDEFINED_ERROR; } -iox_SubscriberTooSlowPolicy subscriberTooSlowPolicy(const iox::popo::SubscriberTooSlowPolicy policy) +iox_SubscriberTooSlowPolicy subscriberTooSlowPolicy(const iox::popo::SubscriberTooSlowPolicy policy) noexcept { switch (policy) { @@ -112,7 +112,7 @@ iox_SubscriberTooSlowPolicy subscriberTooSlowPolicy(const iox::popo::SubscriberT } return SubscriberTooSlowPolicy_DISCARD_OLDEST_DATA; } -iox_QueueFullPolicy queueFullPolicy(const iox::popo::QueueFullPolicy policy) +iox_QueueFullPolicy queueFullPolicy(const iox::popo::QueueFullPolicy policy) noexcept { switch (policy) { diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/concurrent/lockfree_queue.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/concurrent/lockfree_queue.hpp index 8544cca4f4..0ced6900a1 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/concurrent/lockfree_queue.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/concurrent/lockfree_queue.hpp @@ -40,7 +40,7 @@ class LockFreeQueue /// @brief creates and initalizes an empty LockFreeQueue LockFreeQueue() noexcept; - ~LockFreeQueue() = default; + ~LockFreeQueue() noexcept = default; // remark: a thread-safe and lockfree implementation of copy seems impossible // but unsafe copying (i.e. where synchronization is up to the user) would be possible @@ -118,13 +118,13 @@ class LockFreeQueue // template is needed to distinguish between lvalue and rvalue T references // (universal reference type deduction) template - void writeBufferAt(const BufferIndex&, T&&); + void writeBufferAt(const BufferIndex&, T&&) noexcept; // needed to avoid code duplication (via universal reference type deduction) template iox::cxx::optional pushImpl(T&& value) noexcept; - cxx::optional readBufferAt(const BufferIndex&); + cxx::optional readBufferAt(const BufferIndex&) noexcept; }; } // namespace concurrent } // namespace iox diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/concurrent/resizeable_lockfree_queue.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/concurrent/resizeable_lockfree_queue.hpp index d14c338064..96952e1066 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/concurrent/resizeable_lockfree_queue.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/concurrent/resizeable_lockfree_queue.hpp @@ -53,8 +53,8 @@ class ResizeableLockFreeQueue : protected LockFreeQueue -inline constexpr bool doesContainValue(const T); +inline constexpr bool doesContainValue(const T) noexcept; /// @brief Returns true if value of T is found in the ValueList, otherwise false /// @tparam T type of the value to check diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/convert.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/convert.hpp index 50f7cef4b8..1dc73fe1d2 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/convert.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/convert.hpp @@ -62,7 +62,7 @@ class convert /// @return string representation of t template static typename std::enable_if::value, std::string>::type - toString(const Source& t); + toString(const Source& t) noexcept; /// @brief Converts every type which is either a pod (plain old data) type or is convertable /// to a string (this means that the operator std::string() is defined) @@ -71,7 +71,7 @@ class convert /// @return string representation of t template static typename std::enable_if::value, std::string>::type - toString(const Source& t); + toString(const Source& t) noexcept; /// @brief Sets dest from a given string. If the conversion fails false is /// returned and the value of dest is undefined. @@ -79,16 +79,16 @@ class convert /// @param[in] dest destination to which the value should be written /// @return false = if the conversion fails otherwise true template - static bool fromString(const char* v, Destination& dest); + static bool fromString(const char* v, Destination& dest) noexcept; /// @brief checks if a given string v is a number /// @param[in] v string which contains the number /// @param[in] type is the expected contained type in v /// @return true if the given string is a number, otherwise false - static bool stringIsNumber(const char* v, const NumberType type); + static bool stringIsNumber(const char* v, const NumberType type) noexcept; private: - static bool stringIsNumberWithErrorMessage(const char* v, const NumberType type); + static bool stringIsNumberWithErrorMessage(const char* v, const NumberType type) noexcept; }; } // namespace cxx diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/expected.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/expected.hpp index 528ef5b843..501f54384d 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/expected.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/expected.hpp @@ -187,11 +187,11 @@ class IOX_NO_DISCARD expected #endif /// @brief calls the destructor of the success value or error value - depending on what /// is stored in the expected - ~expected() = default; + ~expected() noexcept = default; /// @brief calls the copy assignment operator of the contained success value /// or the error value - depending on what is stored in the expected - expected& operator=(const expected&); + expected& operator=(const expected&) noexcept; /// @brief calls the move assignment operator of the contained success value /// or the error value - depending on what is stored in the expected @@ -321,7 +321,7 @@ class IOX_NO_DISCARD expected /// @brief the copy constructor calls the copy constructor of the contained success value /// or the error value - depending on what is stored in the expected - expected(const expected&) = default; + expected(const expected&) noexcept = default; /// @brief the move constructor calls the move constructor of the contained success value /// or the error value - depending on what is stored in the expected diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp index 3cbc550712..0815f94bcd 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp @@ -38,7 +38,7 @@ struct TruncateToCapacity_t; namespace internal { inline void -Require(const bool condition, const char* file, const int line, const char* function, const char* conditionString) +Require(const bool condition, const char* file, const int line, const char* function, const char* conditionString) noexcept { if (!condition) { @@ -99,13 +99,13 @@ template ::val struct not_null { public: - not_null(T t) + not_null(T t) noexcept : value(t) { Expects(t != nullptr); } - constexpr operator T() const + constexpr operator T() const noexcept { return value; } @@ -118,13 +118,13 @@ template struct greater_or_equal { public: - greater_or_equal(T t) + greater_or_equal(T t) noexcept : value(t) { Expects(t >= Minimum); } - constexpr operator T() const + constexpr operator T() const noexcept { return value; } @@ -137,13 +137,13 @@ template struct range { public: - range(T t) + range(T t) noexcept : value(t) { Expects(t >= Minimum && t <= Maximum); } - constexpr operator T() const + constexpr operator T() const noexcept { return value; } @@ -153,7 +153,7 @@ struct range }; template -T align(const T value, const T alignment) +T align(const T value, const T alignment) noexcept { T remainder = value % alignment; return value + ((remainder == 0u) ? 0u : alignment - remainder); @@ -167,46 +167,46 @@ void* alignedAlloc(const uint64_t alignment, const uint64_t size) noexcept; /// @brief frees aligned memory allocated with alignedAlloc /// @param[in] memory, pointer to the aligned memory -void alignedFree(void* const memory); +void alignedFree(void* const memory) noexcept; /// template recursion stopper for maximum alignment calculation template -constexpr size_t maxAlignment() +constexpr size_t maxAlignment() noexcept { return s; } /// calculate maximum alignment of supplied types template -constexpr size_t maxAlignment() +constexpr size_t maxAlignment() noexcept { return alignof(T) > maxAlignment() ? alignof(T) : maxAlignment(); } /// template recursion stopper for maximum size calculation template -constexpr size_t maxSize() +constexpr size_t maxSize() noexcept { return s; } /// calculate maximum size of supplied types template -constexpr size_t maxSize() +constexpr size_t maxSize() noexcept { return sizeof(T) > maxSize() ? sizeof(T) : maxSize(); } /// Convert Enum class type to string template -const char* convertEnumToString(T port, const Enumeration source) +const char* convertEnumToString(T port, const Enumeration source) noexcept { return port[static_cast(source)]; } /// cast an enum to its underlying type template -auto enumTypeAsUnderlyingType(enum_type const value) -> typename std::underlying_type::type +auto enumTypeAsUnderlyingType(enum_type const value) noexcept -> typename std::underlying_type::type { return static_cast::type>(value); } @@ -230,7 +230,7 @@ void forEach(Container& c, const Functor& f) noexcept /// @param[in] The actual content of the char array is not of interest. Its just the size of the array that matters. /// @return Returns the size of a char array at compile time. template -static constexpr uint64_t strlen2(char const (&/*notInterested*/)[SizeValue]) +static constexpr uint64_t strlen2(char const (&/*notInterested*/)[SizeValue]) noexcept { return SizeValue - 1; } @@ -253,7 +253,7 @@ using BestFittingType_t = typename BestFittingType::Type_t; /// @brief Returns info whether called on a 32-bit system /// @return True if called on 32-bit, false if not 32-bit system -constexpr bool isCompiledOn32BitSystem() +constexpr bool isCompiledOn32BitSystem() noexcept { return INTPTR_MAX == INT32_MAX; } @@ -261,7 +261,7 @@ constexpr bool isCompiledOn32BitSystem() /// @brief Checks if an unsigned integer is a power of two /// @return true if power of two, otherwise false template -constexpr bool isPowerOfTwo(const T n) +constexpr bool isPowerOfTwo(const T n) noexcept { static_assert(std::is_unsigned::value && !std::is_same::value, "Only unsigned integer are allowed!"); return n && ((n & (n - 1U)) == 0U); diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/list.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/list.hpp index 30dd6b9573..50f8ffb4ac 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/list.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/list.hpp @@ -74,7 +74,7 @@ class list /// @brief destructs the list and also calls the destructor of all /// contained elements - ~list(); + ~list() noexcept; /// @brief copy constructor list including elements /// @param[in] rhs is the list to copy from (same capacity) diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/method_callback.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/method_callback.hpp index 69af48296e..0619a994e1 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/method_callback.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/method_callback.hpp @@ -45,10 +45,10 @@ class ConstMethodCallback template using ConstMethodPointer = ReturnValue (T::*)(Args...) const; - ConstMethodCallback() = default; - ConstMethodCallback(const ConstMethodCallback& rhs) = default; - ConstMethodCallback& operator=(const ConstMethodCallback& rhs) = default; - ~ConstMethodCallback() = default; + ConstMethodCallback() noexcept = default; + ConstMethodCallback(const ConstMethodCallback& rhs) noexcept = default; + ConstMethodCallback& operator=(const ConstMethodCallback& rhs) noexcept = default; + ~ConstMethodCallback() noexcept = default; /// @brief Constructs a ConstMethodCallback from a pointer to a specific object /// and a pointer to a method of that class. @@ -117,10 +117,10 @@ class MethodCallback template using MethodPointer = ReturnValue (T::*)(Args...); - MethodCallback() = default; - MethodCallback(const MethodCallback& rhs) = default; - MethodCallback& operator=(const MethodCallback& rhs) = default; - ~MethodCallback() = default; + MethodCallback() noexcept = default; + MethodCallback(const MethodCallback& rhs) noexcept = default; + MethodCallback& operator=(const MethodCallback& rhs) noexcept = default; + ~MethodCallback() noexcept = default; /// @brief Constructs a MethodCallback from a pointer to a specific object /// and a pointer to a method of that object. diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/scoped_static.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/scoped_static.hpp index 1655a3ab15..51ea609f04 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/scoped_static.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/scoped_static.hpp @@ -31,7 +31,7 @@ namespace cxx /// @param [in] ctorArgs ctor arguments for the object to construct /// @return cxx::GenericRAII template -GenericRAII makeScopedStatic(T& memory, CTorArgs&&... ctorArgs); +GenericRAII makeScopedStatic(T& memory, CTorArgs&&... ctorArgs) noexcept; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/string.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/string.hpp index 0b46bd7196..e34f637912 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/string.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/string.hpp @@ -41,7 +41,7 @@ template typename std::enable_if<(internal::IsCharArray::value || internal::IsCxxString::value) && (internal::IsCharArray::value || internal::IsCxxString::value), string::capa + internal::GetCapa::capa>>::type -concatenate(const T1& t1, const T2& t2); +concatenate(const T1& t1, const T2& t2) noexcept; /// @brief concatenates an arbitrary number of fixed strings or string literals /// @@ -57,7 +57,7 @@ template typename std::enable_if<(internal::IsCharArray::value || internal::IsCxxString::value) && (internal::IsCharArray::value || internal::IsCxxString::value), string::value>>::type -concatenate(const T1& t1, const T2& t2, const Targs&... targs); +concatenate(const T1& t1, const T2& t2, const Targs&... targs) noexcept; /// @brief concatenates two fixed strings or one fixed fixed string and one string literal; concatenation of two string /// literals is not possible @@ -70,7 +70,7 @@ typename std::enable_if<(internal::IsCharArray::value && internal::IsCxxStri || (internal::IsCxxString::value && internal::IsCharArray::value) || (internal::IsCxxString::value && internal::IsCxxString::value), string::capa + internal::GetCapa::capa>>::type -operator+(const T1& t1, const T2& t2); +operator+(const T1& t1, const T2& t2) noexcept; /// @brief struct used to define a compile time variable which is used to distinguish between /// constructors with certain behavior @@ -514,7 +514,7 @@ class string friend typename std::enable_if<(internal::IsCharArray::value || internal::IsCxxString::value) && (internal::IsCharArray::value || internal::IsCxxString::value), string::capa + internal::GetCapa::capa>>::type - concatenate(const T1& t1, const T2& t2); + concatenate(const T1& t1, const T2& t2) noexcept; private: /// @brief copies rhs fixed string to this with compile time check whether rhs capacity is less than or equal to @@ -546,7 +546,7 @@ class string /// /// @return true if both strings are equal, otherwise false template -inline bool operator==(const std::string& lhs, const string& rhs); +inline bool operator==(const std::string& lhs, const string& rhs) noexcept; /// @brief checks if a rhs std::string is equal to a lhs fixed string /// @@ -555,7 +555,7 @@ inline bool operator==(const std::string& lhs, const string& rhs); /// /// @return true if both strings are equal, otherwise false template -inline bool operator==(const string& lhs, const std::string& rhs); +inline bool operator==(const string& lhs, const std::string& rhs) noexcept; /// @brief checks if a rhs fixed string is not equal to a lhs std::string /// @@ -564,7 +564,7 @@ inline bool operator==(const string& lhs, const std::string& rhs); /// /// @return true if both strings are not equal, otherwise false template -inline bool operator!=(const std::string& lhs, const string& rhs); +inline bool operator!=(const std::string& lhs, const string& rhs) noexcept; /// @brief checks if a rhs std::string is not equal to a lhs fixed string /// @@ -573,7 +573,7 @@ inline bool operator!=(const std::string& lhs, const string& rhs); /// /// @return true if both strings are not equal, otherwise false template -inline bool operator!=(const string& lhs, const std::string& rhs); +inline bool operator!=(const string& lhs, const std::string& rhs) noexcept; /// @brief The equality operator for char pointer and fixed string is disabled via a static_assert, because it may /// lead to undefined behavior if the char array is not null-terminated. Please convert the char array to a fixed @@ -585,7 +585,7 @@ inline bool operator!=(const string& lhs, const std::string& rhs); /// /// @return false template -inline bool operator==(const char* const lhs, const string& rhs); +inline bool operator==(const char* const lhs, const string& rhs) noexcept; /// @brief The inequality operator for char pointer and fixed string is disabled via a static_assert, because it may /// lead to undefined behavior if the char array is not null-terminated. Please convert the char array to a fixed @@ -597,7 +597,7 @@ inline bool operator==(const char* const lhs, const string& rhs); /// /// @return false template -inline bool operator!=(const char* const lhs, const string& rhs); +inline bool operator!=(const char* const lhs, const string& rhs) noexcept; /// @brief outputs the fixed string on stream /// @@ -606,7 +606,7 @@ inline bool operator!=(const char* const lhs, const string& rhs); /// /// @return the stream output of the fixed string template -inline std::ostream& operator<<(std::ostream& stream, const string& str); +inline std::ostream& operator<<(std::ostream& stream, const string& str) noexcept; } // namespace cxx } // namespace iox #include "iceoryx_hoofs/internal/cxx/string.inl" diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/type_traits.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/type_traits.hpp index 58d97e374d..345f171a47 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/type_traits.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/type_traits.hpp @@ -54,14 +54,14 @@ struct is_invocable // This variant is chosen when Callable(ArgTypes) successfully resolves to a valid type, i.e. is invocable. /// @note result_of is deprecated, switch to invoke_result in C++17 template - static constexpr std::true_type test(typename std::result_of::type*) + static constexpr std::true_type test(typename std::result_of::type*) noexcept { return {}; } // This is chosen if Callable(ArgTypes) does not resolve to a valid type. template - static constexpr std::false_type test(...) + static constexpr std::false_type test(...) noexcept { return {}; } @@ -81,13 +81,13 @@ struct is_invocable_r { template static constexpr std::true_type - test(std::enable_if_t::type, ReturnType>::value>*) + test(std::enable_if_t::type, ReturnType>::value>*) noexcept { return {}; } template - static constexpr std::false_type test(...) + static constexpr std::false_type test(...) noexcept { return {}; } diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/variant.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/variant.hpp index 886edcb628..138b4a450b 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/variant.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/variant.hpp @@ -112,7 +112,7 @@ class variant public: /// @brief the default constructor constructs a variant which does not contain /// an element and returns INVALID_VARIANT_INDEX when .index() is called - constexpr variant() = default; + constexpr variant() noexcept = default; /// @brief creates a variant and perform an in place construction of the type /// stored at index N. If the index N is out of bounds you get a compiler diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/error_handling/error_handling.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/error_handling/error_handling.hpp index c705f5369e..4d71528eb8 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/error_handling/error_handling.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/error_handling/error_handling.hpp @@ -180,7 +180,7 @@ enum class Error : uint32_t /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal /// @return the reference to `stream` which was provided as input parameter -std::ostream& operator<<(std::ostream& stream, Error value); +std::ostream& operator<<(std::ostream& stream, Error value) noexcept; /// @brief the available error levels /// FATAL @@ -215,20 +215,20 @@ using HandlerFunction = std::function errorCallBack, const ErrorLevel level); + friend void errorHandler(const Error error, const std::function errorCallBack, const ErrorLevel level) noexcept; public: - static cxx::GenericRAII SetTemporaryErrorHandler(const HandlerFunction& newHandler); + static cxx::GenericRAII SetTemporaryErrorHandler(const HandlerFunction& newHandler) noexcept; - static const char* ToString(const Error error); + static const char* ToString(const Error error) noexcept; protected: - static void ReactOnErrorLevel(const ErrorLevel level, const char* errorText); + static void ReactOnErrorLevel(const ErrorLevel level, const char* errorText) noexcept; private: static void DefaultHandler(const Error error, const std::function errorCallBack, - const ErrorLevel level = ErrorLevel::FATAL); + const ErrorLevel level = ErrorLevel::FATAL) noexcept; static const char* errorNames[]; static iox::HandlerFunction handler; @@ -276,7 +276,7 @@ class ErrorHandler /// @endcode void errorHandler(const Error error, const std::function errorCallBack = std::function(), - const ErrorLevel level = ErrorLevel::FATAL); + const ErrorLevel level = ErrorLevel::FATAL) noexcept; } // namespace iox #endif // IOX_HOOFS_ERROR_HANDLING_ERROR_HANDLING_HPP diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/buffer.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/buffer.hpp index 429dece622..17aa32cd82 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/buffer.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/buffer.hpp @@ -30,8 +30,8 @@ template class Buffer { public: - Buffer() = default; - ~Buffer() = default; + Buffer() noexcept = default; + ~Buffer() noexcept = default; Buffer(const Buffer&) = delete; Buffer(Buffer&&) = delete; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/cyclic_index.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/cyclic_index.hpp index a9b30da50d..b1a4a0d724 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/cyclic_index.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/cyclic_index.hpp @@ -54,10 +54,10 @@ class CyclicIndex CyclicIndex(ValueType index, ValueType cycle) noexcept; - CyclicIndex(const CyclicIndex&) = default; - CyclicIndex(CyclicIndex&&) = default; - CyclicIndex& operator=(const CyclicIndex&) = default; - CyclicIndex& operator=(CyclicIndex&&) = default; + CyclicIndex(const CyclicIndex&) noexcept = default; + CyclicIndex(CyclicIndex&&) noexcept = default; + CyclicIndex& operator=(const CyclicIndex&) noexcept = default; + CyclicIndex& operator=(CyclicIndex&&) noexcept = default; ValueType getIndex() const noexcept; @@ -80,7 +80,7 @@ class CyclicIndex /// This is excactly the right behaviour to deal with a (theoretically possible) /// overflow of lhs and can be seen as lhs being interpreted as MAX + its actual value. /// In this case, lhs - rhs is positive even though lhs < rhs. - int64_t operator-(const CyclicIndex& rhs) const; + int64_t operator-(const CyclicIndex& rhs) const noexcept; private: ValueType m_value{0U}; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/cyclic_index.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/cyclic_index.inl index e5593cd115..e516473744 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/cyclic_index.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/cyclic_index.inl @@ -91,7 +91,7 @@ bool CyclicIndex::isOneCycleBehind(const CyclicIndex& ot } template -int64_t CyclicIndex::operator-(const CyclicIndex& rhs) const +int64_t CyclicIndex::operator-(const CyclicIndex& rhs) const noexcept { return static_cast(m_value - rhs.m_value); } diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/index_queue.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/index_queue.hpp index e6817cac41..11fd4ebadd 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/index_queue.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/index_queue.hpp @@ -55,7 +55,7 @@ class IndexQueue static constexpr ConstructFull_t ConstructFull{}; static constexpr ConstructEmpty_t ConstructEmpty{}; - ~IndexQueue() = default; + ~IndexQueue() noexcept = default; IndexQueue(const IndexQueue&) = delete; IndexQueue(IndexQueue&&) = delete; IndexQueue& operator=(const IndexQueue&) = delete; @@ -125,7 +125,7 @@ class IndexQueue /// @param position position to load the value from /// @param memoryOrder memory order to load the value with /// @return value at position - Index loadvalueAt(const Index& position, std::memory_order memoryOrder = std::memory_order_relaxed) const; + Index loadvalueAt(const Index& position, std::memory_order memoryOrder = std::memory_order_relaxed) const noexcept; /// @brief pop an index from the queue in FIFO order if the queue not empty /// @param index that was obtained, undefined if false is returned diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/index_queue.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/index_queue.inl index 85283dddba..8ecc04db5a 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/index_queue.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/index_queue.inl @@ -319,7 +319,7 @@ bool IndexQueue::empty() const noexcept template typename IndexQueue::Index -IndexQueue::loadvalueAt(const Index& position, const std::memory_order memoryOrder) const +IndexQueue::loadvalueAt(const Index& position, const std::memory_order memoryOrder) const noexcept { return m_cells[position.getIndex()].load(memoryOrder); } diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/lockfree_queue.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/lockfree_queue.inl index 598c902c78..7c5050e2ca 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/lockfree_queue.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/lockfree_queue/lockfree_queue.inl @@ -150,7 +150,7 @@ uint64_t LockFreeQueue::size() const noexcept } template -cxx::optional LockFreeQueue::readBufferAt(const BufferIndex& index) +cxx::optional LockFreeQueue::readBufferAt(const BufferIndex& index) noexcept { // also used for buffer synchronization m_size.fetch_sub(1u, std::memory_order_acquire); @@ -163,7 +163,7 @@ cxx::optional LockFreeQueue::readBufferAt(co template template -void LockFreeQueue::writeBufferAt(const BufferIndex& index, T&& value) +void LockFreeQueue::writeBufferAt(const BufferIndex& index, T&& value) noexcept { auto elementPtr = m_buffer.ptr(index); new (elementPtr) ElementType(std::forward(value)); // move ctor invoked when available, copy ctor otherwise diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/loffli.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/loffli.hpp index 98cad9a3f5..33dbf4f0f3 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/loffli.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/concurrent/loffli.hpp @@ -71,7 +71,7 @@ class LoFFLi iox::rp::RelativePointer m_nextFreeIndex; public: - LoFFLi() = default; + LoFFLi() noexcept = default; /// @todo: why init not in ctor /// Initializes the lock-free free-list diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/algorithm.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/algorithm.inl index 39ff13e0fb..b22230c008 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/algorithm.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/algorithm.inl @@ -70,7 +70,7 @@ inline constexpr bool doesContainType() noexcept } template -inline constexpr bool doesContainValue(const T) +inline constexpr bool doesContainValue(const T) noexcept { return false; } diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/convert.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/convert.inl index 1c52257a56..ffe3248bd9 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/convert.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/convert.inl @@ -25,14 +25,14 @@ namespace cxx /// and stringstream will not convert these to string as it is already a character. template <> inline typename std::enable_if::value, std::string>::type -convert::toString(const uint8_t& t) +convert::toString(const uint8_t& t) noexcept { return toString(static_cast(t)); } template <> inline typename std::enable_if::value, std::string>::type -convert::toString(const int8_t& t) +convert::toString(const int8_t& t) noexcept { return toString(static_cast(t)); } @@ -40,7 +40,7 @@ convert::toString(const int8_t& t) template inline typename std::enable_if::value, std::string>::type -convert::toString(const Source& t) +convert::toString(const Source& t) noexcept { std::stringstream ss; ss << t; @@ -49,28 +49,28 @@ convert::toString(const Source& t) template inline typename std::enable_if::value, std::string>::type -convert::toString(const Source& t) +convert::toString(const Source& t) noexcept { return t; } template inline typename std::enable_if::value, bool>::type -fromString(const char* v, Destination& dest) +fromString(const char* v, Destination& dest) noexcept { dest = Destination(v); return true; } template <> -inline bool convert::fromString(const char* v, std::string& dest) +inline bool convert::fromString(const char* v, std::string& dest) noexcept { dest = std::string(v); return true; } template <> -inline bool convert::fromString(const char* v, char& dest) +inline bool convert::fromString(const char* v, char& dest) noexcept { if (strlen(v) != 1u) { @@ -82,13 +82,13 @@ inline bool convert::fromString(const char* v, char& dest) } template <> -inline bool convert::fromString>(const char* v, string<100>& dest) +inline bool convert::fromString>(const char* v, string<100>& dest) noexcept { dest = string<100>(TruncateToCapacity, v); return true; } -inline bool convert::stringIsNumber(const char* v, const NumberType type) +inline bool convert::stringIsNumber(const char* v, const NumberType type) noexcept { if (v[0] == '\0') return false; @@ -119,7 +119,7 @@ inline bool convert::stringIsNumber(const char* v, const NumberType type) return true; } -inline bool convert::stringIsNumberWithErrorMessage(const char* v, const NumberType type) +inline bool convert::stringIsNumberWithErrorMessage(const char* v, const NumberType type) noexcept { if (!stringIsNumber(v, type)) { @@ -149,7 +149,7 @@ inline bool convert::stringIsNumberWithErrorMessage(const char* v, const NumberT } template <> -inline bool convert::fromString(const char* v, float& dest) +inline bool convert::fromString(const char* v, float& dest) noexcept { if (!stringIsNumberWithErrorMessage(v, NumberType::FLOAT)) { @@ -164,7 +164,7 @@ inline bool convert::fromString(const char* v, float& dest) } template <> -inline bool convert::fromString(const char* v, double& dest) +inline bool convert::fromString(const char* v, double& dest) noexcept { if (!stringIsNumberWithErrorMessage(v, NumberType::FLOAT)) { @@ -179,7 +179,7 @@ inline bool convert::fromString(const char* v, double& dest) } template <> -inline bool convert::fromString(const char* v, long double& dest) +inline bool convert::fromString(const char* v, long double& dest) noexcept { if (!stringIsNumberWithErrorMessage(v, NumberType::FLOAT)) { @@ -194,7 +194,7 @@ inline bool convert::fromString(const char* v, long double& dest) } template <> -inline bool convert::fromString(const char* v, uint64_t& dest) +inline bool convert::fromString(const char* v, uint64_t& dest) noexcept { if (!stringIsNumberWithErrorMessage(v, NumberType::UNSIGNED_INTEGER)) { @@ -232,7 +232,7 @@ inline bool convert::fromString(const char* v, unsigned long& des #endif template <> -inline bool convert::fromString(const char* v, uint32_t& dest) +inline bool convert::fromString(const char* v, uint32_t& dest) noexcept { if (!stringIsNumberWithErrorMessage(v, NumberType::UNSIGNED_INTEGER)) { @@ -257,7 +257,7 @@ inline bool convert::fromString(const char* v, uint32_t& dest) } template <> -inline bool convert::fromString(const char* v, uint16_t& dest) +inline bool convert::fromString(const char* v, uint16_t& dest) noexcept { if (!stringIsNumberWithErrorMessage(v, NumberType::UNSIGNED_INTEGER)) { @@ -282,7 +282,7 @@ inline bool convert::fromString(const char* v, uint16_t& dest) } template <> -inline bool convert::fromString(const char* v, uint8_t& dest) +inline bool convert::fromString(const char* v, uint8_t& dest) noexcept { if (!stringIsNumberWithErrorMessage(v, NumberType::UNSIGNED_INTEGER)) { @@ -307,7 +307,7 @@ inline bool convert::fromString(const char* v, uint8_t& dest) } template <> -inline bool convert::fromString(const char* v, int64_t& dest) +inline bool convert::fromString(const char* v, int64_t& dest) noexcept { if (!stringIsNumberWithErrorMessage(v, NumberType::INTEGER)) { @@ -332,7 +332,7 @@ inline bool convert::fromString(const char* v, int64_t& dest) } template <> -inline bool convert::fromString(const char* v, int32_t& dest) +inline bool convert::fromString(const char* v, int32_t& dest) noexcept { if (!stringIsNumberWithErrorMessage(v, NumberType::INTEGER)) { @@ -357,7 +357,7 @@ inline bool convert::fromString(const char* v, int32_t& dest) } template <> -inline bool convert::fromString(const char* v, int16_t& dest) +inline bool convert::fromString(const char* v, int16_t& dest) noexcept { if (!stringIsNumberWithErrorMessage(v, NumberType::INTEGER)) { @@ -381,7 +381,7 @@ inline bool convert::fromString(const char* v, int16_t& dest) } template <> -inline bool convert::fromString(const char* v, int8_t& dest) +inline bool convert::fromString(const char* v, int8_t& dest) noexcept { if (!stringIsNumberWithErrorMessage(v, NumberType::INTEGER)) { @@ -405,7 +405,7 @@ inline bool convert::fromString(const char* v, int8_t& dest) } template <> -inline bool convert::fromString(const char* v, bool& dest) +inline bool convert::fromString(const char* v, bool& dest) noexcept { if (!stringIsNumberWithErrorMessage(v, NumberType::UNSIGNED_INTEGER)) { diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/list.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/list.inl index ad1994f6e2..bc9ef8d827 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/list.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/list.inl @@ -129,7 +129,7 @@ inline list& list::list::operator=(list&& rhs) noexcep template -inline list::~list() +inline list::~list() noexcept { clear(); } diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/method_callback.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/method_callback.inl index 0e94033458..ebae731174 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/method_callback.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/method_callback.inl @@ -47,7 +47,7 @@ struct ReturnSuccess template ReturnValue -constMethodCallbackCaller(const void* objectRef, ReturnValue (GenericClass::*methodPtr)(Args...) const, Args&&... args) +constMethodCallbackCaller(const void* objectRef, ReturnValue (GenericClass::*methodPtr)(Args...) const, Args&&... args) noexcept { return ((*reinterpret_cast(objectRef)) .*reinterpret_cast(methodPtr))(std::forward(args)...); @@ -55,7 +55,7 @@ constMethodCallbackCaller(const void* objectRef, ReturnValue (GenericClass::*met template -ReturnValue methodCallbackCaller(void* objectRef, ReturnValue (GenericClass::*methodPtr)(Args...), Args&&... args) +ReturnValue methodCallbackCaller(void* objectRef, ReturnValue (GenericClass::*methodPtr)(Args...), Args&&... args) noexcept { return ((*reinterpret_cast(objectRef)) .*reinterpret_cast(methodPtr))(std::forward(args)...); diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/scoped_static.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/scoped_static.inl index 1ce4449322..307ef94cab 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/scoped_static.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/scoped_static.inl @@ -22,7 +22,7 @@ namespace iox namespace cxx { template -inline GenericRAII makeScopedStatic(T& memory, CTorArgs&&... ctorArgs) +inline GenericRAII makeScopedStatic(T& memory, CTorArgs&&... ctorArgs) noexcept { memory.emplace(std::forward(ctorArgs)...); return GenericRAII([] {}, [&memory] { memory.reset(); }); diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/set.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/set.hpp index 8cba0a19f7..14879325d3 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/set.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/set.hpp @@ -30,7 +30,7 @@ namespace set /// @param [in] container container to be added to /// @param [in] entry element to be added template -void add(Container& container, const Type& entry) +void add(Container& container, const Type& entry) noexcept { auto iter = std::find(container.begin(), container.end(), entry); if (iter == container.end()) @@ -43,7 +43,7 @@ void add(Container& container, const Type& entry) /// @param [in] container container to be removed from /// @param [in] entry element to be removed template -void remove(Container& container, const Type& entry) +void remove(Container& container, const Type& entry) noexcept { auto iter = std::find(container.begin(), container.end(), entry); if (iter != container.end()) @@ -57,7 +57,7 @@ void remove(Container& container, const Type& entry) /// @param [in] entry element whose existence is checked /// @return true if the container contains entry, false otherwise template -bool hasElement(Container& container, const Type& entry) +bool hasElement(Container& container, const Type& entry) noexcept { auto iter = std::find(container.begin(), container.end(), entry); return iter != container.end(); @@ -68,7 +68,7 @@ bool hasElement(Container& container, const Type& entry) /// @param [in] set2 second set operand for union operation /// @return reference to the union of both sets stored in set1 template -Container& unify(Container& set1, const Container& set2) +Container& unify(Container& set1, const Container& set2) noexcept { for (auto& element : set2) { diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/string.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/string.inl index e3e055b219..4e271b93d6 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/string.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/string.inl @@ -328,7 +328,7 @@ inline string& string::move(string&& rhs) noexcept } template -inline bool operator==(const std::string& lhs, const string& rhs) +inline bool operator==(const std::string& lhs, const string& rhs) noexcept { if (lhs.size() != rhs.size()) { @@ -338,25 +338,25 @@ inline bool operator==(const std::string& lhs, const string& rhs) } template -inline bool operator==(const string& lhs, const std::string& rhs) +inline bool operator==(const string& lhs, const std::string& rhs) noexcept { return (rhs == lhs); } template -inline bool operator!=(const std::string& lhs, const string& rhs) +inline bool operator!=(const std::string& lhs, const string& rhs) noexcept { return !(lhs == rhs); } template -inline bool operator!=(const string& lhs, const std::string& rhs) +inline bool operator!=(const string& lhs, const std::string& rhs) noexcept { return (rhs != lhs); } template -inline std::ostream& operator<<(std::ostream& stream, const string& str) +inline std::ostream& operator<<(std::ostream& stream, const string& str) noexcept { stream << str.c_str(); return stream; @@ -393,7 +393,7 @@ inline bool string::operator!=(const char* const) const noexcept } template -inline bool operator==(const char* const, const string&) +inline bool operator==(const char* const, const string&) noexcept { static_assert(always_false::value, "The equality operator for char pointer and fixed string is disabled, because it may lead to " @@ -404,7 +404,7 @@ inline bool operator==(const char* const, const string&) } template -inline bool operator!=(const char* const, const string&) +inline bool operator!=(const char* const, const string&) noexcept { static_assert(always_false::value, "The inequality operator for char pointer and fixed string is disabled, because it may lead to " @@ -427,7 +427,7 @@ template inline typename std::enable_if<(internal::IsCharArray::value || internal::IsCxxString::value) && (internal::IsCharArray::value || internal::IsCxxString::value), string::capa + internal::GetCapa::capa>>::type -concatenate(const T1& t1, const T2& t2) +concatenate(const T1& t1, const T2& t2) noexcept { uint64_t size1 = internal::GetSize::call(t1); uint64_t size2 = internal::GetSize::call(t2); @@ -445,7 +445,7 @@ template inline typename std::enable_if<(internal::IsCharArray::value || internal::IsCxxString::value) && (internal::IsCharArray::value || internal::IsCxxString::value), string::value>>::type -concatenate(const T1& t1, const T2& t2, const Targs&... targs) +concatenate(const T1& t1, const T2& t2, const Targs&... targs) noexcept { return concatenate(concatenate(t1, t2), targs...); } @@ -455,7 +455,7 @@ inline typename std::enable_if<(internal::IsCharArray::value && internal::Is || (internal::IsCxxString::value && internal::IsCharArray::value) || (internal::IsCxxString::value && internal::IsCxxString::value), string::capa + internal::GetCapa::capa>>::type -operator+(const T1& t1, const T2& t2) +operator+(const T1& t1, const T2& t2) noexcept { return concatenate(t1, t2); } diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/unique_ptr.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/unique_ptr.inl index 9d69fae00d..dd8d6c1119 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/unique_ptr.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/unique_ptr.inl @@ -131,37 +131,37 @@ void unique_ptr::swap(unique_ptr& other) noexcept } template -bool operator==(const unique_ptr& x, const unique_ptr& y) +bool operator==(const unique_ptr& x, const unique_ptr& y) noexcept { return x.get() == y.get(); } template -bool operator==(const unique_ptr& x, std::nullptr_t) +bool operator==(const unique_ptr& x, std::nullptr_t) noexcept { return !x; } template -bool operator==(std::nullptr_t, const unique_ptr& x) +bool operator==(std::nullptr_t, const unique_ptr& x) noexcept { return !x; } template -bool operator!=(const unique_ptr& x, const unique_ptr& y) +bool operator!=(const unique_ptr& x, const unique_ptr& y) noexcept { return x.get() != y.get(); } template -bool operator!=(const unique_ptr& x, std::nullptr_t) +bool operator!=(const unique_ptr& x, std::nullptr_t) noexcept { return static_cast(x); } template -bool operator!=(std::nullptr_t, const unique_ptr& x) +bool operator!=(std::nullptr_t, const unique_ptr& x) noexcept { return static_cast(x); } diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/variant_internal.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/variant_internal.hpp index 7e6a86721e..e0f002747c 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/variant_internal.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/variant_internal.hpp @@ -94,7 +94,7 @@ struct get_type_at_index template struct call_at_index { - static void destructor(const uint64_t index, byte_t* ptr) + static void destructor(const uint64_t index, byte_t* ptr) noexcept { if (N == index) { @@ -106,7 +106,7 @@ struct call_at_index } } - static void move(const uint64_t index, byte_t* source, byte_t* destination) + static void move(const uint64_t index, byte_t* source, byte_t* destination) noexcept { if (N == index) { @@ -118,7 +118,7 @@ struct call_at_index } } - static void moveConstructor(const uint64_t index, byte_t* source, byte_t* destination) + static void moveConstructor(const uint64_t index, byte_t* source, byte_t* destination) noexcept { if (N == index) { @@ -130,7 +130,7 @@ struct call_at_index } } - static void copy(const uint64_t index, byte_t* source, byte_t* destination) + static void copy(const uint64_t index, byte_t* source, byte_t* destination) noexcept { if (N == index) { @@ -142,7 +142,7 @@ struct call_at_index } } - static void copyConstructor(const uint64_t index, byte_t* source, byte_t* destination) + static void copyConstructor(const uint64_t index, byte_t* source, byte_t* destination) noexcept { if (N == index) { @@ -158,7 +158,7 @@ struct call_at_index template struct call_at_index { - static void destructor(const uint64_t index, byte_t* ptr) + static void destructor(const uint64_t index, byte_t* ptr) noexcept { if (N == index) { @@ -170,7 +170,7 @@ struct call_at_index } } - static void move(const uint64_t index, byte_t* source, byte_t* destination) + static void move(const uint64_t index, byte_t* source, byte_t* destination) noexcept { if (N == index) { @@ -182,7 +182,7 @@ struct call_at_index } } - static void moveConstructor(const uint64_t index, byte_t* source, byte_t* destination) + static void moveConstructor(const uint64_t index, byte_t* source, byte_t* destination) noexcept { if (N == index) { @@ -194,7 +194,7 @@ struct call_at_index } } - static void copy(const uint64_t index, byte_t* source, byte_t* destination) + static void copy(const uint64_t index, byte_t* source, byte_t* destination) noexcept { if (N == index) { @@ -206,7 +206,7 @@ struct call_at_index } } - static void copyConstructor(const uint64_t index, byte_t* source, byte_t* destination) + static void copyConstructor(const uint64_t index, byte_t* source, byte_t* destination) noexcept { if (N == index) { diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/file_reader/file_reader.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/file_reader/file_reader.hpp index c713d50354..1032ca1bc7 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/file_reader/file_reader.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/file_reader/file_reader.hpp @@ -54,19 +54,19 @@ class FileReader /// error mode is evaluated when an error occurs. FileReader(const std::string& f_fileName, const std::string& f_filePath = "", - ErrorMode f_errorMode = ErrorMode::Inform); + ErrorMode f_errorMode = ErrorMode::Inform) noexcept; FileReader(const FileReader&) = delete; FileReader(FileReader&&) = delete; FileReader& operator=(const FileReader&) = delete; FileReader& operator=(FileReader&&) = delete; - ~FileReader() = default; + ~FileReader() noexcept = default; /// Check if the associated file is open. - bool IsOpen() const; + bool IsOpen() const noexcept; /// Read one line from the file and store the result in f_string. - bool ReadLine(std::string& f_string); + bool ReadLine(std::string& f_string) noexcept; private: #ifdef _WIN32 diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/access_control.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/access_control.hpp index 4de9ab8342..67cb558b24 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/access_control.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/access_control.hpp @@ -90,16 +90,16 @@ class AccessController /// @param[f_permission] Permissions which should be applied to the category. /// @param[f_id] The group or user id - depending on the category. For Category::USER, Category::GROUP and /// Category::OTHER the f_id is not required for everything else a valid group or user id is mandatory. - bool addPermissionEntry(const Category f_category, const Permission f_permission, const uint32_t f_id = -1u); + bool addPermissionEntry(const Category f_category, const Permission f_permission, const uint32_t f_id = -1u) noexcept; /// @brief just like addPermissionEntry(Category, Permission, int) but using a name instead of an id. - bool addPermissionEntry(const Category f_category, const Permission f_permission, const string_t& f_name); + bool addPermissionEntry(const Category f_category, const Permission f_permission, const string_t& f_name) noexcept; /// @brief Write permission entries stored by the AccessController to a file identified by a file descriptor. /// @param[f_fileDescriptor] identifier for a file (can be regular file, shared memory file, message queue file... /// everything is a file). /// @return true if succesful. If false, you can assume that the file has not been touched at all. - bool writePermissionsToFile(const int32_t f_fileDescriptor) const; + bool writePermissionsToFile(const int32_t f_fileDescriptor) const noexcept; private: using smartAclPointer_t = std::unique_ptr::type, std::function>; @@ -113,9 +113,9 @@ class AccessController cxx::vector m_permissions; - cxx::expected createACL(const int32_t f_numEntries) const; - bool createACLEntry(const acl_t f_ACL, const PermissionEntry& f_entry) const; - bool addAclPermission(acl_permset_t f_permset, acl_perm_t f_perm) const; + cxx::expected createACL(const int32_t f_numEntries) const noexcept; + bool createACLEntry(const acl_t f_ACL, const PermissionEntry& f_entry) const noexcept; + bool addAclPermission(acl_permset_t f_permset, acl_perm_t f_perm) const noexcept; bool m_useACLMask{false}; }; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/message_queue.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/message_queue.hpp index c56f1d8a9f..60ae348d6a 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/message_queue.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/message_queue.hpp @@ -60,52 +60,52 @@ class MessageQueue : public DesignPattern::Creation unlinkIfExists(const IpcChannelName_t& name); + static cxx::expected unlinkIfExists(const IpcChannelName_t& name) noexcept; /// close and remove message queue. - cxx::expected destroy(); + cxx::expected destroy() noexcept; /// @brief send a message to queue using std::string. /// @return true if sent without errors, false otherwise - cxx::expected send(const std::string& msg) const; + cxx::expected send(const std::string& msg) const noexcept; /// @todo zero copy receive with receive(cxx::string&); cxx::string would be the buffer for mq_receive /// @brief receive message from queue using std::string. /// @return number of characters received. In case of an error, returns -1 and msg is empty. - cxx::expected receive() const; + cxx::expected receive() const noexcept; /// @brief try to receive message from queue for a given timeout duration using std::string. Only defined /// for NON_BLOCKING == false. /// @return optional containing the received string. In case of an error, nullopt type is returned. - cxx::expected timedReceive(const units::Duration& timeout) const; + cxx::expected timedReceive(const units::Duration& timeout) const noexcept; /// @brief try to send a message to the queue for a given timeout duration using std::string - cxx::expected timedSend(const std::string& msg, const units::Duration& timeout) const; + cxx::expected timedSend(const std::string& msg, const units::Duration& timeout) const noexcept; - cxx::expected isOutdated(); + cxx::expected isOutdated() noexcept; private: MessageQueue(const IpcChannelName_t& name, const IpcChannelSide channelSide, const size_t maxMsgSize = MAX_MESSAGE_SIZE, - const uint64_t maxMsgNumber = 10u); + const uint64_t maxMsgNumber = 10u) noexcept; - cxx::expected open(const IpcChannelName_t& name, const IpcChannelSide channelSide); + cxx::expected open(const IpcChannelName_t& name, const IpcChannelSide channelSide) noexcept; - cxx::expected close(); - cxx::expected unlink(); - cxx::error createErrorFromErrnum(const int32_t errnum) const; - static cxx::error createErrorFromErrnum(const IpcChannelName_t& name, const int32_t errnum); + cxx::expected close() noexcept; + cxx::expected unlink() noexcept; + cxx::error createErrorFromErrnum(const int32_t errnum) const noexcept; + static cxx::error createErrorFromErrnum(const IpcChannelName_t& name, const int32_t errnum) noexcept; static cxx::expected sanitizeIpcChannelName(const IpcChannelName_t& name) noexcept; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/mutex.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/mutex.hpp index 87a1eaecc0..50db3ab4b5 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/mutex.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/mutex.hpp @@ -54,10 +54,10 @@ class mutex { public: /// @attention the construction of the mutex can fail. This can lead to a program termination! - mutex(const bool f_isRecursive); + mutex(const bool f_isRecursive) noexcept; /// @attention the destruction of the mutex can fail. This can lead to a program termination! - ~mutex(); + ~mutex() noexcept; /// @brief all copy and move assignment methods need to be deleted otherwise /// undefined behavior or race conditions will occure if you copy @@ -71,17 +71,17 @@ class mutex /// @brief Locks the mutex object and returns true if the underlying c /// function did not returned any error. If the mutex is already /// locked the method is blocking till the mutex can be locked. - bool lock(); + bool lock() noexcept; /// @brief Unlocks the mutex object and returns true if the underlying c /// function did not returned any error. /// IMPORTANT! Unlocking and unlocked mutex is undefined behavior /// and the underlying c function will report success in this case! - bool unlock(); + bool unlock() noexcept; /// @brief Tries to lock the mutex object. If it is not possible to lock /// the mutex object try_lock will return an error. If the c /// function fails it will return false, otherwise true. - bool try_lock(); + bool try_lock() noexcept; /// @brief Returns the native handle which then can be used in /// pthread_mutex_** calls. Required when a pthread_mutex_** diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp index b8765d7663..c1ac740c8e 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp @@ -45,9 +45,9 @@ class SharedMemoryObject : public DesignPattern::Creation MemoryMap(MemoryMap&& rhs) noexcept; MemoryMap& operator=(MemoryMap&& rhs) noexcept; - ~MemoryMap(); + ~MemoryMap() noexcept; void* getBaseAddress() const noexcept; friend class DesignPattern::Creation; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/timespec.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/timespec.hpp index 83b2fdcbc2..e3db0c96cf 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/timespec.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/timespec.hpp @@ -32,13 +32,13 @@ constexpr unsigned int TS_DIVIDER_msec = (TS_DIVIDER_sec / 1000); /// @param[in] time period time base /// @param[in] timeToAdd_ms period in time [ms] to be added /// @return sum of the two inputs [timespec] -struct timespec addTimeMs(struct timespec time, const uint32_t timeToAdd_ms); +struct timespec addTimeMs(struct timespec time, const uint32_t timeToAdd_ms) noexcept; /// @brief subtract subtrahend from minuend /// @param[in] minuend [timespec] /// @param[in] subtrahend [timespec] /// @return result [ms] -double subtractTimespecMS(const struct timespec minuend, const struct timespec subtrahend); +double subtractTimespecMS(const struct timespec minuend, const struct timespec subtrahend) noexcept; } // namespace posix } // namespace iox diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/log/logcommon.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/log/logcommon.hpp index 23cd50036a..12f69204cd 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/log/logcommon.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/log/logcommon.hpp @@ -62,10 +62,10 @@ constexpr const char* LogLevelText[] = { "[Verbose]", // bold cyan }; -LogMode operator|(LogMode lhs, LogMode rhs); -LogMode& operator|=(LogMode& lhs, LogMode rhs); -LogMode operator&(LogMode lhs, LogMode rhs); -LogMode& operator&=(LogMode& lhs, LogMode rhs); +LogMode operator|(LogMode lhs, LogMode rhs) noexcept; +LogMode& operator|=(LogMode& lhs, LogMode rhs) noexcept; +LogMode operator&(LogMode lhs, LogMode rhs) noexcept; +LogMode& operator&=(LogMode& lhs, LogMode rhs) noexcept; struct LogEntry { diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/log/logger.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/log/logger.hpp index 4699bf4457..a0d474bd5b 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/log/logger.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/log/logger.hpp @@ -40,8 +40,8 @@ class Logger friend class LogStream; public: - Logger(Logger&& other); - Logger& operator=(Logger&& rhs); + Logger(Logger&& other) noexcept; + Logger& operator=(Logger&& rhs) noexcept; Logger(const Logger& other) = delete; Logger& operator=(const Logger& rhs) = delete; @@ -71,13 +71,13 @@ class Logger LogStream LogVerbose() noexcept; protected: - Logger(std::string ctxId, std::string ctxDescription, LogLevel appLogLevel); + Logger(std::string ctxId, std::string ctxDescription, LogLevel appLogLevel) noexcept; // virtual because of Logger_Mock - virtual void Log(const LogEntry& entry) const; + virtual void Log(const LogEntry& entry) const noexcept; private: - void Print(const LogEntry entry) const; + void Print(const LogEntry entry) const noexcept; std::atomic m_logLevel{LogLevel::kVerbose}; std::atomic m_logLevelPredecessor{LogLevel::kVerbose}; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/log/logging.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/log/logging.hpp index cda7a37daa..7e8fa02208 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/log/logging.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/log/logging.hpp @@ -29,68 +29,68 @@ namespace log { Logger& CreateLogger(std::string ctxId, std::string ctxDescription, LogLevel appDefLogLevel = LogLevel::kWarn) noexcept; -inline constexpr LogHex8 HexFormat(uint8_t value) +inline constexpr LogHex8 HexFormat(uint8_t value) noexcept { return LogHex8(value); } -inline constexpr LogHex8 HexFormat(int8_t value) +inline constexpr LogHex8 HexFormat(int8_t value) noexcept { return LogHex8(static_cast(value)); } -inline constexpr LogHex16 HexFormat(uint16_t value) +inline constexpr LogHex16 HexFormat(uint16_t value) noexcept { return LogHex16(value); } -inline constexpr LogHex16 HexFormat(int16_t value) +inline constexpr LogHex16 HexFormat(int16_t value) noexcept { return LogHex16(static_cast(value)); } -inline constexpr LogHex32 HexFormat(uint32_t value) +inline constexpr LogHex32 HexFormat(uint32_t value) noexcept { return LogHex32(value); } -inline constexpr LogHex32 HexFormat(int32_t value) +inline constexpr LogHex32 HexFormat(int32_t value) noexcept { return LogHex32(static_cast(value)); } -inline constexpr LogHex64 HexFormat(uint64_t value) +inline constexpr LogHex64 HexFormat(uint64_t value) noexcept { return LogHex64(value); } -inline constexpr LogHex64 HexFormat(int64_t value) +inline constexpr LogHex64 HexFormat(int64_t value) noexcept { return LogHex64(static_cast(value)); } -inline constexpr LogBin8 BinFormat(uint8_t value) +inline constexpr LogBin8 BinFormat(uint8_t value) noexcept { return LogBin8(value); } -inline constexpr LogBin8 BinFormat(int8_t value) +inline constexpr LogBin8 BinFormat(int8_t value) noexcept { return LogBin8(static_cast(value)); } -inline constexpr LogBin16 BinFormat(uint16_t value) +inline constexpr LogBin16 BinFormat(uint16_t value) noexcept { return LogBin16(value); } -inline constexpr LogBin16 BinFormat(int16_t value) +inline constexpr LogBin16 BinFormat(int16_t value) noexcept { return LogBin16(static_cast(value)); } -inline constexpr LogBin32 BinFormat(uint32_t value) +inline constexpr LogBin32 BinFormat(uint32_t value) noexcept { return LogBin32(value); } -inline constexpr LogBin32 BinFormat(int32_t value) +inline constexpr LogBin32 BinFormat(int32_t value) noexcept { return LogBin32(static_cast(value)); } -inline constexpr LogBin64 BinFormat(uint64_t value) +inline constexpr LogBin64 BinFormat(uint64_t value) noexcept { return LogBin64(value); } -inline constexpr LogBin64 BinFormat(int64_t value) +inline constexpr LogBin64 BinFormat(int64_t value) noexcept { return LogBin64(static_cast(value)); } diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/log/logging_free_function_building_block.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/log/logging_free_function_building_block.hpp index 59c5c5be03..3f55bc6e98 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/log/logging_free_function_building_block.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/log/logging_free_function_building_block.hpp @@ -66,7 +66,7 @@ namespace log namespace ffbb { template -static Logger& ComponentLogger() +static Logger& ComponentLogger() noexcept { static auto& logger = CreateLogger(T::Ctx, T::Description, LogManager::GetLogManager().DefaultLogLevel()); return logger; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/log/logmanager.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/log/logmanager.hpp index ecfdff3446..a5b9a14d90 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/log/logmanager.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/log/logmanager.hpp @@ -37,10 +37,10 @@ enum class LogLevelOutput : uint8_t class LogManager { public: - static LogManager& GetLogManager(); + static LogManager& GetLogManager() noexcept; static Logger& CreateLogContext(std::string ctxId, std::string ctxDescription, LogLevel appDefLogLevel) noexcept; - ~LogManager() = default; + ~LogManager() noexcept = default; LogManager(const LogManager&) = delete; LogManager(LogManager&&) = delete; @@ -55,7 +55,7 @@ class LogManager void SetDefaultLogMode(const LogMode logMode) noexcept; protected: - LogManager() = default; + LogManager() noexcept = default; private: std::atomic m_defaultLogLevel{LogLevel::kVerbose}; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/log/logstream.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/log/logstream.hpp index 8e7deaed20..3fd2a956db 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/log/logstream.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/log/logstream.hpp @@ -38,7 +38,7 @@ struct LogHex struct LogHex8 : private LogHex { uint8_t value; - constexpr LogHex8(uint8_t value) + constexpr LogHex8(uint8_t value) noexcept : value(value) { } @@ -47,7 +47,7 @@ struct LogHex8 : private LogHex struct LogHex16 : private LogHex { uint16_t value; - constexpr LogHex16(uint16_t value) + constexpr LogHex16(uint16_t value) noexcept : value(value) { } @@ -55,7 +55,7 @@ struct LogHex16 : private LogHex struct LogHex32 : private LogHex { uint32_t value; - constexpr LogHex32(uint32_t value) + constexpr LogHex32(uint32_t value) noexcept : value(value) { } @@ -63,7 +63,7 @@ struct LogHex32 : private LogHex struct LogHex64 : private LogHex { uint64_t value; - constexpr LogHex64(uint64_t value) + constexpr LogHex64(uint64_t value) noexcept : value(value) { } @@ -77,7 +77,7 @@ struct LogBin struct LogBin8 : private LogBin { uint8_t value; - constexpr LogBin8(uint8_t value) + constexpr LogBin8(uint8_t value) noexcept : value(value) { } @@ -85,7 +85,7 @@ struct LogBin8 : private LogBin struct LogBin16 : private LogBin { uint16_t value; - constexpr LogBin16(uint16_t value) + constexpr LogBin16(uint16_t value) noexcept : value(value) { } @@ -93,13 +93,13 @@ struct LogBin16 : private LogBin struct LogBin32 : private LogBin { uint32_t value; - constexpr LogBin32(uint32_t value) + constexpr LogBin32(uint32_t value) noexcept : value(value){}; }; struct LogBin64 : private LogBin { uint64_t value; - constexpr LogBin64(uint64_t value) + constexpr LogBin64(uint64_t value) noexcept : value(value) { } @@ -115,11 +115,11 @@ class Logger; class LogStream { public: - LogStream(Logger& logger, LogLevel logLevel = LogLevel::kWarn); + LogStream(Logger& logger, LogLevel logLevel = LogLevel::kWarn) noexcept; - virtual ~LogStream(); + virtual ~LogStream() noexcept; - void Flush(); + void Flush() noexcept; LogStream& operator<<(const char* cstr) noexcept; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/posix_access_rights.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/posix_access_rights.hpp index 6a84bae39a..94fc3feb59 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/posix_access_rights.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/posix_access_rights.hpp @@ -32,7 +32,7 @@ static constexpr int MaxNumberOfGroups = 888; struct PosixRights { - PosixRights(bool f_read, bool f_write, bool f_execute); + PosixRights(bool f_read, bool f_write, bool f_execute) noexcept; bool m_read; bool m_write; bool m_execute; @@ -42,20 +42,20 @@ class PosixGroup { public: using string_t = cxx::string<100>; - PosixGroup(gid_t f_id); - PosixGroup(string_t f_name); + PosixGroup(gid_t f_id) noexcept; + PosixGroup(string_t f_name) noexcept; - bool operator==(const PosixGroup& other) const; + bool operator==(const PosixGroup& other) const noexcept; - string_t getName() const; - gid_t getID() const; + string_t getName() const noexcept; + gid_t getID() const noexcept; - bool doesExist() const; + bool doesExist() const noexcept; - static PosixGroup getGroupOfCurrentProcess(); + static PosixGroup getGroupOfCurrentProcess() noexcept; - static cxx::optional getGroupID(const string_t& f_name); - static cxx::optional getGroupName(gid_t f_id); + static cxx::optional getGroupID(const string_t& f_name) noexcept; + static cxx::optional getGroupName(gid_t f_id) noexcept; private: gid_t m_id; @@ -68,19 +68,19 @@ class PosixUser using groupVector_t = cxx::vector; using string_t = cxx::string<100>; - PosixUser(uid_t f_id); - PosixUser(const string_t& f_name); + PosixUser(uid_t f_id) noexcept; + PosixUser(const string_t& f_name) noexcept; - groupVector_t getGroups() const; - string_t getName() const; - uid_t getID() const; + groupVector_t getGroups() const noexcept; + string_t getName() const noexcept; + uid_t getID() const noexcept; - bool doesExist() const; + bool doesExist() const noexcept; - static PosixUser getUserOfCurrentProcess(); + static PosixUser getUserOfCurrentProcess() noexcept; - static cxx::optional getUserID(const string_t& f_name); - static cxx::optional getUserName(uid_t f_id); + static cxx::optional getUserID(const string_t& f_name) noexcept; + static cxx::optional getUserName(uid_t f_id) noexcept; private: uid_t m_id; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/thread.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/thread.hpp index d83c578580..004ad88bd3 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/thread.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/thread.hpp @@ -28,8 +28,8 @@ constexpr uint64_t MAX_THREAD_NAME_LENGTH = 15U; using ThreadName_t = cxx::string; -void setThreadName(pthread_t thread, const ThreadName_t& name); -ThreadName_t getThreadName(pthread_t thread); +void setThreadName(pthread_t thread, const ThreadName_t& name) noexcept; +ThreadName_t getThreadName(pthread_t thread) noexcept; } // namespace posix } // namespace iox diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/timer.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/timer.hpp index 7f30f4187a..cc6b9b80fc 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/timer.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/timer.hpp @@ -144,7 +144,7 @@ class Timer #endif public: /// @brief Wrapper that can be registered with the operating system - static void callbackHelper(sigval data); + static void callbackHelper(sigval data) noexcept; OsTimer(const units::Duration timeToWait, const std::function& callback) noexcept; diff --git a/iceoryx_hoofs/source/cxx/helplets.cpp b/iceoryx_hoofs/source/cxx/helplets.cpp index d574868f43..0993da97b4 100644 --- a/iceoryx_hoofs/source/cxx/helplets.cpp +++ b/iceoryx_hoofs/source/cxx/helplets.cpp @@ -36,7 +36,7 @@ void* alignedAlloc(const uint64_t alignment, const uint64_t size) noexcept return reinterpret_cast(alignedMemory); } -void alignedFree(void* const memory) +void alignedFree(void* const memory) noexcept { if (memory != nullptr) { diff --git a/iceoryx_hoofs/source/error_handling/error_handling.cpp b/iceoryx_hoofs/source/error_handling/error_handling.cpp index 40cc571a5a..b02c2ae138 100644 --- a/iceoryx_hoofs/source/error_handling/error_handling.cpp +++ b/iceoryx_hoofs/source/error_handling/error_handling.cpp @@ -32,13 +32,13 @@ HandlerFunction ErrorHandler::handler = {ErrorHandler::DefaultHandler}; std::mutex ErrorHandler::handler_mutex; -std::ostream& operator<<(std::ostream& stream, Error value) +std::ostream& operator<<(std::ostream& stream, Error value) noexcept { stream << ErrorHandler::ToString(value); return stream; } -void ErrorHandler::DefaultHandler(const Error error, const std::function errorCallBack, const ErrorLevel level) +void ErrorHandler::DefaultHandler(const Error error, const std::function errorCallBack, const ErrorLevel level) noexcept { if (errorCallBack) { @@ -53,7 +53,7 @@ void ErrorHandler::DefaultHandler(const Error error, const std::function } } -void ErrorHandler::ReactOnErrorLevel(const ErrorLevel level, const char* errorText) +void ErrorHandler::ReactOnErrorLevel(const ErrorLevel level, const char* errorText) noexcept { static auto& logger = CreateLogger("", "", log::LogManager::GetLogManager().DefaultLogLevel()); switch (level) @@ -73,7 +73,7 @@ void ErrorHandler::ReactOnErrorLevel(const ErrorLevel level, const char* errorTe } } -cxx::GenericRAII ErrorHandler::SetTemporaryErrorHandler(const HandlerFunction& newHandler) +cxx::GenericRAII ErrorHandler::SetTemporaryErrorHandler(const HandlerFunction& newHandler) noexcept { return cxx::GenericRAII( [&newHandler] { @@ -87,12 +87,12 @@ cxx::GenericRAII ErrorHandler::SetTemporaryErrorHandler(const HandlerFunction& n } -const char* ErrorHandler::ToString(const Error error) +const char* ErrorHandler::ToString(const Error error) noexcept { return ErrorHandler::errorNames[static_cast(error)]; } -void errorHandler(const Error error, const std::function errorCallBack, const ErrorLevel level) +void errorHandler(const Error error, const std::function errorCallBack, const ErrorLevel level) noexcept { ErrorHandler::handler(error, errorCallBack, level); } diff --git a/iceoryx_hoofs/source/file_reader/file_reader.cpp b/iceoryx_hoofs/source/file_reader/file_reader.cpp index c81d706c52..3e2316d117 100644 --- a/iceoryx_hoofs/source/file_reader/file_reader.cpp +++ b/iceoryx_hoofs/source/file_reader/file_reader.cpp @@ -25,7 +25,7 @@ namespace cxx { constexpr char FileReader::PATH_SEPARATOR[]; -FileReader::FileReader(const std::string& f_fileName, const std::string& f_filePath, ErrorMode f_errorMode) +FileReader::FileReader(const std::string& f_fileName, const std::string& f_filePath, ErrorMode f_errorMode) noexcept : m_errorMode{f_errorMode} { m_file = f_filePath.empty() ? f_fileName : f_filePath + PATH_SEPARATOR + f_fileName; @@ -61,12 +61,12 @@ FileReader::FileReader(const std::string& f_fileName, const std::string& f_fileP } } -bool FileReader::IsOpen() const +bool FileReader::IsOpen() const noexcept { return m_fileStream.is_open(); } -bool FileReader::ReadLine(std::string& f_string) +bool FileReader::ReadLine(std::string& f_string) noexcept { return static_cast(std::getline(m_fileStream, f_string)); } diff --git a/iceoryx_hoofs/source/log/logcommon.cpp b/iceoryx_hoofs/source/log/logcommon.cpp index 9b6a317d21..852d5ded4b 100644 --- a/iceoryx_hoofs/source/log/logcommon.cpp +++ b/iceoryx_hoofs/source/log/logcommon.cpp @@ -25,23 +25,23 @@ namespace iox { namespace log { -LogMode operator|(LogMode lhs, LogMode rhs) +LogMode operator|(LogMode lhs, LogMode rhs) noexcept { return static_cast(static_cast(lhs) | static_cast(rhs)); } -LogMode& operator|=(LogMode& lhs, LogMode rhs) +LogMode& operator|=(LogMode& lhs, LogMode rhs) noexcept { lhs = static_cast(static_cast(lhs) | static_cast(rhs)); return lhs; } -LogMode operator&(LogMode lhs, LogMode rhs) +LogMode operator&(LogMode lhs, LogMode rhs) noexcept { return static_cast(static_cast(lhs) & static_cast(rhs)); } -LogMode& operator&=(LogMode& lhs, LogMode rhs) +LogMode& operator&=(LogMode& lhs, LogMode rhs) noexcept { lhs = static_cast(static_cast(lhs) & static_cast(rhs)); return lhs; diff --git a/iceoryx_hoofs/source/log/logger.cpp b/iceoryx_hoofs/source/log/logger.cpp index 0fb84960ef..0ae6b7df3c 100644 --- a/iceoryx_hoofs/source/log/logger.cpp +++ b/iceoryx_hoofs/source/log/logger.cpp @@ -34,18 +34,18 @@ namespace iox { namespace log { -Logger::Logger(IOX_MAYBE_UNUSED std::string ctxId, IOX_MAYBE_UNUSED std::string ctxDescription, LogLevel appLogLevel) +Logger::Logger(IOX_MAYBE_UNUSED std::string ctxId, IOX_MAYBE_UNUSED std::string ctxDescription, LogLevel appLogLevel) noexcept : m_logLevel(appLogLevel) { } -Logger::Logger(Logger&& other) +Logger::Logger(Logger&& other) noexcept { m_logLevel.store(other.m_logLevel.load(std::memory_order_relaxed), std::memory_order_relaxed); m_logMode.store(other.m_logMode.load(std::memory_order_relaxed), std::memory_order_relaxed); } -Logger& Logger::operator=(Logger&& rhs) +Logger& Logger::operator=(Logger&& rhs) noexcept { m_logLevel.store(rhs.m_logLevel.load(std::memory_order_relaxed), std::memory_order_relaxed); m_logMode.store(rhs.m_logMode.load(std::memory_order_relaxed), std::memory_order_relaxed); @@ -114,7 +114,7 @@ LogStream Logger::LogVerbose() noexcept return LogStream(*this, LogLevel::kVerbose); } -void Logger::Print(const LogEntry entry) const +void Logger::Print(const LogEntry entry) const noexcept { // as long as there is only this synchronous logger, buffer the output before using clog to prevent interleaving // output because of threaded access @@ -138,7 +138,7 @@ bool Logger::IsEnabled(const LogLevel logLevel) const noexcept return (logLevel <= m_logLevel.load(std::memory_order_relaxed)); } -void Logger::Log(const LogEntry& entry) const +void Logger::Log(const LogEntry& entry) const noexcept { /// @todo do we want a ringbuffer where we store the last e.g. 100 logs /// event if they are below the current log level and print them if case of kFatal? diff --git a/iceoryx_hoofs/source/log/logmanager.cpp b/iceoryx_hoofs/source/log/logmanager.cpp index 517f55a154..6fee8fcb9f 100644 --- a/iceoryx_hoofs/source/log/logmanager.cpp +++ b/iceoryx_hoofs/source/log/logmanager.cpp @@ -28,7 +28,7 @@ namespace iox { namespace log { -LogManager& LogManager::GetLogManager() +LogManager& LogManager::GetLogManager() noexcept { static LogManager manager; return manager; diff --git a/iceoryx_hoofs/source/log/logstream.cpp b/iceoryx_hoofs/source/log/logstream.cpp index bc987141d5..17c342e318 100644 --- a/iceoryx_hoofs/source/log/logstream.cpp +++ b/iceoryx_hoofs/source/log/logstream.cpp @@ -28,7 +28,7 @@ namespace iox { namespace log { -LogStream::LogStream(Logger& logger, LogLevel logLevel) +LogStream::LogStream(Logger& logger, LogLevel logLevel) noexcept : m_logger(logger) { m_logEntry.level = logLevel; @@ -42,7 +42,7 @@ LogStream::~LogStream() Flush(); } -void LogStream::Flush() +void LogStream::Flush() noexcept { /// @todo do we want to send the log to the logger even if the loglevel is lower than the global log level? if (!m_flushed) diff --git a/iceoryx_hoofs/source/posix_wrapper/access_control.cpp b/iceoryx_hoofs/source/posix_wrapper/access_control.cpp index a0a7f68021..d06e3da81b 100644 --- a/iceoryx_hoofs/source/posix_wrapper/access_control.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/access_control.cpp @@ -26,7 +26,7 @@ namespace iox { namespace posix { -bool AccessController::writePermissionsToFile(const int32_t f_fileDescriptor) const +bool AccessController::writePermissionsToFile(const int32_t f_fileDescriptor) const noexcept { if (m_permissions.empty()) { @@ -80,7 +80,7 @@ bool AccessController::writePermissionsToFile(const int32_t f_fileDescriptor) co } cxx::expected -AccessController::createACL(const int32_t f_numEntries) const +AccessController::createACL(const int32_t f_numEntries) const noexcept { // allocate memory for a new ACL auto aclInitCall = posixCall(acl_init)(f_numEntries).failureReturnValue(nullptr).evaluate(); @@ -102,7 +102,7 @@ AccessController::createACL(const int32_t f_numEntries) const bool AccessController::addPermissionEntry(const Category f_category, const Permission f_permission, - const string_t& f_name) + const string_t& f_name) noexcept { switch (f_category) { @@ -154,7 +154,7 @@ bool AccessController::addPermissionEntry(const Category f_category, return false; } -bool AccessController::addPermissionEntry(const Category f_category, const Permission f_permission, const uint32_t f_id) +bool AccessController::addPermissionEntry(const Category f_category, const Permission f_permission, const uint32_t f_id) noexcept { if (m_permissions.size() >= m_permissions.capacity()) { @@ -195,7 +195,7 @@ bool AccessController::addPermissionEntry(const Category f_category, const Permi return true; } -bool AccessController::createACLEntry(const acl_t f_ACL, const PermissionEntry& f_entry) const +bool AccessController::createACLEntry(const acl_t f_ACL, const PermissionEntry& f_entry) const noexcept { // create new entry in acl acl_entry_t newEntry; @@ -292,7 +292,7 @@ bool AccessController::createACLEntry(const acl_t f_ACL, const PermissionEntry& } } -bool AccessController::addAclPermission(acl_permset_t f_permset, acl_perm_t f_perm) const +bool AccessController::addAclPermission(acl_permset_t f_permset, acl_perm_t f_perm) const noexcept { auto aclAddPermCall = posixCall(acl_add_perm)(f_permset, f_perm).successReturnValue(0).evaluate(); diff --git a/iceoryx_hoofs/source/posix_wrapper/message_queue.cpp b/iceoryx_hoofs/source/posix_wrapper/message_queue.cpp index f2e1c7c69d..cca111cd50 100644 --- a/iceoryx_hoofs/source/posix_wrapper/message_queue.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/message_queue.cpp @@ -29,7 +29,7 @@ namespace iox { namespace posix { -MessageQueue::MessageQueue() +MessageQueue::MessageQueue() noexcept { this->m_isInitialized = false; this->m_errorValue = IpcChannelError::NOT_INITIALIZED; @@ -38,7 +38,7 @@ MessageQueue::MessageQueue() MessageQueue::MessageQueue(const IpcChannelName_t& name, const IpcChannelSide channelSide, const size_t maxMsgSize, - const uint64_t maxMsgNumber) + const uint64_t maxMsgNumber) noexcept : m_channelSide(channelSide) { sanitizeIpcChannelName(name) @@ -93,7 +93,7 @@ MessageQueue::MessageQueue(const IpcChannelName_t& name, } } -MessageQueue::MessageQueue(MessageQueue&& other) +MessageQueue::MessageQueue(MessageQueue&& other) noexcept { *this = std::move(other); } @@ -106,7 +106,7 @@ MessageQueue::~MessageQueue() } } -MessageQueue& MessageQueue::operator=(MessageQueue&& other) +MessageQueue& MessageQueue::operator=(MessageQueue&& other) noexcept { if (this != &other) { @@ -127,7 +127,7 @@ MessageQueue& MessageQueue::operator=(MessageQueue&& other) return *this; } -cxx::expected MessageQueue::unlinkIfExists(const IpcChannelName_t& name) +cxx::expected MessageQueue::unlinkIfExists(const IpcChannelName_t& name) noexcept { IpcChannelName_t l_name; if (sanitizeIpcChannelName(name).and_then([&](IpcChannelName_t& name) { l_name = std::move(name); }).has_error()) @@ -145,7 +145,7 @@ cxx::expected MessageQueue::unlinkIfExists(const IpcChann return cxx::success(mqCall->errnum != ENOENT); } -cxx::expected MessageQueue::destroy() +cxx::expected MessageQueue::destroy() noexcept { if (m_mqDescriptor != INVALID_DESCRIPTOR) { @@ -168,7 +168,7 @@ cxx::expected MessageQueue::destroy() return cxx::success(); } -cxx::expected MessageQueue::send(const std::string& msg) const +cxx::expected MessageQueue::send(const std::string& msg) const noexcept { const size_t messageSize = static_cast(msg.size()) + NULL_TERMINATOR_SIZE; if (messageSize > static_cast(m_attributes.mq_msgsize)) @@ -187,7 +187,7 @@ cxx::expected MessageQueue::send(const std::string& msg) const return cxx::success(); } -cxx::expected MessageQueue::receive() const +cxx::expected MessageQueue::receive() const noexcept { char message[MAX_MESSAGE_SIZE]; @@ -204,7 +204,7 @@ cxx::expected MessageQueue::receive() const } cxx::expected MessageQueue::open(const IpcChannelName_t& name, - const IpcChannelSide channelSide) + const IpcChannelSide channelSide) noexcept { IpcChannelName_t l_name; if (sanitizeIpcChannelName(name).and_then([&](IpcChannelName_t& name) { l_name = std::move(name); }).has_error()) @@ -236,7 +236,7 @@ cxx::expected MessageQueue::open(const IpcChannelName_ return cxx::success(mqCall->value); } -cxx::expected MessageQueue::close() +cxx::expected MessageQueue::close() noexcept { auto mqCall = posixCall(mq_close)(m_mqDescriptor).failureReturnValue(ERROR_CODE).evaluate(); @@ -248,7 +248,7 @@ cxx::expected MessageQueue::close() return cxx::success(); } -cxx::expected MessageQueue::unlink() +cxx::expected MessageQueue::unlink() noexcept { if (m_channelSide == IpcChannelSide::CLIENT) { @@ -266,7 +266,7 @@ cxx::expected MessageQueue::unlink() } } -cxx::expected MessageQueue::timedReceive(const units::Duration& timeout) const +cxx::expected MessageQueue::timedReceive(const units::Duration& timeout) const noexcept { timespec timeOut = timeout.timespec(units::TimeSpecReference::Epoch); char message[MAX_MESSAGE_SIZE]; @@ -289,7 +289,7 @@ cxx::expected MessageQueue::timedReceive(const uni return cxx::success(std::string(&(message[0]))); } -cxx::expected MessageQueue::timedSend(const std::string& msg, const units::Duration& timeout) const +cxx::expected MessageQueue::timedSend(const std::string& msg, const units::Duration& timeout) const noexcept { const size_t messageSize = static_cast(msg.size()) + NULL_TERMINATOR_SIZE; if (messageSize > static_cast(m_attributes.mq_msgsize)) @@ -319,7 +319,7 @@ cxx::expected MessageQueue::timedSend(const std::string& msg, c return cxx::success(); } -cxx::expected MessageQueue::isOutdated() +cxx::expected MessageQueue::isOutdated() noexcept { struct stat sb; auto fstatCall = posixCall(fstat)(m_mqDescriptor, &sb).failureReturnValue(-1).evaluate(); @@ -330,12 +330,12 @@ cxx::expected MessageQueue::isOutdated() return cxx::success(sb.st_nlink == 0); } -cxx::error MessageQueue::createErrorFromErrnum(const int32_t errnum) const +cxx::error MessageQueue::createErrorFromErrnum(const int32_t errnum) const noexcept { return createErrorFromErrnum(m_name, errnum); } -cxx::error MessageQueue::createErrorFromErrnum(const IpcChannelName_t& name, const int32_t errnum) +cxx::error MessageQueue::createErrorFromErrnum(const IpcChannelName_t& name, const int32_t errnum) noexcept { switch (errnum) { diff --git a/iceoryx_hoofs/source/posix_wrapper/mutex.cpp b/iceoryx_hoofs/source/posix_wrapper/mutex.cpp index 33b1aa562c..847fe67f5b 100644 --- a/iceoryx_hoofs/source/posix_wrapper/mutex.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/mutex.cpp @@ -26,7 +26,7 @@ namespace iox { namespace posix { -mutex::mutex(bool f_isRecursive) +mutex::mutex(bool f_isRecursive) noexcept { pthread_mutexattr_t attr; bool isInitialized{true}; @@ -62,17 +62,17 @@ pthread_mutex_t mutex::get_native_handle() const noexcept return m_handle; } -bool mutex::lock() +bool mutex::lock() noexcept { return !posixCall(pthread_mutex_lock)(&m_handle).successReturnValue(0).evaluate().has_error(); } -bool mutex::unlock() +bool mutex::unlock() noexcept { return !posixCall(pthread_mutex_unlock)(&m_handle).successReturnValue(0).evaluate().has_error(); } -bool mutex::try_lock() +bool mutex::try_lock() noexcept { auto result = posixCall(pthread_mutex_trylock)(&m_handle).returnValueMatchesErrno().ignoreErrnos(EBUSY).evaluate(); bool isBusy = !result.has_error() && result->errnum == EBUSY; diff --git a/iceoryx_hoofs/source/posix_wrapper/posix_access_rights.cpp b/iceoryx_hoofs/source/posix_wrapper/posix_access_rights.cpp index 7e8683c366..0de0ef3a3b 100644 --- a/iceoryx_hoofs/source/posix_wrapper/posix_access_rights.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/posix_access_rights.cpp @@ -30,20 +30,20 @@ namespace iox { namespace posix { -PosixRights::PosixRights(bool f_read, bool f_write, bool f_execute) +PosixRights::PosixRights(bool f_read, bool f_write, bool f_execute) noexcept : m_read(f_read) , m_write(f_write) , m_execute(f_execute) { } -PosixGroup::PosixGroup(gid_t f_id) +PosixGroup::PosixGroup(gid_t f_id) noexcept : m_id(f_id) , m_doesExist(getGroupName(f_id).has_value()) { } -PosixGroup::PosixGroup(PosixGroup::string_t f_name) +PosixGroup::PosixGroup(PosixGroup::string_t f_name) noexcept { auto id = getGroupID(f_name); if (id.has_value()) @@ -57,17 +57,17 @@ PosixGroup::PosixGroup(PosixGroup::string_t f_name) } } -bool PosixGroup::operator==(const PosixGroup& other) const +bool PosixGroup::operator==(const PosixGroup& other) const noexcept { return (m_id == other.m_id); } -PosixGroup PosixGroup::getGroupOfCurrentProcess() +PosixGroup PosixGroup::getGroupOfCurrentProcess() noexcept { return PosixGroup(getegid()); } -cxx::optional PosixGroup::getGroupID(const PosixGroup::string_t& f_name) +cxx::optional PosixGroup::getGroupID(const PosixGroup::string_t& f_name) noexcept { auto getgrnamCall = posixCall(getgrnam)(f_name.c_str()).failureReturnValue(nullptr).evaluate(); @@ -80,7 +80,7 @@ cxx::optional PosixGroup::getGroupID(const PosixGroup::string_t& f_name) return cxx::make_optional(getgrnamCall->value->gr_gid); } -cxx::optional PosixGroup::getGroupName(gid_t f_id) +cxx::optional PosixGroup::getGroupName(gid_t f_id) noexcept { auto getgrgidCall = posixCall(getgrgid)(f_id).failureReturnValue(nullptr).evaluate(); @@ -93,7 +93,7 @@ cxx::optional PosixGroup::getGroupName(gid_t f_id) return cxx::make_optional(string_t(iox::cxx::TruncateToCapacity, getgrgidCall->value->gr_name)); } -PosixGroup::string_t PosixGroup::getName() const +PosixGroup::string_t PosixGroup::getName() const noexcept { auto name = getGroupName(m_id); if (name.has_value()) @@ -106,17 +106,17 @@ PosixGroup::string_t PosixGroup::getName() const } } -gid_t PosixGroup::getID() const +gid_t PosixGroup::getID() const noexcept { return m_id; } -bool PosixGroup::doesExist() const +bool PosixGroup::doesExist() const noexcept { return m_doesExist; } -cxx::optional PosixUser::getUserID(const PosixGroup::string_t& f_name) +cxx::optional PosixUser::getUserID(const PosixGroup::string_t& f_name) noexcept { auto getpwnamCall = posixCall(getpwnam)(f_name.c_str()).failureReturnValue(nullptr).evaluate(); @@ -128,7 +128,7 @@ cxx::optional PosixUser::getUserID(const PosixGroup::string_t& f_name) return cxx::make_optional(getpwnamCall->value->pw_uid); } -cxx::optional PosixUser::getUserName(uid_t f_id) +cxx::optional PosixUser::getUserName(uid_t f_id) noexcept { auto getpwuidCall = posixCall(getpwuid)(f_id).failureReturnValue(nullptr).evaluate(); @@ -140,7 +140,7 @@ cxx::optional PosixUser::getUserName(uid_t f_id) return cxx::make_optional(string_t(iox::cxx::TruncateToCapacity, getpwuidCall->value->pw_name)); } -PosixUser::groupVector_t PosixUser::getGroups() const +PosixUser::groupVector_t PosixUser::getGroups() const noexcept { auto userName = getUserName(m_id); if (!userName.has_value()) @@ -184,13 +184,13 @@ PosixUser::groupVector_t PosixUser::getGroups() const return vec; } -PosixUser::PosixUser(uid_t f_id) +PosixUser::PosixUser(uid_t f_id) noexcept : m_id(f_id) , m_doesExist(getUserName(f_id).has_value()) { } -PosixUser::PosixUser(const PosixUser::string_t& f_name) +PosixUser::PosixUser(const PosixUser::string_t& f_name) noexcept { auto id = getUserID(f_name); if (id.has_value()) @@ -204,7 +204,7 @@ PosixUser::PosixUser(const PosixUser::string_t& f_name) } } -PosixUser::string_t PosixUser::getName() const +PosixUser::string_t PosixUser::getName() const noexcept { auto name = getUserName(m_id); if (name.has_value()) @@ -217,17 +217,17 @@ PosixUser::string_t PosixUser::getName() const } } -uid_t PosixUser::getID() const +uid_t PosixUser::getID() const noexcept { return m_id; } -bool PosixUser::doesExist() const +bool PosixUser::doesExist() const noexcept { return m_doesExist; } -PosixUser PosixUser::getUserOfCurrentProcess() +PosixUser PosixUser::getUserOfCurrentProcess() noexcept { return PosixUser(geteuid()); } diff --git a/iceoryx_hoofs/source/posix_wrapper/shared_memory_object.cpp b/iceoryx_hoofs/source/posix_wrapper/shared_memory_object.cpp index 6c3609a819..81d707a8ea 100644 --- a/iceoryx_hoofs/source/posix_wrapper/shared_memory_object.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/shared_memory_object.cpp @@ -37,7 +37,7 @@ constexpr uint64_t SIGBUS_ERROR_MESSAGE_LENGTH = 1024U + platform::IOX_MAX_SHM_N static char sigbusErrorMessage[SIGBUS_ERROR_MESSAGE_LENGTH]; static std::mutex sigbusHandlerMutex; -static void memsetSigbusHandler(int) +static void memsetSigbusHandler(int) noexcept { auto result = write(STDERR_FILENO, sigbusErrorMessage, strnlen(sigbusErrorMessage, SIGBUS_ERROR_MESSAGE_LENGTH)); IOX_DISCARD_RESULT(result); diff --git a/iceoryx_hoofs/source/posix_wrapper/thread.cpp b/iceoryx_hoofs/source/posix_wrapper/thread.cpp index ab029e0a9c..a7d2a27d62 100644 --- a/iceoryx_hoofs/source/posix_wrapper/thread.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/thread.cpp @@ -22,7 +22,7 @@ namespace iox { namespace posix { -void setThreadName(pthread_t thread, const ThreadName_t& name) +void setThreadName(pthread_t thread, const ThreadName_t& name) noexcept { posixCall(iox_pthread_setname_np)(thread, name.c_str()).successReturnValue(0).evaluate().or_else([](auto& r) { // String length limit is ensured through cxx::string @@ -32,7 +32,7 @@ void setThreadName(pthread_t thread, const ThreadName_t& name) }); } -ThreadName_t getThreadName(pthread_t thread) +ThreadName_t getThreadName(pthread_t thread) noexcept { char tempName[MAX_THREAD_NAME_LENGTH + 1U]; diff --git a/iceoryx_hoofs/source/posix_wrapper/timer.cpp b/iceoryx_hoofs/source/posix_wrapper/timer.cpp index d123bb1993..3a852ee59d 100644 --- a/iceoryx_hoofs/source/posix_wrapper/timer.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/timer.cpp @@ -60,7 +60,7 @@ void Timer::OsTimerCallbackHandle::incrementDescriptor() noexcept m_descriptor.store(callbackHandleDescriptor, std::memory_order_relaxed); } -void Timer::OsTimer::callbackHelper(sigval data) +void Timer::OsTimer::callbackHelper(sigval data) noexcept { uint32_t index = Timer::OsTimerCallbackHandle::sigvalToIndex(data); auto descriptor = Timer::OsTimerCallbackHandle::sigvalToDescriptor(data); diff --git a/iceoryx_hoofs/source/posix_wrapper/timespec.cpp b/iceoryx_hoofs/source/posix_wrapper/timespec.cpp index 8aa7435396..20f77e5036 100644 --- a/iceoryx_hoofs/source/posix_wrapper/timespec.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/timespec.cpp @@ -21,7 +21,7 @@ namespace iox { namespace posix { -struct timespec addTimeMs(struct timespec time, const uint32_t timeToAdd_ms) +struct timespec addTimeMs(struct timespec time, const uint32_t timeToAdd_ms) noexcept { decltype(time.tv_nsec) sec_ns = time.tv_nsec + ((timeToAdd_ms % 1000) * TS_DIVIDER_msec); time.tv_sec += (timeToAdd_ms / 1000); @@ -38,7 +38,7 @@ struct timespec addTimeMs(struct timespec time, const uint32_t timeToAdd_ms) return time; } -double subtractTimespecMS(const struct timespec minuend, const struct timespec subtrahend) +double subtractTimespecMS(const struct timespec minuend, const struct timespec subtrahend) noexcept { // Define TimeType instead of long long to be machine independent, long long is 64-bit on QNX/Linux 32-bit/64-bit using TimeType = std::uint64_t; diff --git a/iceoryx_posh/include/iceoryx_posh/capro/service_description.hpp b/iceoryx_posh/include/iceoryx_posh/capro/service_description.hpp index 0864d8c6e8..82f311ad36 100644 --- a/iceoryx_posh/include/iceoryx_posh/capro/service_description.hpp +++ b/iceoryx_posh/include/iceoryx_posh/capro/service_description.hpp @@ -108,20 +108,20 @@ class ServiceDescription /// @brief compare operator. If wildcards AnyServiceString, AnyInstanceString or AnyEventString are used, the /// corresponding member comparisons are skipped. - bool operator==(const ServiceDescription& rhs) const; + bool operator==(const ServiceDescription& rhs) const noexcept; /// @brief negation of compare operator. - bool operator!=(const ServiceDescription& rhs) const; + bool operator!=(const ServiceDescription& rhs) const noexcept; /// @brief Uses the underlying m_**String compare method to provide an order. /// This is needed to use ServiceDescription in sorted containers like map or set. - bool operator<(const ServiceDescription& rhs) const; + bool operator<(const ServiceDescription& rhs) const noexcept; - ServiceDescription& operator=(const ServiceDescription&) = default; - ServiceDescription& operator=(ServiceDescription&&) = default; + ServiceDescription& operator=(const ServiceDescription&) noexcept = default; + ServiceDescription& operator=(ServiceDescription&&) noexcept = default; /// @brief serialization of the capro description. - operator cxx::Serialization() const; + operator cxx::Serialization() const noexcept; // @brief Returns if this service description is used for an RouDi-internal channel bool isInternal() const noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/gateway/gateway_base.hpp b/iceoryx_posh/include/iceoryx_posh/gateway/gateway_base.hpp index e73a35b650..db98e68834 100644 --- a/iceoryx_posh/include/iceoryx_posh/gateway/gateway_base.hpp +++ b/iceoryx_posh/include/iceoryx_posh/gateway/gateway_base.hpp @@ -48,8 +48,8 @@ class GatewayBase GatewayBase& operator=(const GatewayBase& other) = delete; GatewayBase(const GatewayBase& other) = delete; - GatewayBase(GatewayBase&& other) = default; - GatewayBase& operator=(GatewayBase&&) = default; + GatewayBase(GatewayBase&& other) noexcept = default; + GatewayBase& operator=(GatewayBase&&) noexcept = default; virtual ~GatewayBase() noexcept; /// @brief Get function for type of capro message - service or event or field diff --git a/iceoryx_posh/include/iceoryx_posh/gateway/toml_gateway_config_parser.hpp b/iceoryx_posh/include/iceoryx_posh/gateway/toml_gateway_config_parser.hpp index 3334f70710..df8043cd0b 100644 --- a/iceoryx_posh/include/iceoryx_posh/gateway/toml_gateway_config_parser.hpp +++ b/iceoryx_posh/include/iceoryx_posh/gateway/toml_gateway_config_parser.hpp @@ -61,8 +61,8 @@ static constexpr const char GATEWAY_CONFIG_SERVICE_EVENT_NAME[] = "event"; class TomlGatewayConfigParser { public: - static cxx::expected parse(); - static cxx::expected parse(const roudi::ConfigFilePathString_t& path); + static cxx::expected parse() noexcept; + static cxx::expected parse(const roudi::ConfigFilePathString_t& path) noexcept; protected: static cxx::expected validate(const cpptoml::table& parsedToml) noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp b/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp index 3841ae933b..f9271a6627 100644 --- a/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp +++ b/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp @@ -172,13 +172,13 @@ inline constexpr const char* asStringLiteral(ConnectionState value) noexcept; /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal /// @return the reference to `stream` which was provided as input parameter -inline std::ostream& operator<<(std::ostream& stream, ConnectionState value); +inline std::ostream& operator<<(std::ostream& stream, ConnectionState value) noexcept; /// @brief Convenience stream operator to easily use the `asStringLiteral` function with iox::log::LogStream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal /// @return the reference to `stream` which was provided as input parameter -inline log::LogStream& operator<<(log::LogStream& stream, ConnectionState value); +inline log::LogStream& operator<<(log::LogStream& stream, ConnectionState value) noexcept; // Default properties of ChunkDistributorData struct DefaultChunkDistributorConfig @@ -232,7 +232,7 @@ enum class MonitoringMode OFF }; -iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const MonitoringMode& mode); +iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const MonitoringMode& mode) noexcept; } // namespace roudi namespace mepoo diff --git a/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.inl b/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.inl index ae94dc88ba..ecc99eb9d2 100644 --- a/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.inl +++ b/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.inl @@ -37,13 +37,13 @@ inline constexpr const char* asStringLiteral(ConnectionState value) noexcept return "[Undefined ConnectionState]"; } -std::ostream& operator<<(std::ostream& stream, ConnectionState value) +std::ostream& operator<<(std::ostream& stream, ConnectionState value) noexcept { stream << asStringLiteral(value); return stream; } -log::LogStream& operator<<(log::LogStream& stream, ConnectionState value) +log::LogStream& operator<<(log::LogStream& stream, ConnectionState value) noexcept { stream << asStringLiteral(value); return stream; @@ -51,7 +51,7 @@ log::LogStream& operator<<(log::LogStream& stream, ConnectionState value) namespace roudi { -inline iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const MonitoringMode& mode) +inline iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const MonitoringMode& mode) noexcept { switch (mode) { diff --git a/iceoryx_posh/include/iceoryx_posh/internal/capro/capro_message.hpp b/iceoryx_posh/include/iceoryx_posh/internal/capro/capro_message.hpp index 02bc82fb67..ef2902ac59 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/capro/capro_message.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/capro/capro_message.hpp @@ -58,13 +58,13 @@ inline constexpr const char* asStringLiteral(CaproMessageType value) noexcept; /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal /// @return the reference to `stream` which was provided as input parameter -inline std::ostream& operator<<(std::ostream& stream, CaproMessageType value); +inline std::ostream& operator<<(std::ostream& stream, CaproMessageType value) noexcept; /// @brief Convenience stream operator to easily use the `asStringLiteral` function with iox::log::LogStream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal /// @return the reference to `stream` which was provided as input parameter -inline log::LogStream& operator<<(log::LogStream& stream, CaproMessageType value); +inline log::LogStream& operator<<(log::LogStream& stream, CaproMessageType value) noexcept; enum class CaproMessageSubType : uint8_t { @@ -79,7 +79,7 @@ class CaproMessage { public: /// @brief default constructor - CaproMessage() = default; + CaproMessage() noexcept = default; /// @brief C'tor for CaPro Message with type, service description /// @param type Message type diff --git a/iceoryx_posh/include/iceoryx_posh/internal/capro/capro_message.inl b/iceoryx_posh/include/iceoryx_posh/internal/capro/capro_message.inl index 53a9fa1555..ad74af9523 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/capro/capro_message.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/capro/capro_message.inl @@ -60,13 +60,13 @@ inline constexpr const char* asStringLiteral(CaproMessageType value) noexcept return "[Undefined CaproMessageType]"; } -inline std::ostream& operator<<(std::ostream& stream, CaproMessageType value) +inline std::ostream& operator<<(std::ostream& stream, CaproMessageType value) noexcept { stream << asStringLiteral(value); return stream; } -inline log::LogStream& operator<<(log::LogStream& stream, CaproMessageType value) +inline log::LogStream& operator<<(log::LogStream& stream, CaproMessageType value) noexcept { stream << asStringLiteral(value); return stream; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/shared_chunk.hpp b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/shared_chunk.hpp index 04f0e748fd..337d42e3a4 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/shared_chunk.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/shared_chunk.hpp @@ -34,7 +34,7 @@ class SharedPointer; class SharedChunk { public: - SharedChunk() = default; + SharedChunk() noexcept = default; SharedChunk(ChunkManagement* const resource) noexcept; ~SharedChunk() noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/base_subscriber.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/base_subscriber.inl index 71052bb7f2..557f94f77e 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/base_subscriber.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/base_subscriber.inl @@ -37,7 +37,7 @@ inline BaseSubscriber::BaseSubscriber(const capro::ServiceDescription& s } template -inline BaseSubscriber::~BaseSubscriber() +inline BaseSubscriber::~BaseSubscriber() noexcept { m_port.destroy(); } 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 3792c8c8ab..45a7de3d7b 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 @@ -70,9 +70,9 @@ class ChunkDistributor ChunkDistributor(const ChunkDistributor& other) = delete; ChunkDistributor& operator=(const ChunkDistributor&) = delete; - ChunkDistributor(ChunkDistributor&& rhs) = default; - ChunkDistributor& operator=(ChunkDistributor&& rhs) = default; - virtual ~ChunkDistributor() = default; + ChunkDistributor(ChunkDistributor&& rhs) noexcept = default; + ChunkDistributor& operator=(ChunkDistributor&& rhs) noexcept = default; + virtual ~ChunkDistributor() noexcept = default; /// @brief Add a queue to the internal list of chunk queues to which chunks are delivered when calling /// deliverToAllStoredQueues diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.inl index 2e82cf6724..bbf9669529 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.inl @@ -25,7 +25,7 @@ namespace popo /// Ex.: constexpr uint32_t DefaultChunkDistributorConfig::MAX_HISTORY_CAPACITY; /// This wouldn't be an issue in C++17. template -constexpr T min(const T left, const T right) +constexpr T min(const T left, const T right) noexcept { return (left < right) ? left : right; } 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 cdbbf74212..b66c9d2406 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 @@ -42,9 +42,9 @@ class ChunkQueuePopper ChunkQueuePopper(const ChunkQueuePopper& other) = delete; ChunkQueuePopper& operator=(const ChunkQueuePopper&) = delete; - ChunkQueuePopper(ChunkQueuePopper&& rhs) = default; - ChunkQueuePopper& operator=(ChunkQueuePopper&& rhs) = default; - virtual ~ChunkQueuePopper() = default; + ChunkQueuePopper(ChunkQueuePopper&& rhs) noexcept = default; + ChunkQueuePopper& operator=(ChunkQueuePopper&& rhs) noexcept = default; + virtual ~ChunkQueuePopper() noexcept = default; /// @brief pop a chunk from the chunk queue /// @return optional for a shared chunk that is set if the queue is not empty 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 ebe4e441a4..a4c4fb2511 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 @@ -41,9 +41,9 @@ class ChunkQueuePusher ChunkQueuePusher(const ChunkQueuePusher& other) = delete; ChunkQueuePusher& operator=(const ChunkQueuePusher&) = delete; - ChunkQueuePusher(ChunkQueuePusher&& rhs) = default; - ChunkQueuePusher& operator=(ChunkQueuePusher&& rhs) = default; - ~ChunkQueuePusher() = default; + ChunkQueuePusher(ChunkQueuePusher&& rhs) noexcept = default; + ChunkQueuePusher& operator=(ChunkQueuePusher&& rhs) noexcept = default; + ~ChunkQueuePusher() noexcept = default; /// @brief push a new chunk to the chunk queue /// @param[in] shared chunk object 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 77bc92eaf1..4e2bfc0c51 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 @@ -52,9 +52,9 @@ class ChunkReceiver : public ChunkQueuePopper::call(void* const orig } // namespace internal template -inline NotificationCallback createNotificationCallback(void (&callback)(OriginType* const)) +inline NotificationCallback createNotificationCallback(void (&callback)(OriginType* const)) noexcept { return NotificationCallback{&callback}; } template inline NotificationCallback -createNotificationCallback(void (&callback)(OriginType* const, ContextDataType* const), ContextDataType& userValue) +createNotificationCallback(void (&callback)(OriginType* const, ContextDataType* const), ContextDataType& userValue) noexcept { return NotificationCallback{&callback, &userValue}; } diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/application_port.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/application_port.hpp index e6e2bee799..58cfc9092b 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/application_port.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/application_port.hpp @@ -32,8 +32,8 @@ class ApplicationPort : public BasePort ApplicationPort(const ApplicationPort& other) = delete; ApplicationPort& operator=(const ApplicationPort& other) = delete; - ApplicationPort(ApplicationPort&& other) = default; - ApplicationPort& operator=(ApplicationPort&& other) = default; + ApplicationPort(ApplicationPort&& other) noexcept = default; + ApplicationPort& operator=(ApplicationPort&& other) noexcept = default; ~ApplicationPort() = default; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/application_port_data.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/application_port_data.hpp index 93a3c1fbab..cc939bae4a 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/application_port_data.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/application_port_data.hpp @@ -27,7 +27,7 @@ namespace popo { struct ApplicationPortData : public BasePortData { - ApplicationPortData() = default; + ApplicationPortData() noexcept = default; explicit ApplicationPortData(const RuntimeName_t& runtimeName) noexcept; concurrent::FiFo m_caproMessageFiFo; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/base_port_data.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/base_port_data.hpp index ff59a79a26..b6077bcaa8 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/base_port_data.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/base_port_data.hpp @@ -33,7 +33,7 @@ namespace popo struct BasePortData { /// @brief Constructor for base port data members - BasePortData() = default; + BasePortData() noexcept = default; /// @brief Constructor /// @param[in] serviceDescription creates the service service description @@ -47,7 +47,7 @@ struct BasePortData BasePortData& operator=(const BasePortData&) = delete; BasePortData(BasePortData&&) = delete; BasePortData& operator=(BasePortData&&) = delete; - ~BasePortData() = default; + ~BasePortData() noexcept = default; capro::ServiceDescription m_serviceDescription; RuntimeName_t m_runtimeName; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/client_port_roudi.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/client_port_roudi.hpp index 30e3bdb775..d9c28047ac 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/client_port_roudi.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/client_port_roudi.hpp @@ -44,8 +44,8 @@ class ClientPortRouDi : public BasePort ClientPortRouDi(const ClientPortRouDi& other) = delete; ClientPortRouDi& operator=(const ClientPortRouDi&) = delete; - ClientPortRouDi(ClientPortRouDi&& rhs) = default; - ClientPortRouDi& operator=(ClientPortRouDi&& rhs) = default; + ClientPortRouDi(ClientPortRouDi&& rhs) noexcept = default; + ClientPortRouDi& operator=(ClientPortRouDi&& rhs) noexcept = default; ~ClientPortRouDi() = default; /// @brief Access to the configured responseQueueFullPolicy diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/client_port_user.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/client_port_user.hpp index 4e99cb7445..9bd772015a 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/client_port_user.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/client_port_user.hpp @@ -48,8 +48,8 @@ class ClientPortUser : public BasePort ClientPortUser(const ClientPortUser& other) = delete; ClientPortUser& operator=(const ClientPortUser&) = delete; - ClientPortUser(ClientPortUser&& rhs) = default; - ClientPortUser& operator=(ClientPortUser&& rhs) = default; + ClientPortUser(ClientPortUser&& rhs) noexcept = default; + ClientPortUser& operator=(ClientPortUser&& rhs) noexcept = default; ~ClientPortUser() = default; /// @brief Allocate a chunk, the ownerhip of the SharedChunk remains in the ClientPortUser for being able to diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/interface_port.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/interface_port.hpp index 8403c87c34..4306740ecd 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/interface_port.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/interface_port.hpp @@ -31,8 +31,8 @@ class InterfacePort : public BasePort InterfacePort(const InterfacePort& other) = delete; InterfacePort& operator=(const InterfacePort& other) = delete; - InterfacePort(InterfacePort&& other) = default; - InterfacePort& operator=(InterfacePort&& other) = default; + InterfacePort(InterfacePort&& other) noexcept = default; + InterfacePort& operator=(InterfacePort&& other) noexcept = default; ~InterfacePort() = default; /// @brief get an optional CaPro message for the interface port to process diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/interface_port_data.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/interface_port_data.hpp index 9529473833..ebf393d648 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/interface_port_data.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/interface_port_data.hpp @@ -28,7 +28,7 @@ namespace popo { struct InterfacePortData : public BasePortData { - InterfacePortData() = default; + InterfacePortData() noexcept = default; InterfacePortData(const RuntimeName_t& runtimeName, const capro::Interfaces interface) noexcept; concurrent::FiFo m_caproMessageFiFo; 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 39df962b56..4c37d689ad 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 @@ -41,8 +41,8 @@ class PublisherPortRouDi : public BasePort PublisherPortRouDi(const PublisherPortRouDi& other) = delete; PublisherPortRouDi& operator=(const PublisherPortRouDi&) = delete; - PublisherPortRouDi(PublisherPortRouDi&& rhs) = default; - PublisherPortRouDi& operator=(PublisherPortRouDi&& rhs) = default; + PublisherPortRouDi(PublisherPortRouDi&& rhs) noexcept = default; + PublisherPortRouDi& operator=(PublisherPortRouDi&& rhs) noexcept = default; ~PublisherPortRouDi() = default; /// @brief Returns behaviour in case of a full delivery queue 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 f011218dd1..0fbd0af6f5 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 @@ -44,8 +44,8 @@ class PublisherPortUser : public BasePort PublisherPortUser(const PublisherPortUser& other) = delete; PublisherPortUser& operator=(const PublisherPortUser&) = delete; - PublisherPortUser(PublisherPortUser&& rhs) = default; - PublisherPortUser& operator=(PublisherPortUser&& rhs) = default; + PublisherPortUser(PublisherPortUser&& rhs) noexcept = default; + PublisherPortUser& operator=(PublisherPortUser&& rhs) noexcept = default; ~PublisherPortUser() = default; /// @brief Allocate a chunk, the ownership of the SharedChunk remains in the PublisherPortUser for being able to diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/server_port_roudi.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/server_port_roudi.hpp index 9693c7bc4c..f44ccb4de9 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/server_port_roudi.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/server_port_roudi.hpp @@ -40,8 +40,8 @@ class ServerPortRouDi : public BasePort ServerPortRouDi(const ServerPortRouDi& other) = delete; ServerPortRouDi& operator=(const ServerPortRouDi&) = delete; - ServerPortRouDi(ServerPortRouDi&& rhs) = default; - ServerPortRouDi& operator=(ServerPortRouDi&& rhs) = default; + ServerPortRouDi(ServerPortRouDi&& rhs) noexcept = default; + ServerPortRouDi& operator=(ServerPortRouDi&& rhs) noexcept = default; ~ServerPortRouDi() = default; /// @brief get an optional CaPro message that changes the offer state of the server diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/server_port_user.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/server_port_user.hpp index 2531a49255..1a7f4de5df 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/server_port_user.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/server_port_user.hpp @@ -45,8 +45,8 @@ class ServerPortUser : public BasePort ServerPortUser(const ServerPortUser& other) = delete; ServerPortUser& operator=(const ServerPortUser&) = delete; - ServerPortUser(ServerPortUser&& rhs) = default; - ServerPortUser& operator=(ServerPortUser&& rhs) = default; + ServerPortUser(ServerPortUser&& rhs) noexcept = default; + ServerPortUser& operator=(ServerPortUser&& rhs) noexcept = default; ~ServerPortUser() = default; /// @brief Tries to get the next request from the queue. If there is a new one, the ChunkHeader of the oldest 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 fc2d1f31b5..e7bcef310c 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 @@ -37,8 +37,8 @@ class SubscriberPortMultiProducer : public SubscriberPortRouDi SubscriberPortMultiProducer(const SubscriberPortMultiProducer& other) = delete; SubscriberPortMultiProducer& operator=(const SubscriberPortMultiProducer&) = delete; - SubscriberPortMultiProducer(SubscriberPortMultiProducer&& rhs) = default; - SubscriberPortMultiProducer& operator=(SubscriberPortMultiProducer&& rhs) = default; + SubscriberPortMultiProducer(SubscriberPortMultiProducer&& rhs) noexcept = default; + SubscriberPortMultiProducer& operator=(SubscriberPortMultiProducer&& rhs) noexcept = default; ~SubscriberPortMultiProducer() = default; /// @brief get an optional CaPro message that changes the subscription state of the subscriber 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 0c85e0005e..b0d853ce6a 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 @@ -41,8 +41,8 @@ class SubscriberPortRouDi : public BasePort SubscriberPortRouDi(const SubscriberPortRouDi& other) = delete; SubscriberPortRouDi& operator=(const SubscriberPortRouDi&) = delete; - SubscriberPortRouDi(SubscriberPortRouDi&& rhs) = default; - SubscriberPortRouDi& operator=(SubscriberPortRouDi&& rhs) = default; + SubscriberPortRouDi(SubscriberPortRouDi&& rhs) noexcept = default; + SubscriberPortRouDi& operator=(SubscriberPortRouDi&& rhs) noexcept = default; virtual ~SubscriberPortRouDi() = default; /// @brief Returns behaviour in case of a full delivery queue 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 131e789774..b216aa01da 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 @@ -37,8 +37,8 @@ class SubscriberPortSingleProducer : public SubscriberPortRouDi SubscriberPortSingleProducer(const SubscriberPortSingleProducer& other) = delete; SubscriberPortSingleProducer& operator=(const SubscriberPortSingleProducer&) = delete; - SubscriberPortSingleProducer(SubscriberPortSingleProducer&& rhs) = default; - SubscriberPortSingleProducer& operator=(SubscriberPortSingleProducer&& rhs) = default; + SubscriberPortSingleProducer(SubscriberPortSingleProducer&& rhs) noexcept = default; + SubscriberPortSingleProducer& operator=(SubscriberPortSingleProducer&& rhs) noexcept = default; ~SubscriberPortSingleProducer() = default; /// @brief get an optional CaPro message that changes the subscription state of the subscriber 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 ebbfb31d10..bc3cffbed7 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 @@ -46,8 +46,8 @@ class SubscriberPortUser : public BasePort SubscriberPortUser(const SubscriberPortUser& other) = delete; SubscriberPortUser& operator=(const SubscriberPortUser&) = delete; - SubscriberPortUser(SubscriberPortUser&& rhs) = default; - SubscriberPortUser& operator=(SubscriberPortUser&& rhs) = default; + SubscriberPortUser(SubscriberPortUser&& rhs) noexcept = default; + SubscriberPortUser& operator=(SubscriberPortUser&& rhs) noexcept = default; ~SubscriberPortUser() = default; /// @brief try to subscribe to all matching publishers diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/sample_deleter.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/sample_deleter.hpp index 0d3e5eeafc..d1441557fd 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/sample_deleter.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/sample_deleter.hpp @@ -33,17 +33,17 @@ template struct SampleDeleter { public: - SampleDeleter(Port& port); + SampleDeleter(Port& port) noexcept; /// @brief Handles deletion of the sample. /// @param[in] userPayload The pointer to the user-payload of the sample. template - void operator()(T* const userPayload); + void operator()(T* const userPayload) noexcept; /// @brief Handles deletion of the sample. /// @param[in] userPayload The pointer to the user-payload of the sample. template - void operator()(const T* const userPayload) const; + void operator()(const T* const userPayload) const noexcept; private: Port* m_port; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/sample_deleter.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/sample_deleter.inl index 694477bb92..c8e4cb0cc0 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/sample_deleter.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/sample_deleter.inl @@ -24,14 +24,14 @@ namespace iox namespace popo { template -SampleDeleter::SampleDeleter(Port& port) +SampleDeleter::SampleDeleter(Port& port) noexcept : m_port(&port) { } template template -void SampleDeleter::operator()(T* const userPayload) +void SampleDeleter::operator()(T* const userPayload) noexcept { auto chunkHeader = iox::mepoo::ChunkHeader::fromUserPayload(userPayload); m_port->releaseChunk(chunkHeader); @@ -39,7 +39,7 @@ void SampleDeleter::operator()(T* const userPayload) template template -void SampleDeleter::operator()(const T* const userPayload) const +void SampleDeleter::operator()(const T* const userPayload) const noexcept { const auto chunkHeader = iox::mepoo::ChunkHeader::fromUserPayload(userPayload); m_port->releaseChunk(chunkHeader); diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/subscriber.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/subscriber.inl index 7208bafbae..27a55231d5 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/subscriber.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/subscriber.inl @@ -24,7 +24,7 @@ namespace popo { template inline SubscriberImpl::SubscriberImpl(const capro::ServiceDescription& service, - const SubscriberOptions& subscriberOptions) + const SubscriberOptions& subscriberOptions) noexcept : BaseSubscriber_t(service, subscriberOptions) { } diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/fixed_size_container.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/fixed_size_container.hpp index 4867346ae4..d58364c718 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/fixed_size_container.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/fixed_size_container.hpp @@ -42,7 +42,7 @@ class FixedSizeContainer using Capacity_t = decltype(capacity); static constexpr int32_t NOT_AN_ELEMENT = -1; - FixedSizeContainer() + FixedSizeContainer() noexcept : m_values(capacity) { } @@ -50,7 +50,7 @@ class FixedSizeContainer /// @note returns index or -1 if element could not be added /// a successful add returns an arbitrary index which can be non consecutive /// for consecutive adds - Index_t add(const T& element) + Index_t add(const T& element) noexcept { auto nextElement = nextFree(); @@ -65,7 +65,7 @@ class FixedSizeContainer return nextElement; } - void remove(Index_t index) + void remove(Index_t index) noexcept { if (m_values[static_cast(index)].isValid) { @@ -76,24 +76,24 @@ class FixedSizeContainer /// @note access can change the underlying object, without modifying valid flag /// if the index is invalid than the behavior is undefined - T& operator[](Index_t index) + T& operator[](Index_t index) noexcept { return m_values[static_cast(index)].value; } - T* get(Index_t index) + T* get(Index_t index) noexcept { return (m_values[static_cast(index)].isValid) ? &m_values[static_cast(index)].value : nullptr; } - size_t size() + size_t size() noexcept { return m_size; } private: - Index_t nextFree() + Index_t nextFree() noexcept { if (m_size >= capacity) return NOT_AN_ELEMENT; // container is full @@ -105,12 +105,12 @@ class FixedSizeContainer return m_freeIndex; } - void setValid(Index_t index, bool value = true) + void setValid(Index_t index, bool value = true) noexcept { m_values[static_cast(index)].isValid = value; } - void setInvalid(Index_t index) + void setInvalid(Index_t index) noexcept { setValid(index, false); } diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/mempool_introspection.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/mempool_introspection.hpp index 50156ad368..490b9ed1cd 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/mempool_introspection.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/mempool_introspection.hpp @@ -46,9 +46,9 @@ class MemPoolIntrospection /// @param[in] publisherPort is the publisher port for transmission of the introspection data MemPoolIntrospection(MemoryManager& rouDiInternalMemoryManager, SegmentManager& segmentManager, - PublisherPort&& publisherPort); + PublisherPort&& publisherPort) noexcept; - ~MemPoolIntrospection(); + ~MemPoolIntrospection() noexcept; // delete copy constructor and assignment operator MemPoolIntrospection(MemPoolIntrospection const&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/mempool_introspection.inl b/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/mempool_introspection.inl index f75fc9e888..245c21c951 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/mempool_introspection.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/mempool_introspection.inl @@ -26,7 +26,7 @@ namespace roudi { template inline MemPoolIntrospection::MemPoolIntrospection( - MemoryManager& rouDiInternalMemoryManager, SegmentManager& segmentManager, PublisherPort&& publisherPort) + MemoryManager& rouDiInternalMemoryManager, SegmentManager& segmentManager, PublisherPort&& publisherPort) noexcept : m_rouDiInternalMemoryManager(&rouDiInternalMemoryManager) , m_segmentManager(&segmentManager) , m_publisherPort(std::move(publisherPort)) @@ -35,7 +35,7 @@ inline MemPoolIntrospection::MemPo } template -inline MemPoolIntrospection::~MemPoolIntrospection() +inline MemPoolIntrospection::~MemPoolIntrospection() noexcept { stop(); m_publisherPort.stopOffer(); diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.hpp index 2cc72e2e37..403d170427 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.hpp @@ -69,7 +69,7 @@ class PortIntrospection { } - PublisherInfo(typename PublisherPort::MemberType_t& portData) + PublisherInfo(typename PublisherPort::MemberType_t& portData) noexcept : portData(&portData) , process(portData.m_runtimeName) , service(portData.m_serviceDescription) @@ -96,7 +96,7 @@ class PortIntrospection { SubscriberInfo() noexcept = default; - SubscriberInfo(typename SubscriberPort::MemberType_t& portData) + SubscriberInfo(typename SubscriberPort::MemberType_t& portData) noexcept : portData(&portData) , process(portData.m_runtimeName) , service(portData.m_serviceDescription) @@ -114,7 +114,7 @@ class PortIntrospection { ConnectionInfo() noexcept = default; - ConnectionInfo(typename SubscriberPort::MemberType_t& portData) + ConnectionInfo(typename SubscriberPort::MemberType_t& portData) noexcept : subscriberInfo(portData) , state(ConnectionState::DEFAULT) { @@ -142,24 +142,24 @@ class PortIntrospection /// @brief add a publisher port to be tracked by introspection /// @param[in] port to be added /// @return returns false if the port could not be added and true otherwise - bool addPublisher(typename PublisherPort::MemberType_t& port); + bool addPublisher(typename PublisherPort::MemberType_t& port) noexcept; /// @brief add a subscriber port to be tracked by introspection /// @param[in] portData to be added /// @return returns false if the port could not be added and true otherwise - bool addSubscriber(typename SubscriberPort::MemberType_t& portData); + bool addSubscriber(typename SubscriberPort::MemberType_t& portData) noexcept; /// @brief remove a publisher port from introspection /// @param[in] port publisher port to be removed /// @return returns false if the port could not be removed (since it did not exist) /// and true otherwise - bool removePublisher(const PublisherPort& port); + bool removePublisher(const PublisherPort& port) noexcept; /// @brief remove a subscriber port from introspection /// @param[in] port subscriber port to be removed /// @return returns false if the port could not be removed (since it did not exist) /// and true otherwise - bool removeSubscriber(const SubscriberPort& port); + bool removeSubscriber(const SubscriberPort& port) noexcept; /// @brief update the state of any connection identified by the capro id of a given message /// according to the message type (e.g. capro::SUB for a subscription request) @@ -175,7 +175,7 @@ class PortIntrospection /// @note introduced for identifying the subscriber port whose connection state has to be updated, e.g. if a /// subscriber unsubscribes only its connection state should be updated - not the states of all subscribers /// which are subscribed to the same topic - bool updateSubscriberConnectionState(const capro::CaproMessage& message, const UniquePortId& id); + bool updateSubscriberConnectionState(const capro::CaproMessage& message, const UniquePortId& id) noexcept; /// @brief prepare the topic to be send based on the internal connection state of all tracked ports /// @param[out] topic data structure to be prepared for sending @@ -250,24 +250,24 @@ class PortIntrospection /// @brief add a publisher port to be tracked by introspection /// @param[in] port to be added /// @return returns false if the port could not be added and true otherwise - bool addPublisher(typename PublisherPort::MemberType_t& port); + bool addPublisher(typename PublisherPort::MemberType_t& port) noexcept; /// @brief add a subscriber port to be tracked by introspection /// @param[in] port to be added /// @return returns false if the port could not be added and true otherwise - bool addSubscriber(typename SubscriberPort::MemberType_t& port); + bool addSubscriber(typename SubscriberPort::MemberType_t& port) noexcept; /// @brief remove a publisher port from introspection /// @param[in] port publisher port to be removed /// @return returns false if the port could not be removed (since it did not exist) /// and true otherwise - bool removePublisher(const PublisherPort& port); + bool removePublisher(const PublisherPort& port) noexcept; /// @brief remove a subscriber port from introspection /// @param[in] port subscriber port to be removed /// @return returns false if the port could not be removed (since it did not exist) /// and true otherwise - bool removeSubscriber(const SubscriberPort& port); + bool removeSubscriber(const SubscriberPort& port) noexcept; /// @brief report a capro message to introspection (since this could change the state of active connections) /// @param[in] message capro message to be processed @@ -279,7 +279,7 @@ class PortIntrospection /// @note introduced for identifying the subscriber port whose connection state has to be updated, e.g. if a /// subscriber unsubscribes only its connection state should be updated - not the states of all subscribers /// which are subscribed to the same topic - void reportMessage(const capro::CaproMessage& message, const UniquePortId& id); + void reportMessage(const capro::CaproMessage& message, const UniquePortId& id) noexcept; /// @brief register publisher port used to send introspection /// @param[in] publisherPort publisher port to be registered diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.inl b/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.inl index ba253e94c1..6db935b711 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.inl @@ -48,7 +48,7 @@ inline void PortIntrospection::reportMessage(cons template inline void PortIntrospection::reportMessage(const capro::CaproMessage& message, - const UniquePortId& id) + const UniquePortId& id) noexcept { m_portData.updateSubscriberConnectionState(message, id); } @@ -203,7 +203,7 @@ inline bool PortIntrospection::PortData::updateCo template inline bool PortIntrospection::PortData::updateSubscriberConnectionState( - const capro::CaproMessage& message, const UniquePortId& id) + const capro::CaproMessage& message, const UniquePortId& id) noexcept { const capro::ServiceDescription& service = message.m_serviceDescription; capro::CaproMessageType messageType = message.m_type; @@ -233,7 +233,7 @@ inline bool PortIntrospection::PortData::updateSu template inline bool -PortIntrospection::PortData::addPublisher(typename PublisherPort::MemberType_t& port) +PortIntrospection::PortData::addPublisher(typename PublisherPort::MemberType_t& port) noexcept { std::lock_guard lock(m_mutex); @@ -293,7 +293,7 @@ PortIntrospection::PortData::addPublisher(typenam template inline bool PortIntrospection::PortData::addSubscriber( - typename SubscriberPort::MemberType_t& portData) + typename SubscriberPort::MemberType_t& portData) noexcept { std::lock_guard lock(m_mutex); @@ -347,7 +347,7 @@ inline bool PortIntrospection::PortData::addSubsc } template -inline bool PortIntrospection::PortData::removePublisher(const PublisherPort& port) +inline bool PortIntrospection::PortData::removePublisher(const PublisherPort& port) noexcept { std::lock_guard lock(m_mutex); @@ -382,7 +382,7 @@ inline bool PortIntrospection::PortData::removePu } template -inline bool PortIntrospection::PortData::removeSubscriber(const SubscriberPort& port) +inline bool PortIntrospection::PortData::removeSubscriber(const SubscriberPort& port) noexcept { std::lock_guard lock(m_mutex); @@ -633,25 +633,25 @@ inline void PortIntrospection::PortData::setNew(b } template -inline bool PortIntrospection::addPublisher(typename PublisherPort::MemberType_t& port) +inline bool PortIntrospection::addPublisher(typename PublisherPort::MemberType_t& port) noexcept { return m_portData.addPublisher(port); } template -inline bool PortIntrospection::addSubscriber(typename SubscriberPort::MemberType_t& port) +inline bool PortIntrospection::addSubscriber(typename SubscriberPort::MemberType_t& port) noexcept { return m_portData.addSubscriber(port); } template -inline bool PortIntrospection::removePublisher(const PublisherPort& port) +inline bool PortIntrospection::removePublisher(const PublisherPort& port) noexcept { return m_portData.removePublisher(port); } template -inline bool PortIntrospection::removeSubscriber(const SubscriberPort& port) +inline bool PortIntrospection::removeSubscriber(const SubscriberPort& port) noexcept { return m_portData.removeSubscriber(port); } diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_manager.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_manager.hpp index 859590c44a..8dbb0e9bbc 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_manager.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_manager.hpp @@ -57,7 +57,7 @@ class PortManager using PortConfigInfo = iox::runtime::PortConfigInfo; PortManager(RouDiMemoryInterface* roudiMemoryInterface) noexcept; - virtual ~PortManager() = default; + virtual ~PortManager() noexcept = default; /// @todo Remove this later void stopPortIntrospection() noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_pool_data.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_pool_data.hpp index 2f55528163..1102971d5e 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_pool_data.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_pool_data.hpp @@ -38,14 +38,14 @@ class FixedPositionContainer public: static constexpr uint64_t FIRST_ELEMENT = std::numeric_limits::max(); - bool hasFreeSpace(); + bool hasFreeSpace() noexcept; template - T* insert(Targs&&... args); + T* insert(Targs&&... args) noexcept; - void erase(T* const element); + void erase(T* const element) noexcept; - cxx::vector content(); + cxx::vector content() noexcept; private: cxx::vector, Capacity> m_data; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_pool_data.inl b/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_pool_data.inl index b3692b4c25..a2999474bf 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_pool_data.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_pool_data.inl @@ -21,7 +21,7 @@ namespace iox namespace roudi { template -bool FixedPositionContainer::hasFreeSpace() +bool FixedPositionContainer::hasFreeSpace() noexcept { if (m_data.capacity() > m_data.size()) { @@ -41,7 +41,7 @@ bool FixedPositionContainer::hasFreeSpace() template template -T* FixedPositionContainer::insert(Targs&&... args) +T* FixedPositionContainer::insert(Targs&&... args) noexcept { for (auto& e : m_data) { @@ -58,7 +58,7 @@ T* FixedPositionContainer::insert(Targs&&... args) } template -void FixedPositionContainer::erase(T* const element) +void FixedPositionContainer::erase(T* const element) noexcept { for (auto& e : m_data) { @@ -71,7 +71,7 @@ void FixedPositionContainer::erase(T* const element) } template -cxx::vector FixedPositionContainer::content() +cxx::vector FixedPositionContainer::content() noexcept { cxx::vector returnValue; for (auto& e : m_data) diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/process.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/process.hpp index ec1a6fdba0..021d625c48 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/process.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/process.hpp @@ -57,7 +57,7 @@ class Process /// @note the move cTor and assignment operator are already implicitly deleted because of the atomic Process(Process&& other) = delete; Process& operator=(Process&& other) = delete; - ~Process() = default; + ~Process() noexcept = default; uint32_t getPid() const noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/roudi.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/roudi.hpp index 349b8362c5..76a1086de9 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/roudi.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/roudi.hpp @@ -81,30 +81,30 @@ class RouDi RouDi(RouDiMemoryInterface& roudiMemoryInteface, PortManager& portManager, - RoudiStartupParameters roudiStartupParameters); + RoudiStartupParameters roudiStartupParameters) noexcept; - virtual ~RouDi(); + virtual ~RouDi() noexcept; protected: /// @brief Starts the thread processing messages from the runtimes /// Once this is done, applications can register and Roudi is fully operational. - void startProcessRuntimeMessagesThread(); + void startProcessRuntimeMessagesThread() noexcept; /// @brief Stops threads and kills all process known to RouDi /// Called in d'tor /// /// @note Intentionally not virtual to be able to call it in derived class - void shutdown(); + void shutdown() noexcept; virtual void processMessage(const runtime::IpcMessage& message, const iox::runtime::IpcMessageType& cmd, - const RuntimeName_t& runtimeName); - virtual void cyclicUpdateHook(); - void IpcMessageErrorHandler(); + const RuntimeName_t& runtimeName) noexcept; + virtual void cyclicUpdateHook() noexcept; + void IpcMessageErrorHandler() noexcept; version::VersionInfo parseRegisterMessage(const runtime::IpcMessage& message, uint32_t& pid, uid_t& userId, - int64_t& transmissionTimestamp); + int64_t& transmissionTimestamp) noexcept; /// @brief Handles the registration request from process /// @param [in] name of the process which wants to register at roudi; this is equal to the IPC channel name @@ -118,16 +118,16 @@ class RouDi const posix::PosixUser user, const int64_t transmissionTimestamp, const uint64_t sessionId, - const version::VersionInfo& versionInfo); + const version::VersionInfo& versionInfo) noexcept; /// @brief Creates a unique ID which can be used to check outdated IPC channel transmissions /// @return a unique, monotonic and consecutive increasing number - static uint64_t getUniqueSessionIdForProcess(); + static uint64_t getUniqueSessionIdForProcess() noexcept; private: - void processRuntimeMessages(); + void processRuntimeMessages() noexcept; - void monitorAndDiscoveryUpdate(); + void monitorAndDiscoveryUpdate() noexcept; cxx::GenericRAII m_unregisterRelativePtr{[] {}, [] { rp::BaseRelativePointer::unregisterAll(); }}; bool m_killProcessesInDestructor; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/service_registry.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/service_registry.hpp index f457629d3d..03c1be53e9 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/service_registry.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/service_registry.hpp @@ -40,12 +40,12 @@ class ServiceRegistry }; using serviceMap_t = std::map; - void add(const capro::IdString_t& service, const capro::IdString_t& instance); - void remove(const capro::IdString_t& service, const capro::IdString_t& instance); + void add(const capro::IdString_t& service, const capro::IdString_t& instance) noexcept; + void remove(const capro::IdString_t& service, const capro::IdString_t& instance) noexcept; void find(InstanceSet_t& instances, const capro::IdString_t& service, - const capro::IdString_t& instance = Wildcard) const; - const serviceMap_t& getServiceMap() const; + const capro::IdString_t& instance = Wildcard) const noexcept; + const serviceMap_t& getServiceMap() const noexcept; private: mutable serviceMap_t m_serviceMap; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/runtime/ipc_interface_creator.hpp b/iceoryx_posh/include/iceoryx_posh/internal/runtime/ipc_interface_creator.hpp index c200cccfc4..4cfb3fdb42 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/runtime/ipc_interface_creator.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/runtime/ipc_interface_creator.hpp @@ -52,7 +52,7 @@ class IpcInterfaceCreator : public IpcInterfaceBase private: friend class IpcRuntimeInterface; - void cleanupResource(); + void cleanupResource() noexcept; posix::FileLock m_fileLock; }; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/runtime/shared_memory_user.hpp b/iceoryx_posh/include/iceoryx_posh/internal/runtime/shared_memory_user.hpp index 8c92f51a26..ed02d5a36f 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/runtime/shared_memory_user.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/runtime/shared_memory_user.hpp @@ -39,7 +39,7 @@ class SharedMemoryUser /// address space SharedMemoryUser(const size_t topicSize, const uint64_t segmentId, - const rp::BaseRelativePointer::offset_t segmentManagerAddressOffset); + const rp::BaseRelativePointer::offset_t segmentManagerAddressOffset) noexcept; private: void openDataSegments(const uint64_t segmentId, diff --git a/iceoryx_posh/include/iceoryx_posh/mepoo/memory_info.hpp b/iceoryx_posh/include/iceoryx_posh/mepoo/memory_info.hpp index 1004de3ee7..cd69748838 100644 --- a/iceoryx_posh/include/iceoryx_posh/mepoo/memory_info.hpp +++ b/iceoryx_posh/include/iceoryx_posh/mepoo/memory_info.hpp @@ -37,15 +37,15 @@ struct MemoryInfo uint32_t deviceId{DEFAULT_DEVICE_ID}; uint32_t memoryType{DEFAULT_MEMORY_TYPE}; - MemoryInfo(const MemoryInfo&) = default; - MemoryInfo(MemoryInfo&&) = default; - MemoryInfo& operator=(const MemoryInfo&) = default; - MemoryInfo& operator=(MemoryInfo&&) = default; + MemoryInfo(const MemoryInfo&) noexcept = default; + MemoryInfo(MemoryInfo&&) noexcept = default; + MemoryInfo& operator=(const MemoryInfo&) noexcept = default; + MemoryInfo& operator=(MemoryInfo&&) noexcept = default; /// @brief creates a MemoryInfo object /// @param[in] deviceId specifies the device where the memory is located /// @param[in] memoryType encodes additional information about the memory - MemoryInfo(uint32_t deviceId = DEFAULT_DEVICE_ID, uint32_t memoryType = DEFAULT_MEMORY_TYPE); + MemoryInfo(uint32_t deviceId = DEFAULT_DEVICE_ID, uint32_t memoryType = DEFAULT_MEMORY_TYPE) noexcept; }; } // namespace mepoo } // namespace iox diff --git a/iceoryx_posh/include/iceoryx_posh/mepoo/mepoo_config.hpp b/iceoryx_posh/include/iceoryx_posh/mepoo/mepoo_config.hpp index f45edbc5e5..26b9c42155 100644 --- a/iceoryx_posh/include/iceoryx_posh/mepoo/mepoo_config.hpp +++ b/iceoryx_posh/include/iceoryx_posh/mepoo/mepoo_config.hpp @@ -48,7 +48,7 @@ struct MePooConfig MePooConfigContainerType m_mempoolConfig; /// @brief Default constructor to set the configuration for memory pools - MePooConfig() = default; + MePooConfig() noexcept = default; /// @brief Get function for receiving memory pool configuration /// @return cxx::vector of config information size and count of chunks diff --git a/iceoryx_posh/include/iceoryx_posh/mepoo/segment_config.hpp b/iceoryx_posh/include/iceoryx_posh/mepoo/segment_config.hpp index e3ad4a8d61..d5c7ded02f 100644 --- a/iceoryx_posh/include/iceoryx_posh/mepoo/segment_config.hpp +++ b/iceoryx_posh/include/iceoryx_posh/mepoo/segment_config.hpp @@ -34,7 +34,7 @@ struct SegmentConfig SegmentEntry(const posix::PosixGroup::string_t& readerGroup, const posix::PosixGroup::string_t& writerGroup, const MePooConfig& memPoolConfig, - iox::mepoo::MemoryInfo memoryInfo = iox::mepoo::MemoryInfo()) + iox::mepoo::MemoryInfo memoryInfo = iox::mepoo::MemoryInfo()) noexcept : m_readerGroup(readerGroup) , m_writerGroup(writerGroup) , m_mempoolConfig(memPoolConfig) diff --git a/iceoryx_posh/include/iceoryx_posh/popo/base_subscriber.hpp b/iceoryx_posh/include/iceoryx_posh/popo/base_subscriber.hpp index 7963c64f04..cee512c9ae 100644 --- a/iceoryx_posh/include/iceoryx_posh/popo/base_subscriber.hpp +++ b/iceoryx_posh/include/iceoryx_posh/popo/base_subscriber.hpp @@ -50,7 +50,7 @@ template class BaseSubscriber { public: - virtual ~BaseSubscriber(); + virtual ~BaseSubscriber() noexcept; /// /// @brief uid Get the unique ID of the subscriber. diff --git a/iceoryx_posh/include/iceoryx_posh/popo/listener.hpp b/iceoryx_posh/include/iceoryx_posh/popo/listener.hpp index a5e960f0d3..8f8e64fa4e 100644 --- a/iceoryx_posh/include/iceoryx_posh/popo/listener.hpp +++ b/iceoryx_posh/include/iceoryx_posh/popo/listener.hpp @@ -69,7 +69,7 @@ class Listener Listener() noexcept; Listener(const Listener&) = delete; Listener(Listener&&) = delete; - ~Listener(); + ~Listener() noexcept; Listener& operator=(const Listener&) = delete; Listener& operator=(Listener&&) = delete; @@ -158,7 +158,7 @@ class Listener class Event_t { public: - ~Event_t(); + ~Event_t() noexcept; bool isEqualTo(const void* const origin, const uint64_t eventType, const uint64_t eventTypeHash) const noexcept; bool reset() noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/popo/notification_callback.hpp b/iceoryx_posh/include/iceoryx_posh/popo/notification_callback.hpp index f0033be3a7..96b27af2a5 100644 --- a/iceoryx_posh/include/iceoryx_posh/popo/notification_callback.hpp +++ b/iceoryx_posh/include/iceoryx_posh/popo/notification_callback.hpp @@ -78,7 +78,7 @@ struct NotificationCallback /// @param[in] callback reference to a callback with the signature void(OriginType*) /// @return the callback stored inside of an NotificationCallback template -NotificationCallback createNotificationCallback(void (&callback)(OriginType* const)); +NotificationCallback createNotificationCallback(void (&callback)(OriginType* const)) noexcept; /// @brief creates an NotificationCallback with a user defined value /// @param[in] callback reference to a callback with the signature void(OriginType*, ContextDataType*) @@ -86,7 +86,7 @@ NotificationCallback createNotificationCallback(voi /// @return the callback and user value stored inside of an NotificationCallback template NotificationCallback -createNotificationCallback(void (&callback)(OriginType* const, ContextDataType* const), ContextDataType& userValue); +createNotificationCallback(void (&callback)(OriginType* const, ContextDataType* const), ContextDataType& userValue) noexcept; } // namespace popo } // namespace iox diff --git a/iceoryx_posh/include/iceoryx_posh/popo/notification_info.hpp b/iceoryx_posh/include/iceoryx_posh/popo/notification_info.hpp index dbc7f35a94..653a1a241b 100644 --- a/iceoryx_posh/include/iceoryx_posh/popo/notification_info.hpp +++ b/iceoryx_posh/include/iceoryx_posh/popo/notification_info.hpp @@ -37,8 +37,8 @@ class NotificationInfo static constexpr uint64_t INVALID_ID = std::numeric_limits::max(); /// @brief constructs an empty NotificationInfo - NotificationInfo() = default; - virtual ~NotificationInfo() = default; + NotificationInfo() noexcept = default; + virtual ~NotificationInfo() noexcept = default; /// @brief constructs a NotificationInfo object /// @param[in] notificationOrigin the origin of the event diff --git a/iceoryx_posh/include/iceoryx_posh/popo/rpc_header.hpp b/iceoryx_posh/include/iceoryx_posh/popo/rpc_header.hpp index 7bd65994e8..358a3b6aa9 100644 --- a/iceoryx_posh/include/iceoryx_posh/popo/rpc_header.hpp +++ b/iceoryx_posh/include/iceoryx_posh/popo/rpc_header.hpp @@ -44,9 +44,9 @@ class RpcBaseHeader RpcBaseHeader(const RpcBaseHeader& other) = delete; RpcBaseHeader& operator=(const RpcBaseHeader&) = delete; - RpcBaseHeader(RpcBaseHeader&& rhs) = default; - RpcBaseHeader& operator=(RpcBaseHeader&& rhs) = default; - ~RpcBaseHeader() = default; + RpcBaseHeader(RpcBaseHeader&& rhs) noexcept = default; + RpcBaseHeader& operator=(RpcBaseHeader&& rhs) noexcept = default; + ~RpcBaseHeader() noexcept = default; /// @brief From the 2.0 release onward, this must be incremented for each incompatible change, e.g. /// - data width of members changes @@ -104,9 +104,9 @@ class RequestHeader : public RpcBaseHeader RequestHeader(const RequestHeader& other) = delete; RequestHeader& operator=(const RequestHeader&) = delete; - RequestHeader(RequestHeader&& rhs) = default; - RequestHeader& operator=(RequestHeader&& rhs) = default; - ~RequestHeader() = default; + RequestHeader(RequestHeader&& rhs) noexcept = default; + RequestHeader& operator=(RequestHeader&& rhs) noexcept = default; + ~RequestHeader() noexcept = default; /// @brief Sets the sequence ID which is used to match a response to a request /// @param[in] sequenceId is a consecutive number set by the user @@ -141,9 +141,9 @@ class ResponseHeader : public RpcBaseHeader ResponseHeader(const ResponseHeader& other) = delete; ResponseHeader& operator=(const ResponseHeader&) = delete; - ResponseHeader(ResponseHeader&& rhs) = default; - ResponseHeader& operator=(ResponseHeader&& rhs) = default; - ~ResponseHeader() = default; + ResponseHeader(ResponseHeader&& rhs) noexcept = default; + ResponseHeader& operator=(ResponseHeader&& rhs) noexcept = default; + ~ResponseHeader() noexcept = default; /// @brief Sets the server error flag void setServerError() noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/popo/subscriber.hpp b/iceoryx_posh/include/iceoryx_posh/popo/subscriber.hpp index 5cd4fa6d26..f4ce2613ad 100644 --- a/iceoryx_posh/include/iceoryx_posh/popo/subscriber.hpp +++ b/iceoryx_posh/include/iceoryx_posh/popo/subscriber.hpp @@ -33,7 +33,7 @@ class SubscriberImpl : public BaseSubscriber_t public: SubscriberImpl(const capro::ServiceDescription& service, - const SubscriberOptions& subscriberOptions = SubscriberOptions()); + const SubscriberOptions& subscriberOptions = SubscriberOptions()) noexcept; SubscriberImpl(const SubscriberImpl& other) = delete; SubscriberImpl& operator=(const SubscriberImpl&) = delete; SubscriberImpl(SubscriberImpl&& rhs) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/popo/trigger.hpp b/iceoryx_posh/include/iceoryx_posh/popo/trigger.hpp index 61eee55e38..654716ca16 100644 --- a/iceoryx_posh/include/iceoryx_posh/popo/trigger.hpp +++ b/iceoryx_posh/include/iceoryx_posh/popo/trigger.hpp @@ -110,7 +110,7 @@ class Trigger Trigger& operator=(Trigger&& rhs) noexcept; /// @brief calls reset on destruction - ~Trigger(); + ~Trigger() noexcept; /// @brief returns true if the Trigger is valid otherwise false /// A trigger is valid when: diff --git a/iceoryx_posh/include/iceoryx_posh/popo/trigger_handle.hpp b/iceoryx_posh/include/iceoryx_posh/popo/trigger_handle.hpp index 5f01e5a66b..36e19c97e9 100644 --- a/iceoryx_posh/include/iceoryx_posh/popo/trigger_handle.hpp +++ b/iceoryx_posh/include/iceoryx_posh/popo/trigger_handle.hpp @@ -37,7 +37,7 @@ namespace popo class TriggerHandle { public: - TriggerHandle() = default; + TriggerHandle() noexcept = default; /// @brief Creates a TriggerHandle /// @param[in] conditionVariableDataRef reference to a condition variable data struct @@ -52,7 +52,7 @@ class TriggerHandle TriggerHandle(TriggerHandle&& rhs) noexcept; TriggerHandle& operator=(TriggerHandle&& rhs) noexcept; - ~TriggerHandle(); + ~TriggerHandle() noexcept; /// @brief returns true if the TriggerHandle is valid otherwise false. A TriggerHandle is valid if /// m_conditionVariableDataPtr != nullptr. diff --git a/iceoryx_posh/include/iceoryx_posh/roudi/memory/default_roudi_memory.hpp b/iceoryx_posh/include/iceoryx_posh/roudi/memory/default_roudi_memory.hpp index c620c63e03..7e0b875216 100644 --- a/iceoryx_posh/include/iceoryx_posh/roudi/memory/default_roudi_memory.hpp +++ b/iceoryx_posh/include/iceoryx_posh/roudi/memory/default_roudi_memory.hpp @@ -36,7 +36,7 @@ struct DefaultRouDiMemory DefaultRouDiMemory(const DefaultRouDiMemory&) = delete; DefaultRouDiMemory& operator=(const DefaultRouDiMemory&) = delete; - mepoo::MePooConfig introspectionMemPoolConfig() const; + mepoo::MePooConfig introspectionMemPoolConfig() const noexcept; MemPoolCollectionMemoryBlock m_introspectionMemPoolBlock; MemPoolSegmentManagerMemoryBlock m_segmentManagerBlock; 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 8b5c26ad24..e67e9784a3 100644 --- a/iceoryx_posh/include/iceoryx_posh/roudi/memory/memory_provider.hpp +++ b/iceoryx_posh/include/iceoryx_posh/roudi/memory/memory_provider.hpp @@ -140,7 +140,7 @@ class MemoryProvider /// @return a MemoryProviderError if the destruction failed, otherwise success virtual cxx::expected destroyMemory() noexcept = 0; - static const char* getErrorString(const MemoryProviderError error); + static const char* getErrorString(const MemoryProviderError error) noexcept; private: void* m_memory{nullptr}; diff --git a/iceoryx_posh/include/iceoryx_posh/roudi/memory/roudi_memory_manager.hpp b/iceoryx_posh/include/iceoryx_posh/roudi/memory/roudi_memory_manager.hpp index 2606574be1..bea5344e67 100644 --- a/iceoryx_posh/include/iceoryx_posh/roudi/memory/roudi_memory_manager.hpp +++ b/iceoryx_posh/include/iceoryx_posh/roudi/memory/roudi_memory_manager.hpp @@ -48,7 +48,7 @@ enum class RouDiMemoryManagerError MEMORY_DESTRUCTION_FAILED, }; -iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const RouDiMemoryManagerError& error); +iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const RouDiMemoryManagerError& error) noexcept; class RouDiMemoryManager { @@ -79,7 +79,7 @@ class RouDiMemoryManager cxx::expected destroyMemory() noexcept; private: - mepoo::MePooConfig introspectionMemPoolConfig() const; + mepoo::MePooConfig introspectionMemPoolConfig() const noexcept; cxx::vector m_memoryProvider; }; } // namespace roudi diff --git a/iceoryx_posh/include/iceoryx_posh/roudi/roudi_config.hpp b/iceoryx_posh/include/iceoryx_posh/roudi/roudi_config.hpp index 8b5506c0a9..df3e5296af 100644 --- a/iceoryx_posh/include/iceoryx_posh/roudi/roudi_config.hpp +++ b/iceoryx_posh/include/iceoryx_posh/roudi/roudi_config.hpp @@ -26,8 +26,8 @@ namespace config { struct RouDiConfig { - RouDiConfig& setDefaults(); - RouDiConfig& optimize(); + RouDiConfig& setDefaults() noexcept; + RouDiConfig& optimize() noexcept; }; } // namespace config } // namespace iox diff --git a/iceoryx_posh/include/iceoryx_posh/roudi/roudi_config_file_provider.hpp b/iceoryx_posh/include/iceoryx_posh/roudi/roudi_config_file_provider.hpp index aed6960aca..a30f4ac0ae 100644 --- a/iceoryx_posh/include/iceoryx_posh/roudi/roudi_config_file_provider.hpp +++ b/iceoryx_posh/include/iceoryx_posh/roudi/roudi_config_file_provider.hpp @@ -67,7 +67,7 @@ class RouDiConfigFileProvider /// @brief interface to parse a config file which needs to be implemented for a custom parser /// @param[in] configFilePath to the custom RouDi config file /// @return a cxx::expected with either the parsed RouDiConfig_t if the parsing was successful or a parsing error - virtual cxx::expected parse() = 0; + virtual cxx::expected parse() noexcept = 0; protected: ConfigFilePathString_t m_customConfigFilePath; diff --git a/iceoryx_posh/include/iceoryx_posh/roudi/roudi_config_toml_file_provider.hpp b/iceoryx_posh/include/iceoryx_posh/roudi/roudi_config_toml_file_provider.hpp index 5d519ac12a..55f8b5dbf5 100644 --- a/iceoryx_posh/include/iceoryx_posh/roudi/roudi_config_toml_file_provider.hpp +++ b/iceoryx_posh/include/iceoryx_posh/roudi/roudi_config_toml_file_provider.hpp @@ -28,9 +28,9 @@ static constexpr char defaultConfigFilePath[] = "/etc/iceoryx/roudi_config.toml" class TomlRouDiConfigFileProvider : public iox::roudi::RouDiConfigFileProvider { public: - TomlRouDiConfigFileProvider(iox::config::CmdLineArgs_t& cmdLineArgs); + TomlRouDiConfigFileProvider(iox::config::CmdLineArgs_t& cmdLineArgs) noexcept; - iox::cxx::expected parse() override; + iox::cxx::expected parse() noexcept override; }; } // namespace config } // namespace iox diff --git a/iceoryx_posh/include/iceoryx_posh/runtime/port_config_info.hpp b/iceoryx_posh/include/iceoryx_posh/runtime/port_config_info.hpp index 41904d442e..7eb284582f 100644 --- a/iceoryx_posh/include/iceoryx_posh/runtime/port_config_info.hpp +++ b/iceoryx_posh/include/iceoryx_posh/runtime/port_config_info.hpp @@ -41,10 +41,10 @@ struct PortConfigInfo uint32_t portType{DEFAULT_PORT_TYPE}; iox::mepoo::MemoryInfo memoryInfo; - PortConfigInfo(const PortConfigInfo&) = default; - PortConfigInfo(PortConfigInfo&&) = default; - PortConfigInfo& operator=(const PortConfigInfo&) = default; - PortConfigInfo& operator=(PortConfigInfo&&) = default; + PortConfigInfo(const PortConfigInfo&) noexcept = default; + PortConfigInfo(PortConfigInfo&&) noexcept = default; + PortConfigInfo& operator=(const PortConfigInfo&) noexcept = default; + PortConfigInfo& operator=(PortConfigInfo&&) noexcept = default; /// @brief creates a PortConfigInfo object /// @param[in] portType specifies the type of port to be created @@ -56,7 +56,7 @@ struct PortConfigInfo /// @brief creates a PortConfigInfo object from its serialization /// @param[in] serialization specifies the serialization from which the port is created - PortConfigInfo(const cxx::Serialization& serialization); + PortConfigInfo(const cxx::Serialization& serialization) noexcept; /// @brief creates a serilaization of the PortConfigInfo operator cxx::Serialization() const noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/version/compatibility_check_level.hpp b/iceoryx_posh/include/iceoryx_posh/version/compatibility_check_level.hpp index 4e62971939..0d09c9b419 100644 --- a/iceoryx_posh/include/iceoryx_posh/version/compatibility_check_level.hpp +++ b/iceoryx_posh/include/iceoryx_posh/version/compatibility_check_level.hpp @@ -32,7 +32,7 @@ enum class CompatibilityCheckLevel BUILD_DATE }; -inline iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const version::CompatibilityCheckLevel& level) +inline iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const version::CompatibilityCheckLevel& level) noexcept { switch (level) { diff --git a/iceoryx_posh/source/capro/service_description.cpp b/iceoryx_posh/source/capro/service_description.cpp index 2bbae2b586..b6c4077dc5 100644 --- a/iceoryx_posh/source/capro/service_description.cpp +++ b/iceoryx_posh/source/capro/service_description.cpp @@ -118,7 +118,7 @@ ServiceDescription::ServiceDescription(const IdString_t& service, { } -bool ServiceDescription::operator==(const ServiceDescription& rhs) const +bool ServiceDescription::operator==(const ServiceDescription& rhs) const noexcept { if (!isValid() || !rhs.isValid()) { @@ -142,12 +142,12 @@ bool ServiceDescription::operator==(const ServiceDescription& rhs) const return true; } -bool ServiceDescription::operator!=(const ServiceDescription& rhs) const +bool ServiceDescription::operator!=(const ServiceDescription& rhs) const noexcept { return !(*this == rhs); } -bool ServiceDescription::operator<(const ServiceDescription& rhs) const +bool ServiceDescription::operator<(const ServiceDescription& rhs) const noexcept { auto serviceCompare = m_serviceString.compare(rhs.m_serviceString); if (serviceCompare != 0) @@ -170,7 +170,7 @@ bool ServiceDescription::operator<(const ServiceDescription& rhs) const return false; } -ServiceDescription::operator cxx::Serialization() const +ServiceDescription::operator cxx::Serialization() const noexcept { std::underlying_type::type scope = static_cast::type>(m_scope); std::underlying_type::type interface = diff --git a/iceoryx_posh/source/gateway/toml_gateway_config_parser.cpp b/iceoryx_posh/source/gateway/toml_gateway_config_parser.cpp index b42673174c..920e99b6d4 100644 --- a/iceoryx_posh/source/gateway/toml_gateway_config_parser.cpp +++ b/iceoryx_posh/source/gateway/toml_gateway_config_parser.cpp @@ -21,13 +21,13 @@ #include iox::cxx::expected -iox::config::TomlGatewayConfigParser::parse() +iox::config::TomlGatewayConfigParser::parse() noexcept { return iox::config::TomlGatewayConfigParser::parse(DEFAULT_CONFIG_FILE_PATH); } iox::cxx::expected -iox::config::TomlGatewayConfigParser::parse(const roudi::ConfigFilePathString_t& path) +iox::config::TomlGatewayConfigParser::parse(const roudi::ConfigFilePathString_t& path) noexcept { iox::config::GatewayConfig config; diff --git a/iceoryx_posh/source/mepoo/memory_info.cpp b/iceoryx_posh/source/mepoo/memory_info.cpp index 469a45835d..d6c934b650 100644 --- a/iceoryx_posh/source/mepoo/memory_info.cpp +++ b/iceoryx_posh/source/mepoo/memory_info.cpp @@ -20,7 +20,7 @@ namespace iox { namespace mepoo { -MemoryInfo::MemoryInfo(uint32_t deviceId, uint32_t memoryType) +MemoryInfo::MemoryInfo(uint32_t deviceId, uint32_t memoryType) noexcept : deviceId(deviceId) , memoryType(memoryType) { diff --git a/iceoryx_posh/source/roudi/application/roudi_main.cpp b/iceoryx_posh/source/roudi/application/roudi_main.cpp index 284e5272cf..873950b50d 100644 --- a/iceoryx_posh/source/roudi/application/roudi_main.cpp +++ b/iceoryx_posh/source/roudi/application/roudi_main.cpp @@ -22,7 +22,7 @@ #include "iceoryx_posh/roudi/roudi_cmd_line_parser_config_file_option.hpp" #include "iceoryx_posh/roudi/roudi_config_toml_file_provider.hpp" -int main(int argc, char* argv[]) +int main(int argc, char* argv[]) noexcept { using iox::roudi::IceOryxRouDiApp; diff --git a/iceoryx_posh/source/roudi/memory/default_roudi_memory.cpp b/iceoryx_posh/source/roudi/memory/default_roudi_memory.cpp index 337b4b2ba6..382b311e32 100644 --- a/iceoryx_posh/source/roudi/memory/default_roudi_memory.cpp +++ b/iceoryx_posh/source/roudi/memory/default_roudi_memory.cpp @@ -38,7 +38,7 @@ DefaultRouDiMemory::DefaultRouDiMemory(const RouDiConfig_t& roudiConfig) noexcep Error::kROUDI__DEFAULT_ROUDI_MEMORY_FAILED_TO_ADD_SEGMENT_MANAGER_MEMORY_BLOCK, nullptr, ErrorLevel::FATAL); }); } -mepoo::MePooConfig DefaultRouDiMemory::introspectionMemPoolConfig() const +mepoo::MePooConfig DefaultRouDiMemory::introspectionMemPoolConfig() const noexcept { constexpr uint32_t ALIGNMENT{mepoo::MemPool::CHUNK_MEMORY_ALIGNMENT}; // have some spare chunks to still deliver introspection data in case there are multiple subscriber to the data diff --git a/iceoryx_posh/source/roudi/memory/memory_provider.cpp b/iceoryx_posh/source/roudi/memory/memory_provider.cpp index 62613dfd4e..30cee58967 100644 --- a/iceoryx_posh/source/roudi/memory/memory_provider.cpp +++ b/iceoryx_posh/source/roudi/memory/memory_provider.cpp @@ -164,7 +164,7 @@ bool MemoryProvider::isAvailableAnnounced() const noexcept } -const char* MemoryProvider::getErrorString(const MemoryProviderError error) +const char* MemoryProvider::getErrorString(const MemoryProviderError error) noexcept { switch (error) { diff --git a/iceoryx_posh/source/roudi/memory/roudi_memory_manager.cpp b/iceoryx_posh/source/roudi/memory/roudi_memory_manager.cpp index 9c6cb3187b..a76de36d48 100644 --- a/iceoryx_posh/source/roudi/memory/roudi_memory_manager.cpp +++ b/iceoryx_posh/source/roudi/memory/roudi_memory_manager.cpp @@ -25,7 +25,7 @@ namespace iox { namespace roudi { -iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const RouDiMemoryManagerError& error) +iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const RouDiMemoryManagerError& error) noexcept { switch (error) { diff --git a/iceoryx_posh/source/roudi/roudi.cpp b/iceoryx_posh/source/roudi/roudi.cpp index 5f36d9f320..6512a8ac14 100644 --- a/iceoryx_posh/source/roudi/roudi.cpp +++ b/iceoryx_posh/source/roudi/roudi.cpp @@ -32,7 +32,7 @@ namespace roudi { RouDi::RouDi(RouDiMemoryInterface& roudiMemoryInterface, PortManager& portManager, - RoudiStartupParameters roudiStartupParameters) + RoudiStartupParameters roudiStartupParameters) noexcept : m_killProcessesInDestructor(roudiStartupParameters.m_killProcessesInDestructor) , m_runMonitoringAndDiscoveryThread(true) , m_runHandleRuntimeMessageThread(true) @@ -78,13 +78,13 @@ RouDi::~RouDi() shutdown(); } -void RouDi::startProcessRuntimeMessagesThread() +void RouDi::startProcessRuntimeMessagesThread() noexcept { m_handleRuntimeMessageThread = std::thread(&RouDi::processRuntimeMessages, this); posix::setThreadName(m_handleRuntimeMessageThread.native_handle(), "IPC-msg-process"); } -void RouDi::shutdown() +void RouDi::shutdown() noexcept { m_processIntrospection.stop(); m_portManager->stopPortIntrospection(); @@ -142,12 +142,12 @@ void RouDi::shutdown() } } -void RouDi::cyclicUpdateHook() +void RouDi::cyclicUpdateHook() noexcept { // default implementation; do nothing } -void RouDi::monitorAndDiscoveryUpdate() +void RouDi::monitorAndDiscoveryUpdate() noexcept { while (m_runMonitoringAndDiscoveryThread) { @@ -159,7 +159,7 @@ void RouDi::monitorAndDiscoveryUpdate() } } -void RouDi::processRuntimeMessages() +void RouDi::processRuntimeMessages() noexcept { runtime::IpcInterfaceCreator roudiIpcInterface{IPC_CHANNEL_ROUDI_NAME}; @@ -183,7 +183,7 @@ void RouDi::processRuntimeMessages() version::VersionInfo RouDi::parseRegisterMessage(const runtime::IpcMessage& message, uint32_t& pid, uid_t& userId, - int64_t& transmissionTimestamp) + int64_t& transmissionTimestamp) noexcept { cxx::convert::fromString(message.getElementAtIndex(2).c_str(), pid); cxx::convert::fromString(message.getElementAtIndex(3).c_str(), userId); @@ -194,7 +194,7 @@ version::VersionInfo RouDi::parseRegisterMessage(const runtime::IpcMessage& mess void RouDi::processMessage(const runtime::IpcMessage& message, const iox::runtime::IpcMessageType& cmd, - const RuntimeName_t& runtimeName) + const RuntimeName_t& runtimeName) noexcept { switch (cmd) { @@ -454,20 +454,20 @@ void RouDi::registerProcess(const RuntimeName_t& name, const posix::PosixUser user, const int64_t transmissionTimestamp, const uint64_t sessionId, - const version::VersionInfo& versionInfo) + const version::VersionInfo& versionInfo) noexcept { bool monitorProcess = (m_monitoringMode == roudi::MonitoringMode::ON); IOX_DISCARD_RESULT( m_prcMgr->registerProcess(name, pid, user, monitorProcess, transmissionTimestamp, sessionId, versionInfo)); } -uint64_t RouDi::getUniqueSessionIdForProcess() +uint64_t RouDi::getUniqueSessionIdForProcess() noexcept { static uint64_t sessionId = 0; return ++sessionId; } -void RouDi::IpcMessageErrorHandler() +void RouDi::IpcMessageErrorHandler() noexcept { } diff --git a/iceoryx_posh/source/roudi/roudi_config.cpp b/iceoryx_posh/source/roudi/roudi_config.cpp index bb85edc57c..16d038394e 100644 --- a/iceoryx_posh/source/roudi/roudi_config.cpp +++ b/iceoryx_posh/source/roudi/roudi_config.cpp @@ -20,12 +20,12 @@ namespace iox { namespace config { -RouDiConfig& RouDiConfig::setDefaults() +RouDiConfig& RouDiConfig::setDefaults() noexcept { return *this; } -RouDiConfig& RouDiConfig::optimize() +RouDiConfig& RouDiConfig::optimize() noexcept { return *this; } diff --git a/iceoryx_posh/source/roudi/roudi_config_toml_file_provider.cpp b/iceoryx_posh/source/roudi/roudi_config_toml_file_provider.cpp index d492487c9a..147278283f 100644 --- a/iceoryx_posh/source/roudi/roudi_config_toml_file_provider.cpp +++ b/iceoryx_posh/source/roudi/roudi_config_toml_file_provider.cpp @@ -30,7 +30,7 @@ namespace iox { namespace config { -TomlRouDiConfigFileProvider::TomlRouDiConfigFileProvider(config::CmdLineArgs_t& cmdLineArgs) +TomlRouDiConfigFileProvider::TomlRouDiConfigFileProvider(config::CmdLineArgs_t& cmdLineArgs) noexcept { /// don't print additional output if not running if (cmdLineArgs.run) @@ -55,7 +55,7 @@ TomlRouDiConfigFileProvider::TomlRouDiConfigFileProvider(config::CmdLineArgs_t& } } -iox::cxx::expected TomlRouDiConfigFileProvider::parse() +iox::cxx::expected TomlRouDiConfigFileProvider::parse() noexcept { // Early exit in case no config file path was provided if (m_customConfigFilePath.empty()) diff --git a/iceoryx_posh/source/roudi/service_registry.cpp b/iceoryx_posh/source/roudi/service_registry.cpp index dc79b4c723..3cafdf7435 100644 --- a/iceoryx_posh/source/roudi/service_registry.cpp +++ b/iceoryx_posh/source/roudi/service_registry.cpp @@ -21,19 +21,19 @@ namespace iox { namespace roudi { -void ServiceRegistry::add(const capro::IdString_t& service, const capro::IdString_t& instance) +void ServiceRegistry::add(const capro::IdString_t& service, const capro::IdString_t& instance) noexcept { cxx::set::add(m_serviceMap[service].instanceSet, instance); } -void ServiceRegistry::remove(const capro::IdString_t& service, const capro::IdString_t& instance) +void ServiceRegistry::remove(const capro::IdString_t& service, const capro::IdString_t& instance) noexcept { cxx::set::remove(m_serviceMap[service].instanceSet, instance); } void ServiceRegistry::find(InstanceSet_t& instances, const capro::IdString_t& service, - const capro::IdString_t& instance) const + const capro::IdString_t& instance) const noexcept { if (instance == Wildcard) { @@ -53,7 +53,7 @@ void ServiceRegistry::find(InstanceSet_t& instances, } } -const ServiceRegistry::serviceMap_t& ServiceRegistry::getServiceMap() const +const ServiceRegistry::serviceMap_t& ServiceRegistry::getServiceMap() const noexcept { return m_serviceMap; } diff --git a/iceoryx_posh/source/runtime/ipc_interface_creator.cpp b/iceoryx_posh/source/runtime/ipc_interface_creator.cpp index ae5689e8ce..856f8d15b0 100644 --- a/iceoryx_posh/source/runtime/ipc_interface_creator.cpp +++ b/iceoryx_posh/source/runtime/ipc_interface_creator.cpp @@ -51,7 +51,7 @@ IpcInterfaceCreator::IpcInterfaceCreator(const RuntimeName_t& runtimeName, openIpcChannel(posix::IpcChannelSide::SERVER); } -void IpcInterfaceCreator::cleanupResource() +void IpcInterfaceCreator::cleanupResource() noexcept { m_ipcChannel.destroy().or_else( [this](auto) { LogWarn() << "unable to cleanup ipc channel resource " << m_runtimeName; }); diff --git a/iceoryx_posh/source/runtime/port_config_info.cpp b/iceoryx_posh/source/runtime/port_config_info.cpp index 0110d9b46a..929519ef30 100644 --- a/iceoryx_posh/source/runtime/port_config_info.cpp +++ b/iceoryx_posh/source/runtime/port_config_info.cpp @@ -26,7 +26,7 @@ PortConfigInfo::PortConfigInfo(uint32_t portType, uint32_t deviceId, uint32_t me { } -PortConfigInfo::PortConfigInfo(const cxx::Serialization& serialization) +PortConfigInfo::PortConfigInfo(const cxx::Serialization& serialization) noexcept { serialization.extract(portType, memoryInfo.deviceId, memoryInfo.memoryType); } diff --git a/iceoryx_posh/source/runtime/posh_runtime_single_process.cpp b/iceoryx_posh/source/runtime/posh_runtime_single_process.cpp index 9ddcf0a24a..d6f51ed26b 100644 --- a/iceoryx_posh/source/runtime/posh_runtime_single_process.cpp +++ b/iceoryx_posh/source/runtime/posh_runtime_single_process.cpp @@ -20,13 +20,13 @@ namespace iox { namespace runtime { -PoshRuntime*& getSingleProcessRuntime() +PoshRuntime*& getSingleProcessRuntime() noexcept { static PoshRuntime* singleProcessRuntime = nullptr; return singleProcessRuntime; } -PoshRuntime& singleProcessRuntimeFactory(cxx::optional) +PoshRuntime& singleProcessRuntimeFactory(cxx::optional) noexcept { return *getSingleProcessRuntime(); } diff --git a/iceoryx_posh/source/runtime/shared_memory_user.cpp b/iceoryx_posh/source/runtime/shared_memory_user.cpp index e72ab293ac..db508aeae9 100644 --- a/iceoryx_posh/source/runtime/shared_memory_user.cpp +++ b/iceoryx_posh/source/runtime/shared_memory_user.cpp @@ -28,7 +28,7 @@ namespace runtime { SharedMemoryUser::SharedMemoryUser(const size_t topicSize, const uint64_t segmentId, - const rp::BaseRelativePointer::offset_t segmentManagerAddressOffset) + const rp::BaseRelativePointer::offset_t segmentManagerAddressOffset) noexcept { // create and map the already existing shared memory region posix::SharedMemoryObject::create(roudi::SHM_NAME, From 59ad6b8912703c8d17790c76a2466eb932fc52aa Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Wed, 1 Sep 2021 13:33:47 +0200 Subject: [PATCH 2/5] iox-#902 Adapt test code to new API with noexcept Signed-off-by: Simon Hoinkis --- .../testing/include/iceoryx_hoofs/testing/mocks/logger_mock.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iceoryx_hoofs/testing/include/iceoryx_hoofs/testing/mocks/logger_mock.hpp b/iceoryx_hoofs/testing/include/iceoryx_hoofs/testing/mocks/logger_mock.hpp index 2cf2df1f6a..0807696bce 100644 --- a/iceoryx_hoofs/testing/include/iceoryx_hoofs/testing/mocks/logger_mock.hpp +++ b/iceoryx_hoofs/testing/include/iceoryx_hoofs/testing/mocks/logger_mock.hpp @@ -30,7 +30,7 @@ class Logger_Mock : public iox::log::Logger { } - void Log(const iox::log::LogEntry& entry) const override + void Log(const iox::log::LogEntry& entry) const noexcept override { m_logs.push_back(entry); } From 3f1553cbc7425679fb6f4b9689ecb7d81b140b70 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Wed, 1 Sep 2021 13:48:51 +0200 Subject: [PATCH 3/5] iox-#902 Apply clang-format to touched files Signed-off-by: Simon Hoinkis --- .../include/iceoryx_hoofs/cxx/helplets.hpp | 4 ++-- .../error_handling/error_handling.hpp | 3 ++- .../internal/cxx/method_callback.inl | 8 +++++--- .../internal/posix_wrapper/access_control.hpp | 3 ++- .../internal/posix_wrapper/message_queue.hpp | 6 ++++-- .../source/error_handling/error_handling.cpp | 4 +++- iceoryx_hoofs/source/log/logger.cpp | 4 +++- .../source/posix_wrapper/access_control.cpp | 4 +++- .../source/posix_wrapper/message_queue.cpp | 6 ++++-- .../internal/popo/notification_callback.inl | 6 ++++-- .../roudi/introspection/port_introspection.inl | 16 ++++++++++------ .../iceoryx_posh/popo/notification_callback.hpp | 8 +++++--- .../version/compatibility_check_level.hpp | 3 ++- .../roudi/roudi_config_toml_file_provider.cpp | 3 ++- 14 files changed, 51 insertions(+), 27 deletions(-) diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp index 0815f94bcd..bc91d1d372 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp @@ -37,8 +37,8 @@ struct TruncateToCapacity_t; namespace internal { -inline void -Require(const bool condition, const char* file, const int line, const char* function, const char* conditionString) noexcept +inline void Require( + const bool condition, const char* file, const int line, const char* function, const char* conditionString) noexcept { if (!condition) { diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/error_handling/error_handling.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/error_handling/error_handling.hpp index cf5dd046b3..75f0e7ae84 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/error_handling/error_handling.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/error_handling/error_handling.hpp @@ -216,7 +216,8 @@ using HandlerFunction = std::function errorCallBack, const ErrorLevel level) noexcept; + friend void + errorHandler(const Error error, const std::function errorCallBack, const ErrorLevel level) noexcept; public: static cxx::GenericRAII SetTemporaryErrorHandler(const HandlerFunction& newHandler) noexcept; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/method_callback.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/method_callback.inl index ebae731174..2e8fb8d02f 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/method_callback.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/method_callback.inl @@ -46,8 +46,9 @@ struct ReturnSuccess }; template -ReturnValue -constMethodCallbackCaller(const void* objectRef, ReturnValue (GenericClass::*methodPtr)(Args...) const, Args&&... args) noexcept +ReturnValue constMethodCallbackCaller(const void* objectRef, + ReturnValue (GenericClass::*methodPtr)(Args...) const, + Args&&... args) noexcept { return ((*reinterpret_cast(objectRef)) .*reinterpret_cast(methodPtr))(std::forward(args)...); @@ -55,7 +56,8 @@ constMethodCallbackCaller(const void* objectRef, ReturnValue (GenericClass::*met template -ReturnValue methodCallbackCaller(void* objectRef, ReturnValue (GenericClass::*methodPtr)(Args...), Args&&... args) noexcept +ReturnValue +methodCallbackCaller(void* objectRef, ReturnValue (GenericClass::*methodPtr)(Args...), Args&&... args) noexcept { return ((*reinterpret_cast(objectRef)) .*reinterpret_cast(methodPtr))(std::forward(args)...); diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/access_control.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/access_control.hpp index 67cb558b24..6cd6c52da3 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/access_control.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/access_control.hpp @@ -90,7 +90,8 @@ class AccessController /// @param[f_permission] Permissions which should be applied to the category. /// @param[f_id] The group or user id - depending on the category. For Category::USER, Category::GROUP and /// Category::OTHER the f_id is not required for everything else a valid group or user id is mandatory. - bool addPermissionEntry(const Category f_category, const Permission f_permission, const uint32_t f_id = -1u) noexcept; + bool + addPermissionEntry(const Category f_category, const Permission f_permission, const uint32_t f_id = -1u) noexcept; /// @brief just like addPermissionEntry(Category, Permission, int) but using a name instead of an id. bool addPermissionEntry(const Category f_category, const Permission f_permission, const string_t& f_name) noexcept; diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/message_queue.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/message_queue.hpp index 60ae348d6a..1860c3bc97 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/message_queue.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/message_queue.hpp @@ -100,12 +100,14 @@ class MessageQueue : public DesignPattern::Creation open(const IpcChannelName_t& name, const IpcChannelSide channelSide) noexcept; + cxx::expected open(const IpcChannelName_t& name, + const IpcChannelSide channelSide) noexcept; cxx::expected close() noexcept; cxx::expected unlink() noexcept; cxx::error createErrorFromErrnum(const int32_t errnum) const noexcept; - static cxx::error createErrorFromErrnum(const IpcChannelName_t& name, const int32_t errnum) noexcept; + static cxx::error createErrorFromErrnum(const IpcChannelName_t& name, + const int32_t errnum) noexcept; static cxx::expected sanitizeIpcChannelName(const IpcChannelName_t& name) noexcept; diff --git a/iceoryx_hoofs/source/error_handling/error_handling.cpp b/iceoryx_hoofs/source/error_handling/error_handling.cpp index b02c2ae138..2083c530a9 100644 --- a/iceoryx_hoofs/source/error_handling/error_handling.cpp +++ b/iceoryx_hoofs/source/error_handling/error_handling.cpp @@ -38,7 +38,9 @@ std::ostream& operator<<(std::ostream& stream, Error value) noexcept return stream; } -void ErrorHandler::DefaultHandler(const Error error, const std::function errorCallBack, const ErrorLevel level) noexcept +void ErrorHandler::DefaultHandler(const Error error, + const std::function errorCallBack, + const ErrorLevel level) noexcept { if (errorCallBack) { diff --git a/iceoryx_hoofs/source/log/logger.cpp b/iceoryx_hoofs/source/log/logger.cpp index 0ae6b7df3c..2bf173dbbe 100644 --- a/iceoryx_hoofs/source/log/logger.cpp +++ b/iceoryx_hoofs/source/log/logger.cpp @@ -34,7 +34,9 @@ namespace iox { namespace log { -Logger::Logger(IOX_MAYBE_UNUSED std::string ctxId, IOX_MAYBE_UNUSED std::string ctxDescription, LogLevel appLogLevel) noexcept +Logger::Logger(IOX_MAYBE_UNUSED std::string ctxId, + IOX_MAYBE_UNUSED std::string ctxDescription, + LogLevel appLogLevel) noexcept : m_logLevel(appLogLevel) { } diff --git a/iceoryx_hoofs/source/posix_wrapper/access_control.cpp b/iceoryx_hoofs/source/posix_wrapper/access_control.cpp index d06e3da81b..5e571bae7a 100644 --- a/iceoryx_hoofs/source/posix_wrapper/access_control.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/access_control.cpp @@ -154,7 +154,9 @@ bool AccessController::addPermissionEntry(const Category f_category, return false; } -bool AccessController::addPermissionEntry(const Category f_category, const Permission f_permission, const uint32_t f_id) noexcept +bool AccessController::addPermissionEntry(const Category f_category, + const Permission f_permission, + const uint32_t f_id) noexcept { if (m_permissions.size() >= m_permissions.capacity()) { diff --git a/iceoryx_hoofs/source/posix_wrapper/message_queue.cpp b/iceoryx_hoofs/source/posix_wrapper/message_queue.cpp index cca111cd50..3580fa284d 100644 --- a/iceoryx_hoofs/source/posix_wrapper/message_queue.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/message_queue.cpp @@ -289,7 +289,8 @@ cxx::expected MessageQueue::timedReceive(const uni return cxx::success(std::string(&(message[0]))); } -cxx::expected MessageQueue::timedSend(const std::string& msg, const units::Duration& timeout) const noexcept +cxx::expected MessageQueue::timedSend(const std::string& msg, + const units::Duration& timeout) const noexcept { const size_t messageSize = static_cast(msg.size()) + NULL_TERMINATOR_SIZE; if (messageSize > static_cast(m_attributes.mq_msgsize)) @@ -335,7 +336,8 @@ cxx::error MessageQueue::createErrorFromErrnum(const int32_t er return createErrorFromErrnum(m_name, errnum); } -cxx::error MessageQueue::createErrorFromErrnum(const IpcChannelName_t& name, const int32_t errnum) noexcept +cxx::error MessageQueue::createErrorFromErrnum(const IpcChannelName_t& name, + const int32_t errnum) noexcept { switch (errnum) { diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/notification_callback.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/notification_callback.inl index b246f6629e..98bb9bd89b 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/notification_callback.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/notification_callback.inl @@ -42,14 +42,16 @@ inline void TranslateAndCallTypelessCallback::call(void* const orig } // namespace internal template -inline NotificationCallback createNotificationCallback(void (&callback)(OriginType* const)) noexcept +inline NotificationCallback +createNotificationCallback(void (&callback)(OriginType* const)) noexcept { return NotificationCallback{&callback}; } template inline NotificationCallback -createNotificationCallback(void (&callback)(OriginType* const, ContextDataType* const), ContextDataType& userValue) noexcept +createNotificationCallback(void (&callback)(OriginType* const, ContextDataType* const), + ContextDataType& userValue) noexcept { return NotificationCallback{&callback, &userValue}; } diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.inl b/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.inl index 6db935b711..ce4989dcfa 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.inl @@ -232,8 +232,8 @@ inline bool PortIntrospection::PortData::updateSu } template -inline bool -PortIntrospection::PortData::addPublisher(typename PublisherPort::MemberType_t& port) noexcept +inline bool PortIntrospection::PortData::addPublisher( + typename PublisherPort::MemberType_t& port) noexcept { std::lock_guard lock(m_mutex); @@ -347,7 +347,8 @@ inline bool PortIntrospection::PortData::addSubsc } template -inline bool PortIntrospection::PortData::removePublisher(const PublisherPort& port) noexcept +inline bool +PortIntrospection::PortData::removePublisher(const PublisherPort& port) noexcept { std::lock_guard lock(m_mutex); @@ -382,7 +383,8 @@ inline bool PortIntrospection::PortData::removePu } template -inline bool PortIntrospection::PortData::removeSubscriber(const SubscriberPort& port) noexcept +inline bool +PortIntrospection::PortData::removeSubscriber(const SubscriberPort& port) noexcept { std::lock_guard lock(m_mutex); @@ -633,13 +635,15 @@ inline void PortIntrospection::PortData::setNew(b } template -inline bool PortIntrospection::addPublisher(typename PublisherPort::MemberType_t& port) noexcept +inline bool +PortIntrospection::addPublisher(typename PublisherPort::MemberType_t& port) noexcept { return m_portData.addPublisher(port); } template -inline bool PortIntrospection::addSubscriber(typename SubscriberPort::MemberType_t& port) noexcept +inline bool +PortIntrospection::addSubscriber(typename SubscriberPort::MemberType_t& port) noexcept { return m_portData.addSubscriber(port); } diff --git a/iceoryx_posh/include/iceoryx_posh/popo/notification_callback.hpp b/iceoryx_posh/include/iceoryx_posh/popo/notification_callback.hpp index 96b27af2a5..12e815622c 100644 --- a/iceoryx_posh/include/iceoryx_posh/popo/notification_callback.hpp +++ b/iceoryx_posh/include/iceoryx_posh/popo/notification_callback.hpp @@ -78,15 +78,17 @@ struct NotificationCallback /// @param[in] callback reference to a callback with the signature void(OriginType*) /// @return the callback stored inside of an NotificationCallback template -NotificationCallback createNotificationCallback(void (&callback)(OriginType* const)) noexcept; +NotificationCallback +createNotificationCallback(void (&callback)(OriginType* const)) noexcept; /// @brief creates an NotificationCallback with a user defined value /// @param[in] callback reference to a callback with the signature void(OriginType*, ContextDataType*) /// @param[in] userValue reference to a user defined value /// @return the callback and user value stored inside of an NotificationCallback template -NotificationCallback -createNotificationCallback(void (&callback)(OriginType* const, ContextDataType* const), ContextDataType& userValue) noexcept; +NotificationCallback createNotificationCallback(void (&callback)(OriginType* const, + ContextDataType* const), + ContextDataType& userValue) noexcept; } // namespace popo } // namespace iox diff --git a/iceoryx_posh/include/iceoryx_posh/version/compatibility_check_level.hpp b/iceoryx_posh/include/iceoryx_posh/version/compatibility_check_level.hpp index 0d09c9b419..3d4d1ec0ce 100644 --- a/iceoryx_posh/include/iceoryx_posh/version/compatibility_check_level.hpp +++ b/iceoryx_posh/include/iceoryx_posh/version/compatibility_check_level.hpp @@ -32,7 +32,8 @@ enum class CompatibilityCheckLevel BUILD_DATE }; -inline iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const version::CompatibilityCheckLevel& level) noexcept +inline iox::log::LogStream& operator<<(iox::log::LogStream& logstream, + const version::CompatibilityCheckLevel& level) noexcept { switch (level) { diff --git a/iceoryx_posh/source/roudi/roudi_config_toml_file_provider.cpp b/iceoryx_posh/source/roudi/roudi_config_toml_file_provider.cpp index 147278283f..7acef77bb4 100644 --- a/iceoryx_posh/source/roudi/roudi_config_toml_file_provider.cpp +++ b/iceoryx_posh/source/roudi/roudi_config_toml_file_provider.cpp @@ -55,7 +55,8 @@ TomlRouDiConfigFileProvider::TomlRouDiConfigFileProvider(config::CmdLineArgs_t& } } -iox::cxx::expected TomlRouDiConfigFileProvider::parse() noexcept +iox::cxx::expected +TomlRouDiConfigFileProvider::parse() noexcept { // Early exit in case no config file path was provided if (m_customConfigFilePath.empty()) From b690d2e3f0a6f99c600a492e1e10bf2bc89b1962 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Wed, 1 Sep 2021 13:56:21 +0200 Subject: [PATCH 4/5] iox-#902 Add missing noexcept Signed-off-by: Simon Hoinkis --- .../include/iceoryx_binding_c/internal/cpp2c_publisher.hpp | 2 +- iceoryx_binding_c/source/cpp2c_publisher.cpp | 2 +- iceoryx_binding_c/source/cpp2c_subscriber.cpp | 2 +- iceoryx_hoofs/include/iceoryx_hoofs/cxx/forward_list.hpp | 2 +- iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/convert.inl | 2 +- .../include/iceoryx_hoofs/internal/cxx/forward_list.inl | 2 +- iceoryx_hoofs/source/log/logstream.cpp | 2 +- iceoryx_hoofs/source/posix_wrapper/message_queue.cpp | 2 +- iceoryx_hoofs/source/posix_wrapper/mutex.cpp | 2 +- .../source/posix_wrapper/shared_memory_object/memory_map.cpp | 2 +- .../include/iceoryx_posh/internal/popo/base_publisher.inl | 2 +- iceoryx_posh/include/iceoryx_posh/popo/base_publisher.hpp | 2 +- iceoryx_posh/source/popo/listener.cpp | 4 ++-- iceoryx_posh/source/popo/trigger.cpp | 2 +- iceoryx_posh/source/popo/trigger_handle.cpp | 2 +- iceoryx_posh/source/roudi/roudi.cpp | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_publisher.hpp b/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_publisher.hpp index e07a9e114e..cbccab27b3 100644 --- a/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_publisher.hpp +++ b/iceoryx_binding_c/include/iceoryx_binding_c/internal/cpp2c_publisher.hpp @@ -25,7 +25,7 @@ struct cpp2c_Publisher cpp2c_Publisher() noexcept = default; cpp2c_Publisher(const cpp2c_Publisher&) = delete; cpp2c_Publisher(cpp2c_Publisher&& rhs) noexcept; - ~cpp2c_Publisher(); + ~cpp2c_Publisher() noexcept; cpp2c_Publisher& operator=(const cpp2c_Publisher&) = delete; cpp2c_Publisher& operator=(cpp2c_Publisher&& rhs) noexcept; diff --git a/iceoryx_binding_c/source/cpp2c_publisher.cpp b/iceoryx_binding_c/source/cpp2c_publisher.cpp index acdd017ed1..80e84a2653 100644 --- a/iceoryx_binding_c/source/cpp2c_publisher.cpp +++ b/iceoryx_binding_c/source/cpp2c_publisher.cpp @@ -21,7 +21,7 @@ cpp2c_Publisher::cpp2c_Publisher(cpp2c_Publisher&& rhs) noexcept *this = std::move(rhs); } -cpp2c_Publisher::~cpp2c_Publisher() +cpp2c_Publisher::~cpp2c_Publisher() noexcept { if (m_portData) { diff --git a/iceoryx_binding_c/source/cpp2c_subscriber.cpp b/iceoryx_binding_c/source/cpp2c_subscriber.cpp index 7c43ef8472..2e21360e49 100644 --- a/iceoryx_binding_c/source/cpp2c_subscriber.cpp +++ b/iceoryx_binding_c/source/cpp2c_subscriber.cpp @@ -22,7 +22,7 @@ using namespace iox::popo; -cpp2c_Subscriber::~cpp2c_Subscriber() +cpp2c_Subscriber::~cpp2c_Subscriber() noexcept { if (m_portData) { diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/forward_list.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/forward_list.hpp index f16350a1ac..982689f791 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/cxx/forward_list.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/cxx/forward_list.hpp @@ -73,7 +73,7 @@ class forward_list /// @brief destructs the list and also calls the destructor of all /// contained elements - ~forward_list(); + ~forward_list() noexcept; /// @brief copy constructor list including elements /// @param[in] rhs is the list to copy from (same capacity) diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/convert.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/convert.inl index ffe3248bd9..afc5565674 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/convert.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/convert.inl @@ -222,7 +222,7 @@ inline bool convert::fromString(const char* v, uint64_t& dest) noexcep /// introduced for mac os since unsigned long is not uint64_t despite it has the same size /// who knows why ¯\_(ツ)_/¯ template <> -inline bool convert::fromString(const char* v, unsigned long& dest) +inline bool convert::fromString(const char* v, unsigned long& dest) noexcept { uint64_t temp{0}; bool retVal = fromString(v, temp); diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/forward_list.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/forward_list.inl index b75c1303ac..3f35899a3e 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/forward_list.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/forward_list.inl @@ -121,7 +121,7 @@ inline forward_list& forward_list::forward_list::opera template -inline forward_list::~forward_list() +inline forward_list::~forward_list() noexcept { clear(); } diff --git a/iceoryx_hoofs/source/log/logstream.cpp b/iceoryx_hoofs/source/log/logstream.cpp index 17c342e318..80dc83a0ae 100644 --- a/iceoryx_hoofs/source/log/logstream.cpp +++ b/iceoryx_hoofs/source/log/logstream.cpp @@ -37,7 +37,7 @@ LogStream::LogStream(Logger& logger, LogLevel logLevel) noexcept m_logEntry.time = std::chrono::duration_cast(timePoint.time_since_epoch()); } -LogStream::~LogStream() +LogStream::~LogStream() noexcept { Flush(); } diff --git a/iceoryx_hoofs/source/posix_wrapper/message_queue.cpp b/iceoryx_hoofs/source/posix_wrapper/message_queue.cpp index 3580fa284d..e1303937a7 100644 --- a/iceoryx_hoofs/source/posix_wrapper/message_queue.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/message_queue.cpp @@ -98,7 +98,7 @@ MessageQueue::MessageQueue(MessageQueue&& other) noexcept *this = std::move(other); } -MessageQueue::~MessageQueue() +MessageQueue::~MessageQueue() noexcept { if (destroy().has_error()) { diff --git a/iceoryx_hoofs/source/posix_wrapper/mutex.cpp b/iceoryx_hoofs/source/posix_wrapper/mutex.cpp index 847fe67f5b..68053f0064 100644 --- a/iceoryx_hoofs/source/posix_wrapper/mutex.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/mutex.cpp @@ -50,7 +50,7 @@ mutex::mutex(bool f_isRecursive) noexcept cxx::Ensures(isInitialized && "Unable to create mutex"); } -mutex::~mutex() +mutex::~mutex() noexcept { auto destroyCall = posixCall(pthread_mutex_destroy)(&m_handle).successReturnValue(0).evaluate(); diff --git a/iceoryx_hoofs/source/posix_wrapper/shared_memory_object/memory_map.cpp b/iceoryx_hoofs/source/posix_wrapper/shared_memory_object/memory_map.cpp index 23616f2c42..0b20529bac 100644 --- a/iceoryx_hoofs/source/posix_wrapper/shared_memory_object/memory_map.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/shared_memory_object/memory_map.cpp @@ -155,7 +155,7 @@ MemoryMap& MemoryMap::operator=(MemoryMap&& rhs) noexcept return *this; } -MemoryMap::~MemoryMap() +MemoryMap::~MemoryMap() noexcept { if (!destroy()) { diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/base_publisher.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/base_publisher.inl index 8e36e2fac2..b244ea01d0 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/base_publisher.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/base_publisher.inl @@ -32,7 +32,7 @@ inline BasePublisher::BasePublisher(const capro::ServiceDescription& ser } template -inline BasePublisher::~BasePublisher() +inline BasePublisher::~BasePublisher() noexcept { m_port.destroy(); } diff --git a/iceoryx_posh/include/iceoryx_posh/popo/base_publisher.hpp b/iceoryx_posh/include/iceoryx_posh/popo/base_publisher.hpp index 87a8893f04..b2c27e44a6 100644 --- a/iceoryx_posh/include/iceoryx_posh/popo/base_publisher.hpp +++ b/iceoryx_posh/include/iceoryx_posh/popo/base_publisher.hpp @@ -44,7 +44,7 @@ class BasePublisher BasePublisher& operator=(const BasePublisher&) = delete; BasePublisher(BasePublisher&& rhs) = delete; BasePublisher& operator=(BasePublisher&& rhs) = delete; - virtual ~BasePublisher(); + virtual ~BasePublisher() noexcept; /// /// @brief uid Get the UID of the publisher. diff --git a/iceoryx_posh/source/popo/listener.cpp b/iceoryx_posh/source/popo/listener.cpp index 5759e03a8a..089d3b5678 100644 --- a/iceoryx_posh/source/popo/listener.cpp +++ b/iceoryx_posh/source/popo/listener.cpp @@ -34,7 +34,7 @@ Listener::Listener(ConditionVariableData& conditionVariable) noexcept m_thread = std::thread(&Listener::threadLoop, this); } -Listener::~Listener() +Listener::~Listener() noexcept { m_wasDtorCalled.store(true, std::memory_order_relaxed); m_conditionListener.destroy(); @@ -107,7 +107,7 @@ void Listener::removeTrigger(const uint64_t index) noexcept //////////////// // Event_t //////////////// -Listener::Event_t::~Event_t() +Listener::Event_t::~Event_t() noexcept { reset(); } diff --git a/iceoryx_posh/source/popo/trigger.cpp b/iceoryx_posh/source/popo/trigger.cpp index bcc08382d9..2daeca80df 100644 --- a/iceoryx_posh/source/popo/trigger.cpp +++ b/iceoryx_posh/source/popo/trigger.cpp @@ -22,7 +22,7 @@ namespace popo { constexpr uint64_t Trigger::INVALID_TRIGGER_ID; -Trigger::~Trigger() +Trigger::~Trigger() noexcept { reset(); } diff --git a/iceoryx_posh/source/popo/trigger_handle.cpp b/iceoryx_posh/source/popo/trigger_handle.cpp index 5d022c581b..0c8231d3fd 100644 --- a/iceoryx_posh/source/popo/trigger_handle.cpp +++ b/iceoryx_posh/source/popo/trigger_handle.cpp @@ -59,7 +59,7 @@ TriggerHandle& TriggerHandle::operator=(TriggerHandle&& rhs) noexcept return *this; } -TriggerHandle::~TriggerHandle() +TriggerHandle::~TriggerHandle() noexcept { reset(); } diff --git a/iceoryx_posh/source/roudi/roudi.cpp b/iceoryx_posh/source/roudi/roudi.cpp index 6512a8ac14..7c969effea 100644 --- a/iceoryx_posh/source/roudi/roudi.cpp +++ b/iceoryx_posh/source/roudi/roudi.cpp @@ -73,7 +73,7 @@ RouDi::RouDi(RouDiMemoryInterface& roudiMemoryInterface, } } -RouDi::~RouDi() +RouDi::~RouDi() noexcept { shutdown(); } From 15694662373a56292fc6baa9f0ebf068e9e1c6f0 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Tue, 14 Sep 2021 11:03:02 +0200 Subject: [PATCH 5/5] iox-#902 Remove obsolete files Signed-off-by: Simon Hoinkis --- .../internal/posix_wrapper/timespec.hpp | 46 --------------- .../source/posix_wrapper/timespec.cpp | 56 ------------------- 2 files changed, 102 deletions(-) delete mode 100644 iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/timespec.hpp delete mode 100644 iceoryx_hoofs/source/posix_wrapper/timespec.cpp diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/timespec.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/timespec.hpp deleted file mode 100644 index e3db0c96cf..0000000000 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/timespec.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. -// Copyright (c) 2021 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_POSIX_WRAPPER_TIMESPEC_HPP -#define IOX_HOOFS_POSIX_WRAPPER_TIMESPEC_HPP - -#include -// For std types -#include - -namespace iox -{ -namespace posix -{ -constexpr unsigned int TS_DIVIDER_sec = 1000000000; -constexpr unsigned int TS_DIVIDER_msec = (TS_DIVIDER_sec / 1000); - -/// @brief adds period in time [ms] to a given timestruct -/// @param[in] time period time base -/// @param[in] timeToAdd_ms period in time [ms] to be added -/// @return sum of the two inputs [timespec] -struct timespec addTimeMs(struct timespec time, const uint32_t timeToAdd_ms) noexcept; - -/// @brief subtract subtrahend from minuend -/// @param[in] minuend [timespec] -/// @param[in] subtrahend [timespec] -/// @return result [ms] -double subtractTimespecMS(const struct timespec minuend, const struct timespec subtrahend) noexcept; - -} // namespace posix -} // namespace iox - -#endif // IOX_HOOFS_POSIX_WRAPPER_TIMESPEC_HPP diff --git a/iceoryx_hoofs/source/posix_wrapper/timespec.cpp b/iceoryx_hoofs/source/posix_wrapper/timespec.cpp deleted file mode 100644 index 20f77e5036..0000000000 --- a/iceoryx_hoofs/source/posix_wrapper/timespec.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. -// Copyright (c) 2021 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 - -#include "iceoryx_hoofs/internal/posix_wrapper/timespec.hpp" - -namespace iox -{ -namespace posix -{ -struct timespec addTimeMs(struct timespec time, const uint32_t timeToAdd_ms) noexcept -{ - decltype(time.tv_nsec) sec_ns = time.tv_nsec + ((timeToAdd_ms % 1000) * TS_DIVIDER_msec); - time.tv_sec += (timeToAdd_ms / 1000); - if (sec_ns < TS_DIVIDER_sec) - { - time.tv_nsec = sec_ns; - } - else - { - time.tv_nsec = sec_ns % TS_DIVIDER_sec; - time.tv_sec++; - } - - return time; -} - -double subtractTimespecMS(const struct timespec minuend, const struct timespec subtrahend) noexcept -{ - // Define TimeType instead of long long to be machine independent, long long is 64-bit on QNX/Linux 32-bit/64-bit - using TimeType = std::uint64_t; - static_assert(sizeof(TimeType) >= sizeof(minuend.tv_sec), "Wrong type for this architecture"); - static_assert(sizeof(TimeType) >= sizeof(subtrahend.tv_nsec), "Wrong type for this architecture"); - - const TimeType diff_s = static_cast(minuend.tv_sec) - static_cast(subtrahend.tv_sec); - const TimeType diff_ns = static_cast(minuend.tv_nsec) - static_cast(subtrahend.tv_nsec); - - return (static_cast(diff_s) * 1000.) - + (static_cast(diff_ns) / static_cast(TS_DIVIDER_msec)); -} - -} // namespace posix -} // namespace iox