From 793115be3976dccdaf24b59b06c71a4d35b0fbd8 Mon Sep 17 00:00:00 2001 From: Lorenz Hruby Date: Thu, 29 Aug 2024 18:06:08 +0200 Subject: [PATCH] Move to Clang 17 (#146) # Description Move to Clang 17, this is needed due to https://github.com/llvm/llvm-project/issues/106204 and https://github.com/llvm/llvm-project/issues/96210#issuecomment-2218011106. In addition, we install `ssh` package. --------- Co-authored-by: Filippo Brizzi --- docker/Dockerfile | 6 +++--- docker/version.sh | 4 ++-- modules/bag/src/writer.cpp | 1 - modules/bag/tests/tests.cpp | 6 ++++-- modules/cli/examples/example.cpp | 1 + .../include/hephaestus/cli/program_options.h | 20 +++++++++---------- modules/cli/src/program_options.cpp | 8 ++++---- modules/cli/tests/program_options_tests.cpp | 1 + .../examples/blocking_queue_example.cpp | 1 - modules/examples/examples/mcap_reader.cpp | 1 + modules/examples/examples/mcap_writer.cpp | 3 ++- modules/examples/examples/serdes_examples.cpp | 5 ++--- .../examples/examples/zenoh_action_server.cpp | 1 + .../examples/zenoh_action_server_client.cpp | 1 + .../examples/examples/zenoh_program_options.h | 8 ++++---- modules/examples/examples/zenoh_pub.cpp | 6 ++---- .../examples/zenoh_service_client.cpp | 3 ++- .../examples/zenoh_service_server.cpp | 3 +-- .../examples/zenoh_string_service_client.cpp | 1 + .../examples/zenoh_string_service_server.cpp | 1 - modules/examples/examples/zenoh_sub.cpp | 1 - .../include/hephaestus/ipc/program_options.h | 4 ++-- .../include/hephaestus/ipc/topic_database.h | 4 ++-- .../ipc/zenoh/action_server/action_server.h | 4 ++-- .../src/zenoh/action_server/action_server.cpp | 1 + modules/ipc/src/zenoh/liveliness.cpp | 1 + modules/ipc/src/zenoh/publisher.cpp | 4 ++-- modules/ipc/src/zenoh/scout.cpp | 7 ++++--- .../random/random_number_generator.h | 4 ++-- .../hephaestus/random/random_object_creator.h | 4 ++-- .../serdes/protobuf/dynamic_deserializer.h | 4 ++-- .../src/protobuf/dynamic_deserializer.cpp | 4 ++-- .../hephaestus/telemetry/metric_record.h | 4 ++-- .../telemetry/telemetry/src/metric_record.cpp | 2 -- .../examples/influxdb_measure_example.cpp | 1 + .../src/influxdb_metric_sink.cpp | 2 -- modules/types/src/dummy_type.cpp | 6 ++++-- .../hephaestus/utils/filesystem/file.h | 4 ++-- modules/utils/tests/file_tests.cpp | 1 + modules/utils/tests/watchdog_tests.cpp | 1 + 40 files changed, 75 insertions(+), 69 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 54921447..320362fb 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -5,12 +5,12 @@ FROM ${BASE_IMAGE} ENV DEBIAN_FRONTEND=noninteractive RUN apt update && \ - apt install -y --no-install-recommends x11-apps g++ mesa-utils make cmake-curses-gui ninja-build git gdb vim htop \ + apt install -y --no-install-recommends x11-apps g++ mesa-utils make cmake-curses-gui ninja-build git gdb vim htop ssh \ curl zlib1g-dev libffi-dev libssl-dev libbz2-dev libsqlite3-dev iproute2 tk-dev texlive-latex-extra texlive-fonts-recommended dvipng cm-super libnotify-bin \ pkg-config gpg wget ca-certificates git-lfs curl ccache ninja-build doxygen graphviz linux-generic python3-dev python3-pip iproute2 python-is-python3 \ net-tools iftop htop lsb-release software-properties-common gnupg bash-completion psmisc less tree && \ rm -rf /var/lib/apt/lists/* -RUN python3 -m pip install cmakelang +RUN python3 -m pip install cmakelang six RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \ echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null && \ @@ -19,7 +19,7 @@ RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/nul apt install -y kitware-archive-keyring cmake && \ rm -rf /var/lib/apt/lists/* -ENV CLANG_VERSION=18 +ENV CLANG_VERSION=17 RUN wget https://apt.llvm.org/llvm.sh && \ sed -i "s/add-apt-repository \"${REPO_NAME}\"/add-apt-repository \"${REPO_NAME}\" -y/g" llvm.sh && \ chmod +x llvm.sh && \ diff --git a/docker/version.sh b/docker/version.sh index ae62cd0b..c7e263a0 100644 --- a/docker/version.sh +++ b/docker/version.sh @@ -1,6 +1,6 @@ HOST=ghcr.io/olympus-robotics -VERSION=1.0.7 +VERSION=1.0.9 IMAGE=hephaestus-dev # This is the version of the dep image. Increase this number everytime you change `external/CMakeLists.txt` -DEPS_VERSION=1.0.25 +DEPS_VERSION=1.0.26 diff --git a/modules/bag/src/writer.cpp b/modules/bag/src/writer.cpp index ea829939..1c6086f8 100644 --- a/modules/bag/src/writer.cpp +++ b/modules/bag/src/writer.cpp @@ -4,7 +4,6 @@ #include "hephaestus/bag/writer.h" -#include #include #include #include diff --git a/modules/bag/tests/tests.cpp b/modules/bag/tests/tests.cpp index 318400ec..d778c312 100644 --- a/modules/bag/tests/tests.cpp +++ b/modules/bag/tests/tests.cpp @@ -2,8 +2,10 @@ // Copyright (C) 2023-2024 HEPHAESTUS Contributors //================================================================================================= +#include #include #include +#include #include #include #include @@ -36,8 +38,8 @@ constexpr auto SENDER_ID = "bag_tester"; constexpr auto ROBOT_TOPIC = "robot"; constexpr auto FLEET_TOPIC = "fleet"; -[[nodiscard]] auto -createBag() -> std::tuple, std::vector> { +[[nodiscard]] auto createBag() + -> std::tuple, std::vector> { auto scoped_path = utils::filesystem::ScopedPath::createFile(); auto mcap_writer = createMcapWriter({ scoped_path }); diff --git a/modules/cli/examples/example.cpp b/modules/cli/examples/example.cpp index 931cfb10..0176adf5 100644 --- a/modules/cli/examples/example.cpp +++ b/modules/cli/examples/example.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include diff --git a/modules/cli/include/hephaestus/cli/program_options.h b/modules/cli/include/hephaestus/cli/program_options.h index 8e5cd31b..50f170ba 100644 --- a/modules/cli/include/hephaestus/cli/program_options.h +++ b/modules/cli/include/hephaestus/cli/program_options.h @@ -86,8 +86,8 @@ class ProgramDescription { /// @param description A brief text describing the option /// @return Reference to the object. Enables daisy-chained calls template - auto defineOption(const std::string& key, char short_key, - const std::string& description) -> ProgramDescription&; + auto defineOption(const std::string& key, char short_key, const std::string& description) + -> ProgramDescription&; /// @brief Defines a command line option (--key=value) that is optional /// @tparam T Value type @@ -96,8 +96,8 @@ class ProgramDescription { /// @param default_value Default value to use if the option is not specified on the command line /// @return Reference to the object. Enables daisy-chained calls template - auto defineOption(const std::string& key, const std::string& description, - const T& default_value) -> ProgramDescription&; + auto defineOption(const std::string& key, const std::string& description, const T& default_value) + -> ProgramDescription&; /// @brief Defines a command line option (--key=value) that is optional /// @tparam T Value type @@ -116,8 +116,8 @@ class ProgramDescription { /// @param short_key Single char (can be used as alias for --key) /// @param description A brief text describing the option /// @return Reference to the object. Enables daisy-chained calls - auto defineFlag(const std::string& key, char short_key, - const std::string& description) -> ProgramDescription&; + auto defineFlag(const std::string& key, char short_key, const std::string& description) + -> ProgramDescription&; /// @brief Defines a boolean option (flag) (--key=value) on the command line. If the flag is /// passed the value of the option is true, false otherwise. @@ -156,14 +156,14 @@ class ProgramDescription { }; template -auto ProgramDescription::defineOption(const std::string& key, - const std::string& description) -> ProgramDescription& { +auto ProgramDescription::defineOption(const std::string& key, const std::string& description) + -> ProgramDescription& { return defineOption(key, '\0', description); } template -auto ProgramDescription::defineOption(const std::string& key, char short_key, - const std::string& description) -> ProgramDescription& { +auto ProgramDescription::defineOption(const std::string& key, char short_key, const std::string& description) + -> ProgramDescription& { checkOptionAlreadyExists(key, short_key); options_.emplace_back(key, short_key, description, utils::getTypeName(), "", true, false); diff --git a/modules/cli/src/program_options.cpp b/modules/cli/src/program_options.cpp index e0d6ffa3..f8947e4e 100644 --- a/modules/cli/src/program_options.cpp +++ b/modules/cli/src/program_options.cpp @@ -57,16 +57,16 @@ void ProgramDescription::checkOptionAlreadyExists(const std::string& key, char k fmt::format("Attempted redefinition of short key '{}' for option '{}'", k, key)); } -auto ProgramDescription::defineFlag(const std::string& key, char short_key, - const std::string& description) -> ProgramDescription& { +auto ProgramDescription::defineFlag(const std::string& key, char short_key, const std::string& description) + -> ProgramDescription& { checkOptionAlreadyExists(key, short_key); options_.emplace_back(key, short_key, description, utils::getTypeName(), "false", false, false); return *this; } -auto ProgramDescription::defineFlag(const std::string& key, - const std::string& description) -> ProgramDescription& { +auto ProgramDescription::defineFlag(const std::string& key, const std::string& description) + -> ProgramDescription& { return defineFlag(key, '\0', description); } diff --git a/modules/cli/tests/program_options_tests.cpp b/modules/cli/tests/program_options_tests.cpp index a8145013..22605b44 100644 --- a/modules/cli/tests/program_options_tests.cpp +++ b/modules/cli/tests/program_options_tests.cpp @@ -1,6 +1,7 @@ //================================================================================================= // Copyright (C) 2023-2024 HEPHAESTUS Contributors //================================================================================================= +#include #include #include diff --git a/modules/containers/examples/blocking_queue_example.cpp b/modules/containers/examples/blocking_queue_example.cpp index 2a197dc4..b7277bc5 100644 --- a/modules/containers/examples/blocking_queue_example.cpp +++ b/modules/containers/examples/blocking_queue_example.cpp @@ -2,7 +2,6 @@ // Copyright (C) 2023-2024 HEPHAESTUS Contributors //================================================================================================= -#include #include #include #include diff --git a/modules/examples/examples/mcap_reader.cpp b/modules/examples/examples/mcap_reader.cpp index c05246e9..88eaaf19 100644 --- a/modules/examples/examples/mcap_reader.cpp +++ b/modules/examples/examples/mcap_reader.cpp @@ -2,6 +2,7 @@ // Copyright (C) 2023-2024 HEPHAESTUS Contributors //================================================================================================= +#include #include #include #include diff --git a/modules/examples/examples/mcap_writer.cpp b/modules/examples/examples/mcap_writer.cpp index a0dd16c9..9a3b33a0 100644 --- a/modules/examples/examples/mcap_writer.cpp +++ b/modules/examples/examples/mcap_writer.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -39,7 +40,7 @@ auto main(int argc, const char* argv[]) -> int { auto frame_time = start_time + i * INTERVAL; heph::examples::types::Pose pose; - pose.position = Eigen::Vector3d{ static_cast(i), 2, 3 }; + pose.position = Eigen::Vector3d{ static_cast(i), 2, 3 }; // NOLINT const auto data = heph::serdes::serialize(pose); const heph::ipc::MessageMetadata metadata{ .sender_id = "myself", .topic = "pose", .timestamp = frame_time, .sequence_id = i diff --git a/modules/examples/examples/serdes_examples.cpp b/modules/examples/examples/serdes_examples.cpp index 936b6bdb..44c8bf24 100644 --- a/modules/examples/examples/serdes_examples.cpp +++ b/modules/examples/examples/serdes_examples.cpp @@ -17,9 +17,8 @@ auto main(int argc, const char* argv[]) -> int { (void)argv; try { heph::examples::types::Pose pose; - pose.position = Eigen::Vector3d{ 1, 2, 3 }; - pose.orientation = - Eigen::Quaterniond{ 1., 0.1, 0.2, 0.3 }; // NOLINT(cppcoreguidelines-avoid-magic-numbers) + pose.position = Eigen::Vector3d{ 1, 2, 3 }; // NOLINT + pose.orientation = Eigen::Quaterniond{ 1., 0.1, 0.2, 0.3 }; // NOLINT const auto json_string = heph::serdes::serializeToJSON(pose); fmt::print("Pose serialized to JSON:\n{}\n", json_string); diff --git a/modules/examples/examples/zenoh_action_server.cpp b/modules/examples/examples/zenoh_action_server.cpp index aa58b012..5da926fa 100644 --- a/modules/examples/examples/zenoh_action_server.cpp +++ b/modules/examples/examples/zenoh_action_server.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include diff --git a/modules/examples/examples/zenoh_action_server_client.cpp b/modules/examples/examples/zenoh_action_server_client.cpp index 699a844e..c1de01f8 100644 --- a/modules/examples/examples/zenoh_action_server_client.cpp +++ b/modules/examples/examples/zenoh_action_server_client.cpp @@ -3,6 +3,7 @@ //================================================================================================= #include +#include #include #include #include diff --git a/modules/examples/examples/zenoh_program_options.h b/modules/examples/examples/zenoh_program_options.h index 0966e503..cb5589c5 100644 --- a/modules/examples/examples/zenoh_program_options.h +++ b/modules/examples/examples/zenoh_program_options.h @@ -8,8 +8,8 @@ enum class ExampleType : uint8_t { PUBSUB, SERVICE, ACTION_SERVER }; -[[nodiscard]] inline auto getProgramDescription(const std::string& description, - const ExampleType type) -> heph::cli::ProgramDescription { +[[nodiscard]] inline auto getProgramDescription(const std::string& description, const ExampleType type) + -> heph::cli::ProgramDescription { static constexpr auto DEFAULT_PUBSUB_KEY = "hephaestus/ipc/example/zenoh/put"; static constexpr auto DEFAULT_SERVICE_KEY = "hephaestus/ipc/example/zenoh/service"; static constexpr auto DEFAULT_ACTION_SERVER_KEY = "hephaestus/ipc/example/zenoh/action_server"; @@ -38,8 +38,8 @@ enum class ExampleType : uint8_t { PUBSUB, SERVICE, ACTION_SERVER }; return desc; } -[[nodiscard]] inline auto -parseArgs(const heph::cli::ProgramOptions& args) -> std::pair { +[[nodiscard]] inline auto parseArgs(const heph::cli::ProgramOptions& args) + -> std::pair { heph::ipc::TopicConfig topic_config{ .name = args.getOption("topic") }; heph::ipc::Config config; diff --git a/modules/examples/examples/zenoh_pub.cpp b/modules/examples/examples/zenoh_pub.cpp index 387d05e8..764292d3 100644 --- a/modules/examples/examples/zenoh_pub.cpp +++ b/modules/examples/examples/zenoh_pub.cpp @@ -3,7 +3,6 @@ //================================================================================================= #include -#include #include #include #include @@ -47,9 +46,8 @@ auto main(int argc, const char* argv[]) -> int { double count = 0; while (!heph::utils::TerminationBlocker::stopRequested()) { heph::examples::types::Pose pose; - pose.position = Eigen::Vector3d{ 1, 2, count++ }; - pose.orientation = - Eigen::Quaterniond{ 1., 0.1, 0.2, 0.3 }; // NOLINT(cppcoreguidelines-avoid-magic-numbers) + pose.position = Eigen::Vector3d{ 1, 2, count++ }; // NOLINT + pose.orientation = Eigen::Quaterniond{ 1., 0.1, 0.2, 0.3 }; // NOLINT fmt::println("Publishing Data ('{} : {})", topic_config.name, pose); auto res = publisher.publish(pose); diff --git a/modules/examples/examples/zenoh_service_client.cpp b/modules/examples/examples/zenoh_service_client.cpp index 15998894..5adb79bf 100644 --- a/modules/examples/examples/zenoh_service_client.cpp +++ b/modules/examples/examples/zenoh_service_client.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -34,7 +35,7 @@ auto main(int argc, const char* argv[]) -> int { static constexpr auto K_TIMEOUT = std::chrono::seconds(10); const auto query = heph::examples::types::Pose{ .orientation = Eigen::Quaterniond{ 1., 0.3, 0.2, 0.1 }, // NOLINT - .position = Eigen::Vector3d{ 3, 2, 1 } }; + .position = Eigen::Vector3d{ 3, 2, 1 } }; // NOLINT LOG(INFO) << fmt::format("Calling service on topic: {} with {}.", topic_config.name, query); const auto replies = heph::ipc::zenoh::callService( diff --git a/modules/examples/examples/zenoh_service_server.cpp b/modules/examples/examples/zenoh_service_server.cpp index 8fd75634..33b0ddeb 100644 --- a/modules/examples/examples/zenoh_service_server.cpp +++ b/modules/examples/examples/zenoh_service_server.cpp @@ -2,7 +2,6 @@ // Copyright (C) 2023-2024 HEPHAESTUS Contributors //================================================================================================= -#include #include #include #include @@ -34,7 +33,7 @@ auto main(int argc, const char* argv[]) -> int { LOG(INFO) << fmt::format("Received query: {}", sample); heph::examples::types::Pose sample_reply{ .orientation = Eigen::Quaterniond{ 1., 0.1, 0.2, 0.3 }, // NOLINT - .position = Eigen::Vector3d{ 1, 2, 3 }, + .position = Eigen::Vector3d{ 1, 2, 3 }, // NOLINT }; return sample_reply; }; diff --git a/modules/examples/examples/zenoh_string_service_client.cpp b/modules/examples/examples/zenoh_string_service_client.cpp index 925ab065..e386eb16 100644 --- a/modules/examples/examples/zenoh_string_service_client.cpp +++ b/modules/examples/examples/zenoh_string_service_client.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/modules/examples/examples/zenoh_string_service_server.cpp b/modules/examples/examples/zenoh_string_service_server.cpp index 01aa03ac..555372f9 100644 --- a/modules/examples/examples/zenoh_string_service_server.cpp +++ b/modules/examples/examples/zenoh_string_service_server.cpp @@ -2,7 +2,6 @@ // Copyright (C) 2023-2024 HEPHAESTUS Contributors //================================================================================================= -#include #include #include #include diff --git a/modules/examples/examples/zenoh_sub.cpp b/modules/examples/examples/zenoh_sub.cpp index 386b4323..62dbdbb1 100644 --- a/modules/examples/examples/zenoh_sub.cpp +++ b/modules/examples/examples/zenoh_sub.cpp @@ -3,7 +3,6 @@ //================================================================================================= #include -#include #include #include #include diff --git a/modules/ipc/include/hephaestus/ipc/program_options.h b/modules/ipc/include/hephaestus/ipc/program_options.h index cd2eba8b..501d5b73 100644 --- a/modules/ipc/include/hephaestus/ipc/program_options.h +++ b/modules/ipc/include/hephaestus/ipc/program_options.h @@ -10,7 +10,7 @@ namespace heph::ipc { void appendIPCProgramOption(cli::ProgramDescription& program_description); -[[nodiscard]] auto -parseIPCProgramOptions(const heph::cli::ProgramOptions& args) -> std::pair; +[[nodiscard]] auto parseIPCProgramOptions(const heph::cli::ProgramOptions& args) + -> std::pair; } // namespace heph::ipc diff --git a/modules/ipc/include/hephaestus/ipc/topic_database.h b/modules/ipc/include/hephaestus/ipc/topic_database.h index f09f736b..3cf3d17d 100644 --- a/modules/ipc/include/hephaestus/ipc/topic_database.h +++ b/modules/ipc/include/hephaestus/ipc/topic_database.h @@ -22,7 +22,7 @@ namespace zenoh { struct Session; } -[[nodiscard]] auto -createZenohTopicDatabase(std::shared_ptr session) -> std::unique_ptr; +[[nodiscard]] auto createZenohTopicDatabase(std::shared_ptr session) + -> std::unique_ptr; } // namespace heph::ipc diff --git a/modules/ipc/include/hephaestus/ipc/zenoh/action_server/action_server.h b/modules/ipc/include/hephaestus/ipc/zenoh/action_server/action_server.h index 1f14b195..bfd1bd8f 100644 --- a/modules/ipc/include/hephaestus/ipc/zenoh/action_server/action_server.h +++ b/modules/ipc/include/hephaestus/ipc/zenoh/action_server/action_server.h @@ -109,8 +109,8 @@ template -> std::future>; /// Request the action server to stop. -[[nodiscard]] auto requestActionServerToStopExecution(Session& session, - const TopicConfig& topic_config) -> bool; +[[nodiscard]] auto requestActionServerToStopExecution(Session& session, const TopicConfig& topic_config) + -> bool; // TODO: add a function to get notified when the server is idle again. diff --git a/modules/ipc/src/zenoh/action_server/action_server.cpp b/modules/ipc/src/zenoh/action_server/action_server.cpp index 1404b78f..b231c3fa 100644 --- a/modules/ipc/src/zenoh/action_server/action_server.cpp +++ b/modules/ipc/src/zenoh/action_server/action_server.cpp @@ -4,6 +4,7 @@ #include "hephaestus/ipc/zenoh/action_server/action_server.h" +#include #include #include diff --git a/modules/ipc/src/zenoh/liveliness.cpp b/modules/ipc/src/zenoh/liveliness.cpp index 458ad629..da4262c0 100644 --- a/modules/ipc/src/zenoh/liveliness.cpp +++ b/modules/ipc/src/zenoh/liveliness.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "hephaestus/ipc/common.h" diff --git a/modules/ipc/src/zenoh/publisher.cpp b/modules/ipc/src/zenoh/publisher.cpp index 85710c0d..6643c66a 100644 --- a/modules/ipc/src/zenoh/publisher.cpp +++ b/modules/ipc/src/zenoh/publisher.cpp @@ -41,8 +41,8 @@ inline void zenohOnMatchingStatus(const ::zc_matching_status_t* matching_status, } template -[[nodiscard]] auto createZenohcClosureMatchingStatus(C&& on_matching_status, - D&& on_drop) -> zc_owned_closure_matching_status_t { +[[nodiscard]] auto createZenohcClosureMatchingStatus(C&& on_matching_status, D&& on_drop) + -> zc_owned_closure_matching_status_t { zc_owned_closure_matching_status_t c_closure; using Cval = std::remove_reference_t; using Dval = std::remove_reference_t; diff --git a/modules/ipc/src/zenoh/scout.cpp b/modules/ipc/src/zenoh/scout.cpp index 1dcb5d32..c81f4e3f 100644 --- a/modules/ipc/src/zenoh/scout.cpp +++ b/modules/ipc/src/zenoh/scout.cpp @@ -32,8 +32,8 @@ namespace heph::ipc::zenoh { namespace { -[[nodiscard]] inline auto -toStringVector(const std::vector& str_vec) -> std::vector { +[[nodiscard]] inline auto toStringVector(const std::vector& str_vec) + -> std::vector { std::vector output_vec; output_vec.reserve(str_vec.size()); for (const auto& str : str_vec) { @@ -102,7 +102,8 @@ auto getListOfNodes() -> std::vector { ScoutDataManager manager; auto config = ::zenoh::Config::create_default(); - ::zenoh::scout(std::move(config), [&manager](const auto& hello) { manager.onDiscovery(hello); }, []() {}); + ::zenoh::scout( + std::move(config), [&manager](const auto& hello) { manager.onDiscovery(hello); }, []() {}); auto nodes = manager.getNodesInfo(); diff --git a/modules/random/include/hephaestus/random/random_number_generator.h b/modules/random/include/hephaestus/random/random_number_generator.h index ff94dad2..2b947ebc 100644 --- a/modules/random/include/hephaestus/random/random_number_generator.h +++ b/modules/random/include/hephaestus/random/random_number_generator.h @@ -15,8 +15,8 @@ static constexpr bool IS_DETERMINISTIC = false; /// \brief Returns a random number generator (RNG) which is preconfigured to be deterministic or not. /// 'is_deterministic' is exposed for unit testing, but shall in general not be set by the caller. -[[nodiscard]] auto -createRNG(bool is_deterministic = random_number_generator::IS_DETERMINISTIC) -> std::mt19937_64; +[[nodiscard]] auto createRNG(bool is_deterministic = random_number_generator::IS_DETERMINISTIC) + -> std::mt19937_64; /// \brief Returns a pair (but not a copy) of identical random number generators (RNG) which are preconfigured /// to be deterministic, or not. This is useful for testing functions which require two random number diff --git a/modules/random/include/hephaestus/random/random_object_creator.h b/modules/random/include/hephaestus/random/random_object_creator.h index 919a8faf..74b48d51 100644 --- a/modules/random/include/hephaestus/random/random_object_creator.h +++ b/modules/random/include/hephaestus/random/random_object_creator.h @@ -134,8 +134,8 @@ concept IsRandomCreatable = requires(std::mt19937_64& mt) { // Internal helper functions for container types //================================================================================================= namespace internal { -[[nodiscard]] inline auto getSize(std::mt19937_64& mt, std::optional fixed_size, - bool allow_empty) -> size_t { +[[nodiscard]] inline auto getSize(std::mt19937_64& mt, std::optional fixed_size, bool allow_empty) + -> size_t { if (fixed_size.has_value()) { throwExceptionIf( allow_empty == false && fixed_size.value() == 0, diff --git a/modules/serdes/include/hephaestus/serdes/protobuf/dynamic_deserializer.h b/modules/serdes/include/hephaestus/serdes/protobuf/dynamic_deserializer.h index d641cf1b..5e4f28b4 100644 --- a/modules/serdes/include/hephaestus/serdes/protobuf/dynamic_deserializer.h +++ b/modules/serdes/include/hephaestus/serdes/protobuf/dynamic_deserializer.h @@ -23,8 +23,8 @@ class DynamicDeserializer { [[nodiscard]] auto toText(const std::string& type, std::span data) -> std::string; private: - [[nodiscard]] auto getMessage(const std::string& type, - std::span data) -> google::protobuf::Message*; + [[nodiscard]] auto getMessage(const std::string& type, std::span data) + -> google::protobuf::Message*; private: google::protobuf::SimpleDescriptorDatabase proto_db_; diff --git a/modules/serdes/src/protobuf/dynamic_deserializer.cpp b/modules/serdes/src/protobuf/dynamic_deserializer.cpp index 5acf1049..0322a0db 100644 --- a/modules/serdes/src/protobuf/dynamic_deserializer.cpp +++ b/modules/serdes/src/protobuf/dynamic_deserializer.cpp @@ -76,8 +76,8 @@ auto DynamicDeserializer::toText(const std::string& type, std::span data) -> google::protobuf::Message* { +auto DynamicDeserializer::getMessage(const std::string& type, std::span data) + -> google::protobuf::Message* { const auto* descriptor = proto_pool_.FindMessageTypeByName(type); throwExceptionIf( descriptor == nullptr, diff --git a/modules/telemetry/telemetry/include/hephaestus/telemetry/metric_record.h b/modules/telemetry/telemetry/include/hephaestus/telemetry/metric_record.h index 627c711c..4991aa19 100644 --- a/modules/telemetry/telemetry/include/hephaestus/telemetry/metric_record.h +++ b/modules/telemetry/telemetry/include/hephaestus/telemetry/metric_record.h @@ -10,8 +10,8 @@ namespace heph::telemetry { namespace internal { -[[nodiscard]] auto -jsonToValuesMap(std::string_view json) -> std::unordered_map; +[[nodiscard]] auto jsonToValuesMap(std::string_view json) + -> std::unordered_map; } /// @brief Register a new metric sink. diff --git a/modules/telemetry/telemetry/src/metric_record.cpp b/modules/telemetry/telemetry/src/metric_record.cpp index 2dcee1c1..86e73acb 100644 --- a/modules/telemetry/telemetry/src/metric_record.cpp +++ b/modules/telemetry/telemetry/src/metric_record.cpp @@ -3,9 +3,7 @@ //================================================================================================= #include "hephaestus/telemetry/metric_record.h" -#include #include -#include #include #include #include diff --git a/modules/telemetry/telemetry_influxdb_sink/examples/influxdb_measure_example.cpp b/modules/telemetry/telemetry_influxdb_sink/examples/influxdb_measure_example.cpp index 2893bf54..dd0b01e7 100644 --- a/modules/telemetry/telemetry_influxdb_sink/examples/influxdb_measure_example.cpp +++ b/modules/telemetry/telemetry_influxdb_sink/examples/influxdb_measure_example.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include diff --git a/modules/telemetry/telemetry_influxdb_sink/src/influxdb_metric_sink.cpp b/modules/telemetry/telemetry_influxdb_sink/src/influxdb_metric_sink.cpp index 47f2bb05..86aa8638 100644 --- a/modules/telemetry/telemetry_influxdb_sink/src/influxdb_metric_sink.cpp +++ b/modules/telemetry/telemetry_influxdb_sink/src/influxdb_metric_sink.cpp @@ -4,9 +4,7 @@ #include "hephaestus/telemetry_influxdb_sink/influxdb_metric_sink.h" -#include #include -#include #include #include #include diff --git a/modules/types/src/dummy_type.cpp b/modules/types/src/dummy_type.cpp index 474fc2a8..2ef93e47 100644 --- a/modules/types/src/dummy_type.cpp +++ b/modules/types/src/dummy_type.cpp @@ -30,7 +30,8 @@ auto DummyPrimitivesType::random(std::mt19937_64& mt) -> DummyPrimitivesType { } auto operator<<(std::ostream& os, const DummyPrimitivesType& dummy_primitives_type) -> std::ostream& { - return os << "DummyPrimitivesType{" << " dummy_bool=" << dummy_primitives_type.dummy_bool << "\n" + return os << "DummyPrimitivesType{" + << " dummy_bool=" << dummy_primitives_type.dummy_bool << "\n" << " dummy_int8_t=" << dummy_primitives_type.dummy_int8_t << "\n" << " dummy_int16_t=" << dummy_primitives_type.dummy_int16_t << "\n" << " dummy_int32_t=" << dummy_primitives_type.dummy_int32_t << "\n" @@ -54,7 +55,8 @@ auto DummyType::random(std::mt19937_64& mt) -> DummyType { } auto operator<<(std::ostream& os, const DummyType& dummy_type) -> std::ostream& { - return os << "DummyType{" << " dummy_primitives_type={" << dummy_type.dummy_primitives_type << "}\n" + return os << "DummyType{" + << " dummy_primitives_type={" << dummy_type.dummy_primitives_type << "}\n" << " dummy_enum=" << magic_enum::enum_name(dummy_type.dummy_enum) << "\n" << " dummy_timestamp_system_clock=" << toString(dummy_type.dummy_timestamp_system_clock) << "\n" << " dummy_timestamp_steady_clock=" << toString(dummy_type.dummy_timestamp_steady_clock) << "\n" diff --git a/modules/utils/include/hephaestus/utils/filesystem/file.h b/modules/utils/include/hephaestus/utils/filesystem/file.h index bc994326..93d42a5d 100644 --- a/modules/utils/include/hephaestus/utils/filesystem/file.h +++ b/modules/utils/include/hephaestus/utils/filesystem/file.h @@ -19,8 +19,8 @@ namespace heph::utils::filesystem { [[nodiscard]] auto readBinaryFile(const std::filesystem::path& path) -> std::optional>; [[nodiscard]] auto writeStringToFile(const std::filesystem::path& path, std::string_view content) -> bool; -[[nodiscard]] auto writeBufferToFile(const std::filesystem::path& path, - std::span content) -> bool; +[[nodiscard]] auto writeBufferToFile(const std::filesystem::path& path, std::span content) + -> bool; [[nodiscard]] auto searchFilenameInPaths(const std::string& filename, const std::vector& paths) diff --git a/modules/utils/tests/file_tests.cpp b/modules/utils/tests/file_tests.cpp index 0390c03e..a8c2c5c3 100644 --- a/modules/utils/tests/file_tests.cpp +++ b/modules/utils/tests/file_tests.cpp @@ -3,6 +3,7 @@ //================================================================================================= #include #include +#include #include #include diff --git a/modules/utils/tests/watchdog_tests.cpp b/modules/utils/tests/watchdog_tests.cpp index b0c03de5..7c28b22c 100644 --- a/modules/utils/tests/watchdog_tests.cpp +++ b/modules/utils/tests/watchdog_tests.cpp @@ -2,6 +2,7 @@ // Copyright (C) 2023-2024 HEPHAESTUS Contributors //================================================================================================= #include +#include #include #include