TDLib
Toggle main menu visibility
Loading...
Searching...
No Matches
td
telegram
ClientActor.h
Go to the documentation of this file.
1
//
2
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2026
3
//
4
// Distributed under the Boost Software License, Version 1.0. (See accompanying
5
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
//
7
#pragma once
8
10
11
#include "td/telegram/td_api.h"
12
#include "
td/telegram/td_api.hpp
"
13
#include "
td/telegram/TdCallback.h
"
14
15
#include "td/actor/actor.h"
16
17
#include "td/utils/common.h"
18
19
#include <memory>
20
21
namespace
td {
22
23
class
NetQueryStats;
24
class
Td;
25
30
class
ClientActor
final :
public
Actor {
31
public
:
33
struct
Options
{
35
std::shared_ptr<NetQueryStats>
net_query_stats
;
36
38
Options
() {
39
}
40
};
41
47
explicit
ClientActor
(unique_ptr<TdCallback> callback,
Options
options = {});
48
54
void
request
(uint64
id
, td_api::object_ptr<td_api::Function>
request
);
55
62
static
td_api::object_ptr<td_api::Object>
execute
(td_api::object_ptr<td_api::Function>
request
);
63
67
~ClientActor
() final;
68
72
ClientActor
(
ClientActor
&&other) noexcept;
73
77
ClientActor
&operator=(
ClientActor
&&other) noexcept;
78
79
ClientActor
(const
ClientActor
&) = delete;
80
81
ClientActor
&operator=(const
ClientActor
&) = delete;
82
83
private:
84
void
start_up() final;
85
86
ActorOwn<Td> td_;
87
unique_ptr<
TdCallback
> callback_;
88
Options
options_;
89
};
90
94
std::shared_ptr<NetQueryStats>
create_net_query_stats
();
95
100
void
dump_pending_network_queries
(NetQueryStats &stats);
101
106
uint64
get_pending_network_query_count
(NetQueryStats &stats);
107
108
}
// namespace td
td::create_net_query_stats
std::shared_ptr< NetQueryStats > create_net_query_stats()
td::dump_pending_network_queries
void dump_pending_network_queries(NetQueryStats &stats)
td::get_pending_network_query_count
uint64 get_pending_network_query_count(NetQueryStats &stats)
TdCallback.h
td::ClientActor::~ClientActor
~ClientActor() final
td::ClientActor::execute
static td_api::object_ptr< td_api::Object > execute(td_api::object_ptr< td_api::Function > request)
td::ClientActor::ClientActor
ClientActor(unique_ptr< TdCallback > callback, Options options={})
td::ClientActor::request
void request(uint64 id, td_api::object_ptr< td_api::Function > request)
td::TdCallback
Definition
TdCallback.h:20
td::ClientActor::Options
Options for ClientActor creation.
Definition
ClientActor.h:33
td::ClientActor::Options::Options
Options()
Default constructor.
Definition
ClientActor.h:38
td::ClientActor::Options::net_query_stats
std::shared_ptr< NetQueryStats > net_query_stats
NetQueryStats object for this client.
Definition
ClientActor.h:35
td_api.hpp
Generated by
1.17.0