From f2323bb324126fa92b330ce58bffdf23fee3a7d6 Mon Sep 17 00:00:00 2001 From: Vittorio Romeo Date: Mon, 22 Dec 2025 15:21:14 +0100 Subject: [PATCH] Minor `#include` cleanup --- include/zenoh/api/base.hxx | 3 +-- include/zenoh/api/bytes.hxx | 9 ++++----- include/zenoh/api/channels.hxx | 8 +++++--- include/zenoh/api/config.hxx | 4 ++-- include/zenoh/api/encoding.hxx | 4 +++- include/zenoh/api/enums.hxx | 3 ++- include/zenoh/api/id.hxx | 3 +-- include/zenoh/api/keyexpr.hxx | 10 ++++++---- include/zenoh/api/logging.hxx | 5 ++++- include/zenoh/api/querier.hxx | 2 ++ include/zenoh/api/session.hxx | 2 ++ include/zenoh/detail/availability_checks.hxx | 1 - include/zenoh/detail/closures.hxx | 4 ++-- include/zenoh/detail/commons.hxx | 4 +++- 14 files changed, 37 insertions(+), 25 deletions(-) diff --git a/include/zenoh/api/base.hxx b/include/zenoh/api/base.hxx index 654e495f..4b2953f1 100644 --- a/include/zenoh/api/base.hxx +++ b/include/zenoh/api/base.hxx @@ -13,10 +13,9 @@ #pragma once -#include -#include #include #include +#include #include "../detail/availability_checks.hxx" #include "../zenohc.hxx" diff --git a/include/zenoh/api/bytes.hxx b/include/zenoh/api/bytes.hxx index d28effd2..c5527d2c 100644 --- a/include/zenoh/api/bytes.hxx +++ b/include/zenoh/api/bytes.hxx @@ -14,18 +14,17 @@ #pragma once #include "../detail/closures.hxx" -#include "../detail/commons.hxx" #include "base.hxx" -#include "closures.hxx" #include "interop.hxx" #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) #include "shm/buffer/buffer.hxx" #endif -#include #include #include #include +#include +#include #include namespace zenoh { @@ -81,10 +80,10 @@ class Bytes : public Owned<::z_owned_bytes_t> { } /// @brief Construct by copying sequence of charactes. - Bytes(const char* v) : Bytes(std::string_view(v)){}; + Bytes(const char* v) : Bytes(std::string_view(v)) {}; /// @brief Construct by copying sequence of charactes. - Bytes(const std::string& v) : Bytes(std::string_view(v)){}; + Bytes(const std::string& v) : Bytes(std::string_view(v)) {}; /// @brief Construct by moving a string. Bytes(std::string&& v) : Bytes() { diff --git a/include/zenoh/api/channels.hxx b/include/zenoh/api/channels.hxx index 364a755b..d2ed0413 100644 --- a/include/zenoh/api/channels.hxx +++ b/include/zenoh/api/channels.hxx @@ -16,6 +16,8 @@ // #pragma once + +#include #include #include "base.hxx" @@ -111,7 +113,7 @@ class FifoChannel; /// @tparam T data entry type. template class FifoHandler : public Owned::handler_type> { - FifoHandler(zenoh::detail::null_object_t) : Owned::handler_type>(nullptr){}; + FifoHandler(zenoh::detail::null_object_t) : Owned::handler_type>(nullptr) {}; public: /// @name Methods @@ -152,7 +154,7 @@ class RingChannel; /// @tparam T data entry type. template class RingHandler : public Owned::handler_type> { - RingHandler(zenoh::detail::null_object_t) : Owned::handler_type>(nullptr){}; + RingHandler(zenoh::detail::null_object_t) : Owned::handler_type>(nullptr) {}; public: /// @name Methods @@ -242,4 +244,4 @@ class RingChannel { } }; -} // namespace zenoh::channels \ No newline at end of file +} // namespace zenoh::channels diff --git a/include/zenoh/api/config.hxx b/include/zenoh/api/config.hxx index 7d2c50a4..14392aff 100644 --- a/include/zenoh/api/config.hxx +++ b/include/zenoh/api/config.hxx @@ -14,7 +14,7 @@ #pragma once #include -#include +#include #include "base.hxx" #include "interop.hxx" @@ -22,7 +22,7 @@ namespace zenoh { /// A Zenoh Session config. class Config : public Owned<::z_owned_config_t> { - Config(zenoh::detail::null_object_t) : Owned(nullptr){}; + Config(zenoh::detail::null_object_t) : Owned(nullptr) {}; public: /// @name Constructors diff --git a/include/zenoh/api/encoding.hxx b/include/zenoh/api/encoding.hxx index 68de3aa5..85f49fdc 100644 --- a/include/zenoh/api/encoding.hxx +++ b/include/zenoh/api/encoding.hxx @@ -12,7 +12,9 @@ // ZettaScale Zenoh Team, #pragma once + #include +#include #include "../zenohc.hxx" #include "base.hxx" @@ -360,4 +362,4 @@ class Encoding : public Owned<::z_owned_encoding_t> { }; #endif }; -} // namespace zenoh \ No newline at end of file +} // namespace zenoh diff --git a/include/zenoh/api/enums.hxx b/include/zenoh/api/enums.hxx index 10f9a071..276037ab 100644 --- a/include/zenoh/api/enums.hxx +++ b/include/zenoh/api/enums.hxx @@ -12,6 +12,7 @@ // ZettaScale Zenoh Team, #pragma once + #include #include "../zenohc.hxx" @@ -127,4 +128,4 @@ typedef ::z_locality_t Locality; typedef ::zc_reply_keyexpr_t ReplyKeyExpr; #endif -} // namespace zenoh \ No newline at end of file +} // namespace zenoh diff --git a/include/zenoh/api/id.hxx b/include/zenoh/api/id.hxx index f47ea56b..14b7b56a 100644 --- a/include/zenoh/api/id.hxx +++ b/include/zenoh/api/id.hxx @@ -14,7 +14,6 @@ #pragma once #include -#include #include #include @@ -62,4 +61,4 @@ inline std::ostream& operator<<(std::ostream& os, const Id& id) { ::z_drop(::z_move(s)); return os; } -} // namespace zenoh \ No newline at end of file +} // namespace zenoh diff --git a/include/zenoh/api/keyexpr.hxx b/include/zenoh/api/keyexpr.hxx index 997ca231..1f9e85c7 100644 --- a/include/zenoh/api/keyexpr.hxx +++ b/include/zenoh/api/keyexpr.hxx @@ -12,6 +12,8 @@ // ZettaScale Zenoh Team, #pragma once + +#include #include #include "../zenohc.hxx" @@ -27,7 +29,7 @@ namespace zenoh { /// when transporting key expressions. class KeyExpr : public Owned<::z_owned_keyexpr_t> { - KeyExpr(zenoh::detail::null_object_t) : Owned(nullptr){}; + KeyExpr(zenoh::detail::null_object_t) : Owned(nullptr) {}; friend struct interop::detail::Converter; public: @@ -57,7 +59,7 @@ class KeyExpr : public Owned<::z_owned_keyexpr_t> { /// @param err if not null, the result code will be written to this location, otherwise ZException exception will be /// thrown in case of error. KeyExpr(const std::string& key_expr, bool autocanonize = true, ZResult* err = nullptr) - : KeyExpr(static_cast(key_expr), autocanonize, err){}; + : KeyExpr(static_cast(key_expr), autocanonize, err) {}; /// @brief Create a new instance from a null-terminated string. /// @@ -66,7 +68,7 @@ class KeyExpr : public Owned<::z_owned_keyexpr_t> { /// @param err if not null, the result code will be written to this location, otherwise ZException exception will be /// thrown in case of error. KeyExpr(const char* key_expr, bool autocanonize = true, ZResult* err = nullptr) - : KeyExpr(std::string_view(key_expr), autocanonize, err){}; + : KeyExpr(std::string_view(key_expr), autocanonize, err) {}; /// @brief Copy constructor. KeyExpr(const KeyExpr& other) : KeyExpr(zenoh::detail::null_object) { @@ -208,4 +210,4 @@ class KeyExpr : public Owned<::z_owned_keyexpr_t> { KeyExpr& operator=(KeyExpr&& other) = default; }; -} // namespace zenoh \ No newline at end of file +} // namespace zenoh diff --git a/include/zenoh/api/logging.hxx b/include/zenoh/api/logging.hxx index b5b094dd..ff70a0a0 100644 --- a/include/zenoh/api/logging.hxx +++ b/include/zenoh/api/logging.hxx @@ -12,6 +12,9 @@ // ZettaScale Zenoh Team, #pragma once + +#include + #include "../zenohc.hxx" namespace zenoh { @@ -37,4 +40,4 @@ inline void init_log_from_env_or(const std::string& fallback_filter) { } #endif -} // namespace zenoh \ No newline at end of file +} // namespace zenoh diff --git a/include/zenoh/api/querier.hxx b/include/zenoh/api/querier.hxx index d9c3a3b1..40d4fa8e 100644 --- a/include/zenoh/api/querier.hxx +++ b/include/zenoh/api/querier.hxx @@ -18,7 +18,9 @@ #include "../detail/closures_concrete.hxx" #include "base.hxx" #include "bytes.hxx" +#if defined(Z_FEATURE_UNSTABLE_API) #include "cancellation.hxx" +#endif #include "encoding.hxx" #include "enums.hxx" #include "interop.hxx" diff --git a/include/zenoh/api/session.hxx b/include/zenoh/api/session.hxx index 2c56c8c2..9ccdaadb 100644 --- a/include/zenoh/api/session.hxx +++ b/include/zenoh/api/session.hxx @@ -40,7 +40,9 @@ #include "shm/client_storage/client_storage.hxx" #include "shm/provider/shm_provider.hxx" #endif +#if defined(Z_FEATURE_UNSTABLE_API) #include "cancellation.hxx" +#endif namespace zenoh { namespace ext { diff --git a/include/zenoh/detail/availability_checks.hxx b/include/zenoh/detail/availability_checks.hxx index f86f74bb..f840d74d 100644 --- a/include/zenoh/detail/availability_checks.hxx +++ b/include/zenoh/detail/availability_checks.hxx @@ -12,7 +12,6 @@ // ZettaScale Zenoh Team, #pragma once -#include #include #include "../zenohc.hxx" diff --git a/include/zenoh/detail/closures.hxx b/include/zenoh/detail/closures.hxx index 86f9ab6c..40a19b6e 100644 --- a/include/zenoh/detail/closures.hxx +++ b/include/zenoh/detail/closures.hxx @@ -20,7 +20,7 @@ namespace zenoh::detail::closures { struct IDroppable { virtual void drop() = 0; - virtual ~IDroppable(){}; + virtual ~IDroppable() {}; static void delete_from_context(void* context) { reinterpret_cast(context)->drop(); @@ -80,4 +80,4 @@ class Closure : public IClosure { } }; -} // namespace zenoh::detail::closures \ No newline at end of file +} // namespace zenoh::detail::closures diff --git a/include/zenoh/detail/commons.hxx b/include/zenoh/detail/commons.hxx index 2af1be5f..2a6dd4a3 100644 --- a/include/zenoh/detail/commons.hxx +++ b/include/zenoh/detail/commons.hxx @@ -14,6 +14,8 @@ // ZettaScale Zenoh Team, #include +#include +#include namespace zenoh::detail::commons { @@ -63,4 +65,4 @@ struct overloaded : Ts... { template overloaded(Ts...) -> overloaded; -} // namespace zenoh::detail::commons \ No newline at end of file +} // namespace zenoh::detail::commons