Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(common): use real Doxygen groups #10504

Merged
merged 1 commit into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions google/cloud/internal/async_retry_unary_rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ template <typename RPCBackoffPolicy, typename RPCRetryPolicy,
typename AsyncCallType, typename RequestType>
class RetryAsyncUnaryRpc {
public:
//@{
///@{
/// @name Convenience aliases for the RPC request and response types.
using Request = RequestType;
using Response =
typename AsyncCallResponseType<AsyncCallType, RequestType>::type;
//@}
///@}

/**
* Start the asynchronous retry loop.
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/internal/retry_policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class RetryPolicy {
public:
virtual ~RetryPolicy() = default;

//@{
///@{
/**
* @name Control retry loop duration.
*
Expand Down Expand Up @@ -63,7 +63,7 @@ class RetryPolicy {
virtual bool OnFailure(Status const&) = 0;
virtual bool IsExhausted() const = 0;
virtual bool IsPermanentFailure(Status const&) const = 0;
//@}
///@}
};

/**
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/internal/sha256_hmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace internal {
Sha256Type Sha256Hmac(std::string const& key, absl::Span<char const> data);
Sha256Type Sha256Hmac(std::string const& key,
absl::Span<std::uint8_t const> data);
//@}
///@}

///@{
/**
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/internal/throw_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace cloud {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
namespace internal {

//@{
///@{
/**
* @name Delegate exception raising to out of line functions.
*
Expand All @@ -51,7 +51,7 @@ namespace internal {

[[noreturn]] void ThrowLogicError(char const* msg);
[[noreturn]] void ThrowLogicError(std::string const& msg);
//@}
///@}

/// Throw an exception wrapping @p status.
[[noreturn]] void ThrowStatus(Status status);
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/internal/type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace internal {
template <typename...>
using void_t = void;

//@{
///@{
/**
* A helper to detect if a type is output streamable.
*/
Expand All @@ -51,7 +51,7 @@ template <typename T>
class IsOStreamable<
T, void_t<decltype(std::declval<std::ostream&>() << std::declval<T>())>>
: public std::true_type {};
//@}
///@}

} // namespace internal
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
Expand Down
8 changes: 4 additions & 4 deletions google/cloud/kms_key_name.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ class KmsKeyName {
std::string const& key_ring, std::string const& kms_key_name);

/// @name Copy and move
//@{
///@{
KmsKeyName(KmsKeyName const&) = default;
KmsKeyName& operator=(KmsKeyName const&) = default;
KmsKeyName(KmsKeyName&&) = default;
KmsKeyName& operator=(KmsKeyName&&) = default;
//@}
///@}

/**
* Returns the fully qualified KMS Key name as a string of the form:
Expand All @@ -62,13 +62,13 @@ class KmsKeyName {
std::string const& FullName() const { return full_name_; }

/// @name Equality operators
//@{
///@{
friend bool operator==(KmsKeyName const& a, KmsKeyName const& b);
friend bool operator!=(KmsKeyName const& a, KmsKeyName const& b) {
return !(a == b);
}
//@}

///@}
/// Output the `FullName()` format.
friend std::ostream& operator<<(std::ostream&, KmsKeyName const&);

Expand Down
7 changes: 3 additions & 4 deletions google/cloud/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,17 +442,16 @@ class Logger<false> {
if (severity_ >= Severity::GCP_LS_FATAL) std::abort();
}

//@{
///@{
/**
* @name Provide trivial implementations that meet the generic `Logger<bool>`
* interface.
* @name Trivial implementations that meet the generic Logger<bool> interface.
*/
// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
bool enabled() const { return false; }
void LogTo(LogSink&) {}
// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
NullStream Stream() { return NullStream(); }
//@}
///@}

private:
Severity severity_;
Expand Down
2 changes: 0 additions & 2 deletions google/cloud/polling_policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class GenericPollingPolicy : public PollingPolicy {
retry_clone_(maybe_deref(retry_prototype_).clone()),
backoff_clone_(maybe_deref(backoff_prototype_).clone()) {}

//@{
std::unique_ptr<PollingPolicy> clone() const override {
return std::unique_ptr<PollingPolicy>(
new GenericPollingPolicy<Retry, Backoff>(retry_prototype_,
Expand All @@ -113,7 +112,6 @@ class GenericPollingPolicy : public PollingPolicy {
std::chrono::milliseconds WaitPeriod() override {
return backoff_clone_->OnCompletion();
}
//@}

private:
template <typename T>
Expand Down
8 changes: 4 additions & 4 deletions google/cloud/project.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ class Project {
explicit Project(std::string project_id);

/// @name Copy and move
//@{
///@{
Project(Project const&) = default;
Project& operator=(Project const&) = default;
Project(Project&&) = default;
Project& operator=(Project&&) = default;
//@}
///@}

/// Returns the Project ID
std::string const& project_id() const { return project_id_; }
Expand All @@ -60,10 +60,10 @@ class Project {
std::string FullName() const;

/// @name Equality operators
//@{
///@{
friend bool operator==(Project const& a, Project const& b);
friend bool operator!=(Project const& a, Project const& b);
//@}
///@}

/// Output the `FullName()` format.
friend std::ostream& operator<<(std::ostream&, Project const&);
Expand Down
16 changes: 8 additions & 8 deletions google/cloud/status_or.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class StatusOr final {
bool ok() const { return status_.ok(); }
explicit operator bool() const { return status_.ok(); }

//@{
///@{
/**
* @name Deference operators.
*
Expand All @@ -195,9 +195,9 @@ class StatusOr final {
T&& operator*() && { return *std::move(value_); }

T const&& operator*() const&& { return *std::move(value_); }
//@}
///@}

//@{
///@{
/**
* @name Member access operators.
*
Expand All @@ -210,9 +210,9 @@ class StatusOr final {
T* operator->() & { return &*value_; }

T const* operator->() const& { return &*value_; }
//@}
///@}

//@{
///@{
/**
* @name Value accessors.
*
Expand Down Expand Up @@ -241,17 +241,17 @@ class StatusOr final {
CheckHasValue();
return std::move(**this);
}
//@}
///@}

//@{
///@{
/**
* @name Status accessors.
*
* @return A reference to the contained `Status`.
*/
Status const& status() const& { return status_; }
Status&& status() && { return std::move(status_); }
//@}
///@}

private:
static Status MakeDefaultStatus() {
Expand Down
6 changes: 3 additions & 3 deletions google/cloud/stream_range.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ class StreamRange {
reader_ = nullptr;
}

//@{
// @name Move-only
///@{
/// @name Move-only
StreamRange(StreamRange const&) = delete;
StreamRange& operator=(StreamRange const&) = delete;
// NOLINTNEXTLINE(performance-noexcept-move-constructor)
StreamRange(StreamRange&&) = default;
// NOLINTNEXTLINE(performance-noexcept-move-constructor)
StreamRange& operator=(StreamRange&&) = default;
//@}
///@}

iterator begin() { return iterator(this); }
iterator end() { return iterator(); }
Expand Down
21 changes: 12 additions & 9 deletions google/cloud/terminate_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,21 @@
namespace google {
namespace cloud {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
//@{
/**
* @name Control behaviour on unrecoverable errors.
* @defgroup terminate Control behavior on unrecoverable errors.
*
* The following APIs are google::cloud counterpart for
* std::{set,get}_terminate functions. If exceptions are not enabled via
* GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS, calling any function from throw_delegate.h
* will result in calling the handler installed via this API. By default,
* a call to std::abort() is used.
* If exceptions are not enabled via `GOOGLE_CLOUD_CPP_HAVE_EXCEPTIONS`, calling
* any function from throw_delegate.h will result in calling the handler
* installed via this API. By default, the library calls `std::abort()`.
*/

/**
* Terminate handler.
*
* It should handle the error, whose description are given in *msg* and should
* never return.
*
* @ingroup terminate
*/
using TerminateHandler = std::function<void(char const* msg)>;

Expand All @@ -47,13 +46,17 @@ using TerminateHandler = std::function<void(char const* msg)>;
* otherwise.
*
* @return Previously set handler.
*
* @ingroup terminate
*/
TerminateHandler SetTerminateHandler(TerminateHandler f);

/**
* Get the currently installed handler.
*
* @return The currently installed handler.
*
* @ingroup terminate
*/
TerminateHandler GetTerminateHandler();

Expand All @@ -63,11 +66,11 @@ TerminateHandler GetTerminateHandler();
* @param msg Details about the error.
*
* This function should never return.
*
* @ingroup terminate
*/
[[noreturn]] void Terminate(char const* msg);

//@}

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace cloud
} // namespace google
Expand Down