From a251a3eac5e0a16d6d6eab43c0b1ab72b5d5df2c Mon Sep 17 00:00:00 2001 From: Mario Dominguez Date: Fri, 7 Jun 2024 11:54:46 +0200 Subject: [PATCH] Refs #21095: Linter all except from types Signed-off-by: Mario Dominguez --- examples/cpp/discovery_server/CLIParser.hpp | 19 ++++++++++--------- examples/cpp/discovery_server/ServerApp.cpp | 16 +++++++++------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/examples/cpp/discovery_server/CLIParser.hpp b/examples/cpp/discovery_server/CLIParser.hpp index e8b938fe236..ce7eff6c45d 100644 --- a/examples/cpp/discovery_server/CLIParser.hpp +++ b/examples/cpp/discovery_server/CLIParser.hpp @@ -75,21 +75,21 @@ class CLIParser //! Publisher client configuration structure struct client_publisher_config : public common_config, - public pubsub_config + public pubsub_config { uint16_t interval{100}; }; //! Subscriber client configuration structure struct client_subscriber_config : public common_config, - public pubsub_config + public pubsub_config { }; //! Server configuration structure //! A server can, in turn, act as a client struct server_config : public common_config, - public client_config + public client_config { bool is_also_client{false}; uint16_t listening_port{16166}; @@ -106,16 +106,16 @@ class CLIParser client_subscriber_config sub_config; server_config srv_config; - friend std::ostream& operator<< ( - std::ostream& os, - const ds_example_config& config) + friend std::ostream& operator << ( + std::ostream& os, + const ds_example_config& config) { os << "Entity: " << parse_entity_kind(config.entity) << std::endl; os << "Common options:" << std::endl; os << " Transport: " << static_cast(config.pub_config.transport_kind) << std::endl; if (config.entity != CLIParser::EntityKind::SERVER || - (config.entity == CLIParser::EntityKind::SERVER && config.srv_config.is_also_client)) + (config.entity == CLIParser::EntityKind::SERVER && config.srv_config.is_also_client)) { os << "Client options:" << std::endl; os << " Connection address: " << config.pub_config.connection_address << std::endl; @@ -147,6 +147,7 @@ class CLIParser return os; } + }; /** @@ -442,7 +443,7 @@ class CLIParser else { if (config.entity == CLIParser::EntityKind::CLIENT_PUBLISHER || - config.entity == CLIParser::EntityKind::CLIENT_SUBSCRIBER) + config.entity == CLIParser::EntityKind::CLIENT_SUBSCRIBER) { config.pub_config.samples = static_cast(input); config.sub_config.samples = static_cast(input); @@ -492,7 +493,7 @@ class CLIParser { int input = std::stoi(argv[i]); if (input < std::numeric_limits::min() || - input > std::numeric_limits::max()) + input > std::numeric_limits::max()) { throw std::out_of_range("interval argument out of range"); } diff --git a/examples/cpp/discovery_server/ServerApp.cpp b/examples/cpp/discovery_server/ServerApp.cpp index 7fc01e38cda..5c70cf825fe 100644 --- a/examples/cpp/discovery_server/ServerApp.cpp +++ b/examples/cpp/discovery_server/ServerApp.cpp @@ -247,10 +247,12 @@ void ServerApp::run() { bool timeout = false; cv_.wait_for(period_lock, std::chrono::seconds(timeout_), [&]() - { - timeout = ((std::chrono::steady_clock::now() - start_time_) >= std::chrono::milliseconds(timeout_ * 1000)); - return is_stopped() || timeout; - }); + { + timeout = + ((std::chrono::steady_clock::now() - start_time_) >= + std::chrono::milliseconds(timeout_ * 1000)); + return is_stopped() || timeout; + }); if (timeout) { @@ -260,9 +262,9 @@ void ServerApp::run() else { cv_.wait(period_lock, [&]() - { - return is_stopped(); - }); + { + return is_stopped(); + }); } } }