style: Unify style for all Doxygen comments (#3142)

This commit is contained in:
Ayaz Salikhov
2026-07-13 12:45:05 +01:00
committed by GitHub
parent 52d28f8389
commit 50f9bc2bea
52 changed files with 352 additions and 160 deletions

View File

@@ -23,24 +23,32 @@ public:
*/
class Action {
public:
/** @brief Run action. */
/**
* @brief Run action.
*/
struct Run {
std::string configPath; ///< Configuration file path.
bool useNgWebServer; ///< Whether to use a ng web server
};
/** @brief Exit action. */
/**
* @brief Exit action.
*/
struct Exit {
int exitCode; ///< Exit code.
};
/** @brief Migration action. */
/**
* @brief Migration action.
*/
struct Migrate {
std::string configPath;
MigrateSubCmd subCmd;
};
/** @brief Verify Config action. */
/**
* @brief Verify Config action.
*/
struct VerifyConfig {
std::string configPath;
};

View File

@@ -36,7 +36,8 @@ namespace cluster {
*/
class Backend {
public:
/** @brief Type representing cluster data result - either a vector of nodes or an error message
/**
* @brief Type representing cluster data result - either a vector of nodes or an error message
*/
using ClusterData = std::expected<std::vector<ClioNode>, std::string>;

View File

@@ -23,10 +23,14 @@ namespace cluster {
* This ensures at most one node in the cluster loads the cache at a time.
*/
class CacheLoaderDecider {
/** @brief Thread pool for spawning asynchronous tasks */
/**
* @brief Thread pool for spawning asynchronous tasks
*/
boost::asio::thread_pool& ctx_;
/** @brief Interface for controlling cache loading permission of this node */
/**
* @brief Interface for controlling cache loading permission of this node
*/
std::unique_ptr<data::LedgerCacheLoadingStateInterface> cacheLoadingState_;
public:

View File

@@ -18,14 +18,18 @@ namespace cluster {
* - Health status of cluster communication
*/
class Metrics {
/** @brief Gauge tracking the total number of nodes visible in the cluster */
/**
* @brief Gauge tracking the total number of nodes visible in the cluster
*/
util::prometheus::GaugeInt& nodesInClusterMetric_ = PrometheusService::gaugeInt(
"cluster_nodes_total_number",
{},
"Total number of nodes this node can detect in the cluster."
);
/** @brief Boolean metric indicating whether cluster communication is healthy */
/**
* @brief Boolean metric indicating whether cluster communication is healthy
*/
util::prometheus::Bool isHealthy_ = PrometheusService::boolMetric(
"cluster_communication_is_healthy",
{},

View File

@@ -66,10 +66,14 @@ public:
static constexpr std::chrono::steady_clock::duration kRecoveryTime = std::chrono::hours{1};
private:
/** @brief Thread pool for spawning asynchronous tasks */
/**
* @brief Thread pool for spawning asynchronous tasks
*/
boost::asio::thread_pool& ctx_;
/** @brief Interface for controlling the writer state of this node */
/**
* @brief Interface for controlling the writer state of this node
*/
std::unique_ptr<etl::WriterStateInterface> writerState_;
/**

View File

@@ -669,7 +669,9 @@ public:
boost::asio::yield_context yield
) const = 0;
/** @brief Return type for fetchClioNodesData() method */
/**
* @brief Return type for fetchClioNodesData() method
*/
using ClioNodesDataFetchResult =
std::expected<std::vector<std::pair<boost::uuids::uuid, std::string>>, std::string>;

View File

@@ -72,7 +72,7 @@ public:
*/
using DefaultCassandraFamily::DefaultCassandraFamily;
/*
/**
* @brief Move constructor is deleted because handle_ is shared by reference with executor
*/
BasicCassandraBackend(BasicCassandraBackend&&) = delete;

View File

@@ -286,5 +286,7 @@ uint256ToString(xrpl::uint256 const& input)
return {reinterpret_cast<char const*>(input.data()), xrpl::uint256::size()};
}
/** @brief The ripple epoch start timestamp. Midnight on 1st January 2000. */
/**
* @brief The ripple epoch start timestamp. Midnight on 1st January 2000.
*/
static constexpr std::uint32_t kRippleEpochStart = 946684800;

View File

@@ -29,7 +29,9 @@ namespace data {
*/
class LedgerCache : public LedgerCacheInterface {
public:
/** @brief An entry of the cache */
/**
* @brief An entry of the cache
*/
struct CacheEntry {
uint32_t seq = 0;
Blob blob;

View File

@@ -73,23 +73,33 @@ public:
*/
explicit LedgerCacheLoadingState(LedgerCacheInterface const& cache);
/** @copydoc LedgerCacheLoadingStateInterface::allowLoading() */
/**
* @copydoc LedgerCacheLoadingStateInterface::allowLoading()
*/
void
allowLoading() override;
/** @copydoc LedgerCacheLoadingStateInterface::isLoadingAllowed() */
/**
* @copydoc LedgerCacheLoadingStateInterface::isLoadingAllowed()
*/
[[nodiscard]] bool
isLoadingAllowed() const override;
/** @copydoc LedgerCacheLoadingStateInterface::waitForLoadingAllowed() */
/**
* @copydoc LedgerCacheLoadingStateInterface::waitForLoadingAllowed()
*/
void
waitForLoadingAllowed() const override;
/** @copydoc LedgerCacheLoadingStateInterface::isCurrentlyLoading() */
/**
* @copydoc LedgerCacheLoadingStateInterface::isCurrentlyLoading()
*/
[[nodiscard]] bool
isCurrentlyLoading() const override;
/** @copydoc LedgerCacheLoadingStateInterface::clone() */
/**
* @copydoc LedgerCacheLoadingStateInterface::clone()
*/
[[nodiscard]] std::unique_ptr<LedgerCacheLoadingStateInterface>
clone() const override;
};

View File

@@ -294,13 +294,19 @@ struct AmendmentKey {
{
}
/** @brief Conversion to string */
/**
* @brief Conversion to string
*/
operator std::string const&() const;
/** @brief Conversion to string_view */
/**
* @brief Conversion to string_view
*/
operator std::string_view() const;
/** @brief Conversion to uint256 */
/**
* @brief Conversion to uint256
*/
operator xrpl::uint256() const;
/**

View File

@@ -134,7 +134,7 @@ public:
LOG(log_.info()) << "Created (revamped) CassandraBackend";
}
/*
/**
* @brief Move constructor is deleted because handle_ is shared by reference with executor
*/
CassandraBackendFamily(CassandraBackendFamily&&) = delete;

View File

@@ -56,50 +56,78 @@ struct Settings {
std::string bundle; // no meaningful default
};
/** @brief Enables or disables cassandra driver logger */
/**
* @brief Enables or disables cassandra driver logger
*/
bool enableLog = false;
/** @brief Connect timeout specified in milliseconds */
/**
* @brief Connect timeout specified in milliseconds
*/
std::chrono::milliseconds connectionTimeout =
std::chrono::milliseconds{kDefaultConnectionTimeout};
/** @brief Request timeout specified in milliseconds */
/**
* @brief Request timeout specified in milliseconds
*/
std::chrono::milliseconds requestTimeout = std::chrono::milliseconds{0}; // no timeout at all
/** @brief Connection information; either ContactPoints or SecureConnectionBundle */
/**
* @brief Connection information; either ContactPoints or SecureConnectionBundle
*/
std::variant<ContactPoints, SecureConnectionBundle> connectionInfo = ContactPoints{};
/** @brief The number of threads for the driver to pool */
/**
* @brief The number of threads for the driver to pool
*/
uint32_t threads = std::thread::hardware_concurrency();
/** @brief The maximum number of outstanding write requests at any given moment */
/**
* @brief The maximum number of outstanding write requests at any given moment
*/
uint32_t maxWriteRequestsOutstanding = kDefaultMaxWriteRequestsOutstanding;
/** @brief The maximum number of outstanding read requests at any given moment */
/**
* @brief The maximum number of outstanding read requests at any given moment
*/
uint32_t maxReadRequestsOutstanding = kDefaultMaxReadRequestsOutstanding;
/** @brief The number of connection per host to always have active */
/**
* @brief The number of connection per host to always have active
*/
uint32_t coreConnectionsPerHost = 3u;
/** @brief Size of batches when writing */
/**
* @brief Size of batches when writing
*/
std::size_t writeBatchSize = kDefaultBatchSize;
/** @brief Provider to know if we are using scylladb or keyspace */
/**
* @brief Provider to know if we are using scylladb or keyspace
*/
Provider provider = kDefaultProvider;
/** @brief Size of the IO queue */
/**
* @brief Size of the IO queue
*/
std::optional<uint32_t> queueSizeIO =
std::nullopt; // NOLINT(readability-redundant-member-init)
/** @brief SSL certificate */
/**
* @brief SSL certificate
*/
std::optional<std::string> certificate =
std::nullopt; // NOLINT(readability-redundant-member-init)
/** @brief Username/login */
/**
* @brief Username/login
*/
std::optional<std::string> username =
std::nullopt; // NOLINT(readability-redundant-member-init)
/** @brief Password to match the `username` */
/**
* @brief Password to match the `username`
*/
std::optional<std::string> password =
std::nullopt; // NOLINT(readability-redundant-member-init)

View File

@@ -169,7 +169,7 @@ public:
*
* @param preparedStatement Statement to prepare and execute
* @param args Args to bind to the prepared statement
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
*/
template <typename... Args>
void
@@ -185,7 +185,7 @@ public:
* Retries forever with retry policy specified by @ref AsyncExecutor
*
* @param statement Statement to execute
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
*/
void
write(StatementType&& statement)
@@ -215,7 +215,7 @@ public:
* Retries forever with retry policy specified by @ref AsyncExecutor.
*
* @param statements Vector of statements to execute as a batch
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
*/
void
write(std::vector<StatementType>&& statements)
@@ -254,7 +254,7 @@ public:
* Retries forever with retry policy specified by @ref AsyncExecutor.
*
* @param statements Vector of statements to execute
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
*/
void
writeEach(std::vector<StatementType>&& statements)
@@ -272,7 +272,7 @@ public:
* @param token Completion token (yield_context)
* @param preparedStatement Statement to prepare and execute
* @param args Args to bind to the prepared statement
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
* @return ResultType or error wrapped in Expected
*/
template <typename... Args>
@@ -289,7 +289,7 @@ public:
*
* @param token Completion token (yield_context)
* @param statements Statements to execute in a batch
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
* @return ResultType or error wrapped in Expected
*/
[[maybe_unused]] ResultOrErrorType
@@ -346,7 +346,7 @@ public:
*
* @param token Completion token (yield_context)
* @param statement Statement to execute
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
* @return ResultType or error wrapped in Expected
*/
[[maybe_unused]] ResultOrErrorType
@@ -402,7 +402,7 @@ public:
*
* @param token Completion token (yield_context)
* @param statements Statements to execute
* @throw DatabaseTimeout on db error
* @throws DatabaseTimeout on db error
* @return Vector of results
*/
std::vector<ResultType>

View File

@@ -33,7 +33,9 @@ public:
FutureWithCallback(FutureWithCallback&&) = default;
private:
/** Wrapped in a unique_ptr so it can survive std::move :/ */
/**
* Wrapped in a unique_ptr so it can survive std::move :/
*/
FnPtrType cb_;
};

View File

@@ -13,43 +13,52 @@ namespace etl {
* @brief Settings for the cache loader
*/
struct CacheLoaderSettings {
/** @brief Ways to load the cache */
/**
* @brief Ways to load the cache
*/
enum class LoadStyle { ASYNC, SYNC, NONE };
/** @brief Settings for cache file operations */
/**
* @brief Settings for cache file operations
*/
struct CacheFileSettings {
std::string
path; /**< path to the file to load cache from on start and save cache to on shutdown */
uint32_t maxAge = 5000; /**< max difference between latest sequence in cache file and DB */
path; ///< path to the file to load cache from on start and save cache to on shutdown
uint32_t maxAge = 5000; ///< max difference between latest sequence in cache file and DB
auto
operator<=>(CacheFileSettings const&) const = default;
};
size_t numCacheDiffs = 32; /**< number of diffs to use to generate cursors */
size_t numCacheMarkers = 48; /**< number of markers to use at one time to traverse the ledger */
size_t cachePageFetchSize =
512; /**< number of ledger objects to fetch concurrently per marker */
size_t numThreads = 2; /**< number of threads to use for loading cache */
size_t numCacheCursorsFromDiff = 0; /**< number of cursors to fetch from diff */
size_t numCacheCursorsFromAccount = 0; /**< number of cursors to fetch from account_tx */
size_t numCacheDiffs = 32; ///< number of diffs to use to generate cursors
size_t numCacheMarkers = 48; ///< number of markers to use at one time to traverse the ledger
size_t cachePageFetchSize = 512; ///< number of ledger objects to fetch concurrently per marker
size_t numThreads = 2; ///< number of threads to use for loading cache
size_t numCacheCursorsFromDiff = 0; ///< number of cursors to fetch from diff
size_t numCacheCursorsFromAccount = 0; ///< number of cursors to fetch from account_tx
LoadStyle loadStyle = LoadStyle::ASYNC; /**< how to load the cache */
LoadStyle loadStyle = LoadStyle::ASYNC; ///< how to load the cache
std::optional<CacheFileSettings>
cacheFileSettings; /**< optional settings for cache file operations */
cacheFileSettings; ///< optional settings for cache file operations
auto
operator<=>(CacheLoaderSettings const&) const = default;
/** @returns True if the load style is SYNC; false otherwise */
/**
* @return True if the load style is SYNC; false otherwise
*/
[[nodiscard]] bool
isSync() const;
/** @returns True if the load style is ASYNC; false otherwise */
/**
* @return True if the load style is ASYNC; false otherwise
*/
[[nodiscard]] bool
isAsync() const;
/** @returns True if the cache is disabled; false otherwise */
/**
* @return True if the cache is disabled; false otherwise
*/
[[nodiscard]] bool
isDisabled() const;
};
@@ -58,7 +67,7 @@ struct CacheLoaderSettings {
* @brief Create a CacheLoaderSettings object from a Config object
*
* @param config The configuration object
* @returns The CacheLoaderSettings object
* @return The CacheLoaderSettings object
*/
[[nodiscard]] CacheLoaderSettings
makeCacheLoaderSettings(util::config::ClioConfigDefinition const& config);

View File

@@ -97,9 +97,9 @@ getNFTDataFromObj(std::uint32_t seq, std::string const& key, std::string const&
/**
* @brief Get the unique NFTs data from a vector of NFTsData happening in the same ledger. For
example, if a NFT has
* example, if a NFT has
* both accept offer and burn happening in the same ledger,we only keep the final state of the NFT.
*
* @param nfts The NFTs data to filter, happening in the same ledger
* @return The unique NFTs data
*/

View File

@@ -77,7 +77,9 @@ public:
[[nodiscard]] virtual boost::json::object
toJson() const = 0;
/** @return String representation of the source (for debug) */
/**
* @return String representation of the source (for debug)
*/
[[nodiscard]] virtual std::string
toString() const = 0;

View File

@@ -44,14 +44,18 @@ struct SystemState {
"Whether the process is in strict read-only mode"
);
/** @brief Whether the process is writing to the database. */
/**
* @brief Whether the process is writing to the database.
*/
util::prometheus::Bool isWriting = PrometheusService::boolMetric(
"etl_writing",
util::prometheus::Labels{},
"Whether the process is writing to the database"
);
/** @brief Shows whether ETL started monitor and ready to become a writer if needed */
/**
* @brief Shows whether ETL started monitor and ready to become a writer if needed
*/
std::atomic_bool etlStarted{false};
/**
@@ -61,8 +65,8 @@ struct SystemState {
* across components.
*/
enum class WriteCommand {
StartWriting, /**< Request to attempt taking over as the ETL writer */
StopWriting /**< Request to give up the ETL writer role (e.g., due to write conflict) */
StartWriting, ///< Request to attempt taking over as the ETL writer
StopWriting ///< Request to give up the ETL writer role (e.g., due to write conflict)
};
/**

View File

@@ -144,8 +144,7 @@ public:
*/
class WriterState : public WriterStateInterface {
private:
std::shared_ptr<SystemState>
systemState_; /**< @brief Shared system state for ETL coordination */
std::shared_ptr<SystemState> systemState_; ///< @brief Shared system state for ETL coordination
std::reference_wrapper<data::LedgerCacheInterface const> cache_;
/**
@@ -216,19 +215,27 @@ public:
[[nodiscard]] bool
isFallback() const override;
/** @copydoc WriterStateInterface::isFallbackRecovery */
/**
* @copydoc WriterStateInterface::isFallbackRecovery
*/
[[nodiscard]] bool
isFallbackRecovery() const override;
/** @copydoc WriterStateInterface::setFallbackRecovery */
/**
* @copydoc WriterStateInterface::setFallbackRecovery
*/
void
setFallbackRecovery(bool newValue) override;
/** @copydoc WriterStateInterface::isEtlStarted */
/**
* @copydoc WriterStateInterface::isEtlStarted
*/
[[nodiscard]] bool
isEtlStarted() const override;
/** @copydoc WriterStateInterface::isCacheFull */
/**
* @copydoc WriterStateInterface::isCacheFull
*/
[[nodiscard]] bool
isCacheFull() const override;

View File

@@ -143,7 +143,9 @@ public:
return res;
}
/** @return String representation of the source (for debug) */
/**
* @return String representation of the source (for debug)
*/
[[nodiscard]] std::string
toString() const final
{

View File

@@ -123,10 +123,10 @@ public:
* @brief The full table scanner settings.
*/
struct FullTableScannerSettings {
std::uint32_t ctxThreadsNum; /**< number of threads used in the execution context */
std::uint32_t jobsNum; /**< number of coroutines to run, it is the number of concurrent
database reads */
std::uint32_t cursorsPerJob; /**< number of cursors per coroutine */
std::uint32_t ctxThreadsNum; ///< number of threads used in the execution context
std::uint32_t jobsNum; ///< number of coroutines to run, it is the number of concurrent
///< database reads
std::uint32_t cursorsPerJob; ///< number of cursors per coroutine
};
/**

View File

@@ -116,23 +116,33 @@ public:
void
rpcFailedToForward(std::string const& method);
/** @brief Increments the global too busy counter. */
/**
* @brief Increments the global too busy counter.
*/
void
onTooBusy();
/** @brief Increments the global not ready counter. */
/**
* @brief Increments the global not ready counter.
*/
void
onNotReady();
/** @brief Increments the global bad syntax counter. */
/**
* @brief Increments the global bad syntax counter.
*/
void
onBadSyntax();
/** @brief Increments the global unknown command/method counter. */
/**
* @brief Increments the global unknown command/method counter.
*/
void
onUnknownCommand();
/** @brief Increments the global internal error counter. */
/**
* @brief Increments the global internal error counter.
*/
void
onInternalError();
@@ -145,11 +155,15 @@ public:
void
recordLedgerRequest(boost::json::object const& params, std::uint32_t currentLedgerSequence);
/** @return Uptime of this instance in seconds. */
/**
* @return Uptime of this instance in seconds.
*/
std::chrono::seconds
uptime() const;
/** @return A JSON report with current state of all counters for every method. */
/**
* @return A JSON report with current state of all counters for every method.
*/
boost::json::object
report() const;
};

View File

@@ -13,7 +13,9 @@
namespace rpc {
/** @brief Custom clio RPC Errors. */
/**
* @brief Custom clio RPC Errors.
*/
enum class ClioError {
// normal clio errors start with 5000
RpcMalformedCurrency = 5000,
@@ -43,14 +45,18 @@ enum class ClioError {
EtlInvalidResponse = 7003,
};
/** @brief Holds info about a particular @ref ClioError. */
/**
* @brief Holds info about a particular @ref ClioError.
*/
struct ClioErrorInfo {
ClioError const code;
std::string_view const error;
std::string_view const message;
};
/** @brief Clio uses compatible Rippled error codes for most RPC errors. */
/**
* @brief Clio uses compatible Rippled error codes for most RPC errors.
*/
using RippledError = xrpl::ErrorCodeI;
/**
@@ -61,7 +67,9 @@ using RippledError = xrpl::ErrorCodeI;
*/
using CombinedError = std::variant<RippledError, ClioError>;
/** @brief A status returned from any RPC handler. */
/**
* @brief A status returned from any RPC handler.
*/
struct Status {
CombinedError code = RippledError::RpcSuccess;
std::string error;
@@ -177,7 +185,9 @@ struct Status {
operator<<(std::ostream& stream, Status const& status);
};
/** @brief Warning codes that can be returned by clio. */
/**
* @brief Warning codes that can be returned by clio.
*/
// NOLINTNEXTLINE(cppcoreguidelines-use-enum-class)
enum WarningCode {
WarnUnknown = -1,
@@ -187,7 +197,9 @@ enum WarningCode {
WarnRpcDeprecated = 2004
};
/** @brief Holds information about a clio warning. */
/**
* @brief Holds information about a clio warning.
*/
struct WarningInfo {
constexpr WarningInfo() = default;
@@ -205,7 +217,9 @@ struct WarningInfo {
std::string_view const message = "unknown warning";
};
/** @brief Invalid parameters error. */
/**
* @brief Invalid parameters error.
*/
class InvalidParamsError : public std::exception {
std::string msg_;
@@ -231,7 +245,9 @@ public:
}
};
/** @brief Account not found error. */
/**
* @brief Account not found error.
*/
class AccountNotFoundError : public std::exception {
std::string account_;
@@ -257,7 +273,9 @@ public:
}
};
/** @brief A globally available @ref rpc::Status that represents a successful state. */
/**
* @brief A globally available @ref rpc::Status that represents a successful state.
*/
static Status gOk;
/**

View File

@@ -2,11 +2,17 @@
#include <xrpl/protocol/jss.h>
/** @brief Helper macro for borrowing from xrpl::jss static (J)son (S)trings. */
/**
* @brief Helper macro for borrowing from xrpl::jss static (J)son (S)trings.
*/
#define JS(x) xrpl::jss::x.cStr()
/** @brief Access the lower case copy of a static (J)son (S)tring. */
/**
* @brief Access the lower case copy of a static (J)son (S)tring.
*/
#define JSL(x) util::toLower(JS(x))
/** @brief Provides access to (SF)ield name (S)trings. */
/**
* @brief Provides access to (SF)ield name (S)trings.
*/
#define SFS(x) xrpl::x.jsonName.cStr()

View File

@@ -64,7 +64,9 @@
namespace rpc {
/** @brief Enum for NFT json manipulation */
/**
* @brief Enum for NFT json manipulation
*/
enum class NFTokenjson { ENABLE, DISABLE };
/**

View File

@@ -181,8 +181,9 @@ public:
private:
/**
* @brief Calls callback on the oracle ledger entry
If the oracle entry does not contains the price pair, search up to three previous metadata
objects. Stops early if the callback returns true.
*
* If the oracle entry does not contains the price pair, search up to three previous metadata
* objects. Stops early if the callback returns true.
*/
void
tracebackOracleObject(

View File

@@ -29,20 +29,20 @@ struct ChannelInstantiated;
* @brief Specifies the producer concurrency model for a Channel.
*/
enum class ProducerType {
Single, /**< Only one Sender can exist (non-copyable). Uses direct Guard ownership for zero
overhead. */
Multi /**< Multiple Senders can exist (copyable). Uses shared_ptr<Guard> for shared ownership.
*/
Single, ///< Only one Sender can exist (non-copyable).
///< Uses direct Guard ownership for zero overhead.
Multi ///< Multiple Senders can exist (copyable).
///< Uses shared_ptr<Guard> for shared ownership.
};
/**
* @brief Specifies the consumer concurrency model for a Channel.
*/
enum class ConsumerType {
Single, /**< Only one Receiver can exist (non-copyable). Uses direct Guard ownership for zero
overhead. */
Multi /**< Multiple Receivers can exist (copyable). Uses shared_ptr<Guard> for shared ownership.
*/
Single, ///< Only one Receiver can exist (non-copyable).
///< Uses direct Guard ownership for zero overhead.
Multi ///< Multiple Receivers can exist (copyable).
///< Uses shared_ptr<Guard> for shared ownership.
};
/**

View File

@@ -18,7 +18,7 @@ concept SomeNumberType = std::is_arithmetic_v<T> && !std::is_same_v<T, bool> &&
* @brief Checks that the list of given values contains no duplicates
*
* @param values The list of values to check
* @returns true if no duplicates exist; false otherwise
* @return true if no duplicates exist; false otherwise
*/
static consteval auto
hasNoDuplicates(auto&&... values)
@@ -33,7 +33,7 @@ hasNoDuplicates(auto&&... values)
* @brief Checks that the list of given type contains no duplicates
*
* @tparam Types The types to check
* @returns true if no duplicates exist; false otherwise
* @return true if no duplicates exist; false otherwise
*/
template <typename... Types>
constexpr bool

View File

@@ -169,9 +169,9 @@ class TagDecoratorFactory final {
* @brief Represents the type of tag decorator.
*/
enum class Type {
NONE, /**< No decoration and no tag */
UUID, /**< Tag based on `boost::uuids::uuid`, thread-safe via mutex */
UINT /**< atomic_uint64_t tag, thread-safe, lock-free */
NONE, ///< No decoration and no tag
UUID, ///< Tag based on `boost::uuids::uuid`, thread-safe via mutex
UINT ///< atomic_uint64_t tag, thread-safe, lock-free
};
Type type_; /*< The type of TagDecorator this factory produces */

View File

@@ -2,7 +2,9 @@
namespace util {
/** @brief used for compile time checking of unsupported types */
/**
* @brief used for compile time checking of unsupported types
*/
template <typename>
static constexpr bool Unsupported = false; // NOLINT(readability-identifier-naming)

View File

@@ -63,7 +63,7 @@ public:
* @brief Execute a function on the execution context
*
* @param fn The function to execute
* @returns A unstoppable operation that can be used to wait for the result
* @return A unstoppable operation that can be used to wait for the result
*/
[[nodiscard]] auto
execute(SomeHandlerWithoutStopToken auto&& fn)
@@ -87,7 +87,7 @@ public:
* @brief Execute a function on the execution context
*
* @param fn The function to execute
* @returns A stoppable operation that can be used to wait for the result
* @return A stoppable operation that can be used to wait for the result
*
* @note The function is expected to take a stop token
*/
@@ -116,7 +116,7 @@ public:
*
* @param fn The function to execute
* @param timeout The timeout after which the function should be cancelled
* @returns A stoppable operation that can be used to wait for the result
* @return A stoppable operation that can be used to wait for the result
*
* @note The function is expected to take a stop token
*/
@@ -146,7 +146,7 @@ public:
*
* @param delay The delay after which the function should be executed
* @param fn The function to execute
* @returns A stoppable operation that can be used to wait for the result
* @return A stoppable operation that can be used to wait for the result
*
* @note The function is expected to take a stop token
*/
@@ -176,7 +176,7 @@ public:
*
* @param delay The delay after which the function should be executed
* @param fn The function to execute
* @returns A stoppable operation that can be used to wait for the result
* @return A stoppable operation that can be used to wait for the result
*
* @note The function is expected to take a stop token and a boolean representing whether the
* scheduled operation got cancelled

View File

@@ -54,7 +54,7 @@ public:
/**
* @brief Check if stop is requested
*
* @returns true if stop is requested; false otherwise
* @return true if stop is requested; false otherwise
*/
[[nodiscard]] bool
isStopRequested() const noexcept
@@ -65,7 +65,7 @@ public:
/**
* @brief Check if stop is requested
*
* @returns true if stop is requested; false otherwise
* @return true if stop is requested; false otherwise
*/
[[nodiscard]]
operator bool() const noexcept
@@ -77,7 +77,7 @@ public:
* @brief Get the underlying boost::asio::yield_context
* @note ASSERTs if the stop token is not convertible to boost::asio::yield_context
*
* @returns The underlying boost::asio::yield_context
* @return The underlying boost::asio::yield_context
*/
[[nodiscard]]
operator boost::asio::yield_context() const

View File

@@ -177,7 +177,9 @@ public:
StoppableOperation&
operator=(StoppableOperation&&) = default;
/** @brief Requests the operation to stop */
/**
* @brief Requests the operation to stop
*/
void
requestStop() noexcept
{

View File

@@ -119,7 +119,9 @@ class BasicExecutionContext : public ExecutionContextTag {
/** @endcond */
public:
/** @brief Whether operations on this execution context are noexcept */
/**
* @brief Whether operations on this execution context are noexcept
*/
static constexpr bool kIsNoexcept = noexcept(ErrorHandlerType::wrap([](auto&) { throw 0; })) and
noexcept(ErrorHandlerType::catchAndAssert([] { throw 0; }));

View File

@@ -25,7 +25,9 @@ namespace util::config {
*/
struct ClioConfigDescription {
public:
/** @brief Struct to represent a key-value pair*/
/**
* @brief Struct to represent a key-value pair
*/
struct KV {
std::string_view key;
std::string_view value;

View File

@@ -15,7 +15,9 @@
namespace util::config {
/** @brief Json representation of config */
/**
* @brief Json representation of config
*/
class ConfigFileJson final : public ConfigFileInterface {
boost::json::object jsonObject_;

View File

@@ -8,7 +8,9 @@
namespace util::config {
/** @brief Displays the different errors when parsing user config */
/**
* @brief Displays the different errors when parsing user config
*/
struct Error {
/**
* @brief Constructs an Error with a custom error message.

View File

@@ -12,7 +12,9 @@
namespace util::config {
/** @brief Custom clio config types */
/**
* @brief Custom clio config types
*/
enum class ConfigType { Integer, String, Double, Boolean };
/**
@@ -25,7 +27,9 @@ enum class ConfigType { Integer, String, Double, Boolean };
std::ostream&
operator<<(std::ostream& stream, ConfigType type);
/** @brief Represents the supported Config Values */
/**
* @brief Represents the supported Config Values
*/
using Value = std::variant<int64_t, std::string, bool, double>;
/**

View File

@@ -20,7 +20,7 @@ namespace util::prometheus {
class MetricsFamily {
public:
static std::unique_ptr<MetricBuilderInterface>
defaultMetricBuilder; /**< The default metric builder */
defaultMetricBuilder; ///< The default metric builder
/**
* @brief Construct a new MetricsFamily object

View File

@@ -170,7 +170,7 @@ public:
static constexpr std::chrono::milliseconds kDefaultTimeout{
30000
}; /**< Default timeout for requests */
}; ///< Default timeout for requests
private:
std::expected<std::string, RequestError>

View File

@@ -72,7 +72,7 @@ public:
std::chrono::steady_clock::duration timeout = kDefaultTimeout
) = 0;
static constexpr std::chrono::seconds kDefaultTimeout{5}; /**< Default timeout for connecting */
static constexpr std::chrono::seconds kDefaultTimeout{5}; ///< Default timeout for connecting
};
using WsConnectionPtr = std::unique_ptr<WsConnection>;
@@ -169,7 +169,7 @@ public:
[[nodiscard]] std::expected<WsConnectionPtr, RequestError>
connect(boost::asio::yield_context yield) const;
static constexpr std::chrono::seconds kDefaultTimeout{5}; /**< Default timeout for connecting */
static constexpr std::chrono::seconds kDefaultTimeout{5}; ///< Default timeout for connecting
private:
template <typename StreamDataType>

View File

@@ -85,14 +85,18 @@ public:
~HttpSession() override = default;
/** @return The TCP stream */
/**
* @return The TCP stream
*/
boost::beast::tcp_stream&
stream()
{
return stream_;
}
/** @brief Starts reading from the stream. */
/**
* @brief Starts reading from the stream.
*/
void
run()
{
@@ -104,7 +108,9 @@ public:
);
}
/** @brief Closes the underlying socket. */
/**
* @brief Closes the underlying socket.
*/
void
doClose()
{
@@ -112,7 +118,9 @@ public:
stream_.socket().shutdown(tcp::socket::shutdown_send, ec);
}
/** @brief Upgrade to WebSocket connection. */
/**
* @brief Upgrade to WebSocket connection.
*/
void
upgrade()
{

View File

@@ -71,7 +71,9 @@ public:
~PlainWsSession() override = default;
/** @return The websocket stream. */
/**
* @return The websocket stream.
*/
StreamType&
ws()
{
@@ -137,7 +139,9 @@ public:
{
}
/** @brief Initiate the upgrade. */
/**
* @brief Initiate the upgrade.
*/
void
run()
{

View File

@@ -32,7 +32,7 @@ public:
/**
* @brief Resolve hostname to IP addresses.
*
* @throw This method throws an exception when the hostname cannot be resolved.
* @throws This method throws an exception when the hostname cannot be resolved.
*
* @param hostname Hostname to resolve
* @return IP addresses of the hostname
@@ -43,7 +43,7 @@ public:
/**
* @brief Resolve to IP addresses with port.
*
* @throw This method throws an exception when the hostname cannot be resolved.
* @throws This method throws an exception when the hostname cannot be resolved.
*
* @param hostname Hostname to resolve
* @param service Service to resolve

View File

@@ -129,7 +129,9 @@ public:
LOG(log_.info()) << "Detector failed (" << message << "): " << ec.message();
}
/** @brief Initiate the detection. */
/**
* @brief Initiate the detection.
*/
void
run()
{
@@ -305,14 +307,18 @@ public:
}
}
/** @brief Start accepting incoming connections. */
/**
* @brief Start accepting incoming connections.
*/
void
run()
{
doAccept();
}
/** @brief Stop accepting new connections */
/**
* @brief Stop accepting new connections
*/
void
stop(boost::asio::yield_context)
{
@@ -359,7 +365,9 @@ private:
}
};
/** @brief The final type of the HttpServer used by Clio. */
/**
* @brief The final type of the HttpServer used by Clio.
*/
template <typename HandlerType>
using HttpServer = Server<HttpSession, SslHttpSession, HandlerType>;

View File

@@ -93,14 +93,18 @@ public:
~SslHttpSession() override = default;
/** @return The SSL stream. */
/**
* @return The SSL stream.
*/
boost::asio::ssl::stream<boost::beast::tcp_stream>&
stream()
{
return stream_;
}
/** @brief Initiates the handshake. */
/**
* @brief Initiates the handshake.
*/
void
run()
{
@@ -135,7 +139,9 @@ public:
this->doRead();
}
/** @brief Closes the underlying connection. */
/**
* @brief Closes the underlying connection.
*/
void
doClose()
{
@@ -158,7 +164,9 @@ public:
// At this point the connection is closed gracefully
}
/** @brief Upgrades connection to secure websocket. */
/**
* @brief Upgrades connection to secure websocket.
*/
void
upgrade()
{

View File

@@ -72,7 +72,9 @@ public:
ConnectionBase::isAdmin_ = isAdmin; // NOLINT(cppcoreguidelines-prefer-member-initializer)
}
/** @return The secure websocket stream. */
/**
* @return The secure websocket stream.
*/
StreamType&
ws()
{
@@ -139,7 +141,9 @@ public:
~SslWsUpgrader() = default;
/** @brief Initiate the upgrade. */
/**
* @brief Initiate the upgrade.
*/
void
run()
{

View File

@@ -31,8 +31,8 @@ class DOSGuard : public DOSGuardInterface {
* @brief Accumulated state per IP, state will be reset accordingly
*/
struct ClientState {
std::uint32_t transferredByte = 0; /**< Accumulated transferred byte */
std::uint32_t requestsCount = 0; /**< Accumulated served requests count */
std::uint32_t transferredByte = 0; ///< Accumulated transferred byte
std::uint32_t requestsCount = 0; ///< Accumulated served requests count
};
struct State {

View File

@@ -9,7 +9,9 @@ namespace web::dosguard {
*/
class WhitelistHandlerInterface {
public:
/** @brief Virtual destructor */
/**
* @brief Virtual destructor
*/
virtual ~WhitelistHandlerInterface() = default;
/**

View File

@@ -180,7 +180,9 @@ TEST_F(ConfigDescriptionAssertTest, NonExistingKeyTest)
EXPECT_CLIO_ASSERT_FAIL({ [[maybe_unused]] auto a = definition.get("etl_sources.[]"); });
}
/** @brief Testing override the default values with the ones in Json */
/**
* @brief Testing override the default values with the ones in Json
*/
struct OverrideConfigVals : testing::Test {
OverrideConfigVals()
{

View File

@@ -180,7 +180,9 @@ struct LogFileRotationTests : ::testing::Test {
LogServiceState::replaceSinks(LogServiceState::sinks_);
}
/** @brief Returns the number of regular files in tmpDir_. */
/**
* @brief Returns the number of regular files in tmpDir_.
*/
[[nodiscard]] std::size_t
countLogFiles() const
{