From f693874c509fed92f505dc78a5334855bdc9abc4 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 15 Nov 2020 17:38:10 +0300 Subject: [PATCH] Improve documentation. --- td/telegram/ClientActor.h | 12 +++++++++--- td/telegram/td_json_client.h | 2 +- td/tl/TlObject.h | 9 ++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/td/telegram/ClientActor.h b/td/telegram/ClientActor.h index 3a6fd5729..73022ba1f 100644 --- a/td/telegram/ClientActor.h +++ b/td/telegram/ClientActor.h @@ -8,10 +8,9 @@ ///\file -#include "td/telegram/TdCallback.h" - #include "td/telegram/td_api.h" #include "td/telegram/td_api.hpp" +#include "td/telegram/TdCallback.h" #include "td/actor/actor.h" @@ -30,9 +29,12 @@ class Td; */ class ClientActor : public Actor { public: + /// Options for ClientActor creation. struct Options { + /// NetQueryStats object for this client. std::shared_ptr net_query_stats; + /// Default constructor. Options() { } }; @@ -40,6 +42,7 @@ class ClientActor : public Actor { /** * Creates a ClientActor using the specified callback. * \param[in] callback Callback for outgoing notifications from TDLib. + * \param[in] options Options to create the TDLib. */ explicit ClientActor(unique_ptr callback, Options options = {}); @@ -53,7 +56,7 @@ class ClientActor : public Actor { /** * Synchronously executes a TDLib request. Only a few requests can be executed synchronously. * May be called from any thread. - * \param[in] request Request to the TDLib. + * \param[in] request Request to the TDLib instance. * \return The request response. */ static td_api::object_ptr execute(td_api::object_ptr request); @@ -80,6 +83,9 @@ class ClientActor : public Actor { ActorOwn td_; }; +/** + * Creates NetQueryStats object, which can be shared between different clients. + */ std::shared_ptr create_net_query_stats(); /** diff --git a/td/telegram/td_json_client.h b/td/telegram/td_json_client.h index 417f92424..6e667536c 100644 --- a/td/telegram/td_json_client.h +++ b/td/telegram/td_json_client.h @@ -13,7 +13,7 @@ * and is able to work with JSON. * * The JSON serialization of TDLib API objects is straightforward: all API objects are represented as JSON objects with - * the same keys as the API object field names. The object type name is stored in the special field '@type' which is + * the same keys as the API object field names. The object type name is stored in the special field "@type" which is * optional in places where type is uniquely determined by the context. * Fields of Bool type are stored as Boolean, fields of int32, int53, and double types are stored as Number, fields of * int64 and string types are stored as String, fields of bytes type are base64 encoded and then stored as String, diff --git a/td/tl/TlObject.h b/td/tl/TlObject.h index 85b540f1b..9e954d0bc 100644 --- a/td/tl/TlObject.h +++ b/td/tl/TlObject.h @@ -87,9 +87,7 @@ class TlObject { virtual ~TlObject() = default; }; -/** - * A smart wrapper to store a pointer to a TL-object. - */ +/// @cond UNDOCUMENTED namespace tl { template @@ -177,6 +175,11 @@ bool operator!=(const unique_ptr &p, std::nullptr_t) { } } // namespace tl +/// @endcond + +/** + * A smart wrapper to store a pointer to a TL-object. + */ template using tl_object_ptr = tl::unique_ptr;