diff --git a/benchmark/bench_actor.cpp b/benchmark/bench_actor.cpp index b13b3556f..a6939adf3 100644 --- a/benchmark/bench_actor.cpp +++ b/benchmark/bench_actor.cpp @@ -20,7 +20,7 @@ #endif template -class RingBench : public td::Benchmark { +class RingBench final : public td::Benchmark { public: struct PassActor; @@ -37,7 +37,7 @@ class RingBench : public td::Benchmark { return PSTRING() << "Ring (send_" << types[type] << ") (threads_n = " << thread_n_ << ")"; } - struct PassActor : public td::Actor { + struct PassActor final : public td::Actor { int id = -1; td::ActorId next_actor; int start_n = 0; @@ -118,7 +118,7 @@ class RingBench : public td::Benchmark { }; template -class QueryBench : public td::Benchmark { +class QueryBench final : public td::Benchmark { public: std::string get_description() const final { static const char *types[] = {"callback", "immediate future", "delayed future", "dummy", "lambda", "lambda_future"}; @@ -126,7 +126,7 @@ class QueryBench : public td::Benchmark { return PSTRING() << "QueryBench: " << types[type]; } - class ClientActor : public td::Actor { + class ClientActor final : public td::Actor { public: class Callback { public: @@ -157,9 +157,9 @@ class QueryBench : public td::Benchmark { td::unique_ptr callback_; }; - class ServerActor : public td::Actor { + class ServerActor final : public td::Actor { public: - class ClientCallback : public ClientActor::Callback { + class ClientCallback final : public ClientActor::Callback { public: explicit ClientCallback(td::ActorId server) : server_(server) { } diff --git a/benchmark/bench_crypto.cpp b/benchmark/bench_crypto.cpp index a37446c77..b6d36c237 100644 --- a/benchmark/bench_crypto.cpp +++ b/benchmark/bench_crypto.cpp @@ -29,7 +29,7 @@ static constexpr int DATA_SIZE = 8 << 10; static constexpr int SHORT_DATA_SIZE = 64; #if OPENSSL_VERSION_NUMBER <= 0x10100000L -class SHA1Bench : public td::Benchmark { +class SHA1Bench final : public td::Benchmark { public: alignas(64) unsigned char data[DATA_SIZE]; @@ -53,7 +53,7 @@ class SHA1Bench : public td::Benchmark { }; #endif -class AesEcbBench : public td::Benchmark { +class AesEcbBench final : public td::Benchmark { public: alignas(64) unsigned char data[DATA_SIZE]; td::UInt256 key; @@ -84,7 +84,7 @@ class AesEcbBench : public td::Benchmark { } }; -class AesIgeEncryptBench : public td::Benchmark { +class AesIgeEncryptBench final : public td::Benchmark { public: alignas(64) unsigned char data[DATA_SIZE]; td::UInt256 key; @@ -112,7 +112,7 @@ class AesIgeEncryptBench : public td::Benchmark { } }; -class AesIgeDecryptBench : public td::Benchmark { +class AesIgeDecryptBench final : public td::Benchmark { public: alignas(64) unsigned char data[DATA_SIZE]; td::UInt256 key; @@ -140,7 +140,7 @@ class AesIgeDecryptBench : public td::Benchmark { } }; -class AesCtrBench : public td::Benchmark { +class AesCtrBench final : public td::Benchmark { public: alignas(64) unsigned char data[DATA_SIZE]; td::UInt256 key; @@ -169,7 +169,7 @@ class AesCtrBench : public td::Benchmark { }; #if OPENSSL_VERSION_NUMBER >= 0x10100000L -class AesCtrOpenSSLBench : public td::Benchmark { +class AesCtrOpenSSLBench final : public td::Benchmark { public: alignas(64) unsigned char data[DATA_SIZE]; td::UInt256 key; @@ -205,7 +205,7 @@ class AesCtrOpenSSLBench : public td::Benchmark { }; #endif -class AesCbcDecryptBench : public td::Benchmark { +class AesCbcDecryptBench final : public td::Benchmark { public: alignas(64) unsigned char data[DATA_SIZE]; td::UInt256 key; @@ -231,7 +231,7 @@ class AesCbcDecryptBench : public td::Benchmark { } }; -class AesCbcEncryptBench : public td::Benchmark { +class AesCbcEncryptBench final : public td::Benchmark { public: alignas(64) unsigned char data[DATA_SIZE]; td::UInt256 key; @@ -258,7 +258,7 @@ class AesCbcEncryptBench : public td::Benchmark { }; template -class AesIgeShortBench : public td::Benchmark { +class AesIgeShortBench final : public td::Benchmark { public: alignas(64) unsigned char data[SHORT_DATA_SIZE]; td::UInt256 key; @@ -363,7 +363,7 @@ BENCH(Pbkdf2, "pbkdf2") { td::pbkdf2_sha256(password, salt, n, key); } -class Crc32Bench : public td::Benchmark { +class Crc32Bench final : public td::Benchmark { public: alignas(64) unsigned char data[DATA_SIZE]; @@ -387,7 +387,7 @@ class Crc32Bench : public td::Benchmark { } }; -class Crc64Bench : public td::Benchmark { +class Crc64Bench final : public td::Benchmark { public: alignas(64) unsigned char data[DATA_SIZE]; diff --git a/benchmark/bench_db.cpp b/benchmark/bench_db.cpp index ae9fd1e26..03983aab0 100644 --- a/benchmark/bench_db.cpp +++ b/benchmark/bench_db.cpp @@ -28,7 +28,7 @@ #include template -class TdKvBench : public td::Benchmark { +class TdKvBench final : public td::Benchmark { td::ConcurrentScheduler sched; td::string name_; @@ -41,7 +41,7 @@ class TdKvBench : public td::Benchmark { return name_; } - class Main : public td::Actor { + class Main final : public td::Actor { public: explicit Main(int n) : n_(n) { } @@ -50,7 +50,7 @@ class TdKvBench : public td::Benchmark { void loop() final { KeyValueT::destroy("test_tddb").ignore(); - class Worker : public Actor { + class Worker final : public Actor { public: Worker(int n, td::string db_name) : n_(n) { kv_.init(db_name).ensure(); @@ -89,7 +89,7 @@ class TdKvBench : public td::Benchmark { }; template -class SqliteKVBench : public td::Benchmark { +class SqliteKVBench final : public td::Benchmark { td::SqliteDb db; td::string get_description() const final { return PSTRING() << "SqliteKV " << td::tag("is_encrypted", is_encrypted); @@ -142,7 +142,7 @@ static td::Status init_db(td::SqliteDb &db) { return td::Status::OK(); } -class SqliteKeyValueAsyncBench : public td::Benchmark { +class SqliteKeyValueAsyncBench final : public td::Benchmark { public: td::string get_description() const final { return "SqliteKeyValueAsync"; @@ -199,7 +199,7 @@ class SqliteKeyValueAsyncBench : public td::Benchmark { } }; -class SeqKvBench : public td::Benchmark { +class SeqKvBench final : public td::Benchmark { td::string get_description() const final { return "SeqKvBench"; } @@ -213,7 +213,7 @@ class SeqKvBench : public td::Benchmark { }; template -class BinlogKeyValueBench : public td::Benchmark { +class BinlogKeyValueBench final : public td::Benchmark { td::string get_description() const final { return PSTRING() << "BinlogKeyValue " << td::tag("is_encrypted", is_encrypted); } diff --git a/benchmark/bench_handshake.cpp b/benchmark/bench_handshake.cpp index 4c8ee58c3..c3f364c2d 100644 --- a/benchmark/bench_handshake.cpp +++ b/benchmark/bench_handshake.cpp @@ -28,12 +28,12 @@ static string prime_base64 = "WC2xF40WnGvEZbDW_5yjko_vW5rk5Bj8Feg-vqD4f6n_Xu1wBQ3tKEn0e_lZ2VaFDOkphR8NgRX2NbEF7i5OFdBLJFS_b0-t8DSxBAMRnNjjuS_MW" "w"; -class HandshakeBench : public Benchmark { +class HandshakeBench final : public Benchmark { std::string get_description() const final { return "Handshake"; } - class FakeDhCallback : public DhCallback { + class FakeDhCallback final : public DhCallback { public: int is_good_prime(Slice prime_str) const final { auto it = cache.find(prime_str.str()); diff --git a/benchmark/bench_http.cpp b/benchmark/bench_http.cpp index 9bbcc163c..835d5a83f 100644 --- a/benchmark/bench_http.cpp +++ b/benchmark/bench_http.cpp @@ -24,7 +24,7 @@ namespace td { std::atomic counter; -class HttpClient : public HttpOutboundConnection::Callback { +class HttpClient final : public HttpOutboundConnection::Callback { void start_up() final { IPAddress addr; addr.init_ipv4_port("127.0.0.1", 8082).ensure(); diff --git a/benchmark/bench_http_reader.cpp b/benchmark/bench_http_reader.cpp index b6d4651a0..a37c9718c 100644 --- a/benchmark/bench_http_reader.cpp +++ b/benchmark/bench_http_reader.cpp @@ -16,7 +16,7 @@ static std::string http_query = "GET / HTTP/1.1\r\nConnection:keep-alive\r\nhost:127.0.0.1:8080\r\n\r\n"; static const size_t block_size = 2500; -class HttpReaderBench : public td::Benchmark { +class HttpReaderBench final : public td::Benchmark { std::string get_description() const final { return "HttpReaderBench"; } @@ -52,7 +52,7 @@ class HttpReaderBench : public td::Benchmark { } }; -class BufferBench : public td::Benchmark { +class BufferBench final : public td::Benchmark { std::string get_description() const final { return "BufferBench"; } @@ -78,7 +78,7 @@ class BufferBench : public td::Benchmark { } }; -class FindBoundaryBench : public td::Benchmark { +class FindBoundaryBench final : public td::Benchmark { std::string get_description() const final { return "FindBoundaryBench"; } diff --git a/benchmark/bench_http_server.cpp b/benchmark/bench_http_server.cpp index ca548c2d8..cf6f4e4c6 100644 --- a/benchmark/bench_http_server.cpp +++ b/benchmark/bench_http_server.cpp @@ -21,7 +21,7 @@ namespace td { static int cnt = 0; -class HelloWorld : public HttpInboundConnection::Callback { +class HelloWorld final : public HttpInboundConnection::Callback { public: void handle(unique_ptr query, ActorOwn connection) final { // LOG(ERROR) << *query; @@ -47,7 +47,7 @@ class HelloWorld : public HttpInboundConnection::Callback { }; const int N = 0; -class Server : public TcpListener::Callback { +class Server final : public TcpListener::Callback { public: void start_up() final { listener_ = create_actor("Listener", 8082, ActorOwn(actor_id(this))); diff --git a/benchmark/bench_http_server_cheat.cpp b/benchmark/bench_http_server_cheat.cpp index f5cdb7a67..98e8c7a98 100644 --- a/benchmark/bench_http_server_cheat.cpp +++ b/benchmark/bench_http_server_cheat.cpp @@ -24,7 +24,7 @@ namespace td { // HttpInboundConnection header static int cnt = 0; -class HelloWorld : public Actor { +class HelloWorld final : public Actor { public: explicit HelloWorld(SocketFd socket_fd) : socket_fd_(std::move(socket_fd)) { } @@ -98,7 +98,7 @@ class HelloWorld : public Actor { } }; const int N = 0; -class Server : public TcpListener::Callback { +class Server final : public TcpListener::Callback { public: void start_up() final { listener_ = create_actor("Listener", 8082, ActorOwn(actor_id(this))); diff --git a/benchmark/bench_http_server_fast.cpp b/benchmark/bench_http_server_fast.cpp index 874582c43..1d2896346 100644 --- a/benchmark/bench_http_server_fast.cpp +++ b/benchmark/bench_http_server_fast.cpp @@ -22,7 +22,7 @@ namespace td { -class HttpEchoConnection : public Actor { +class HttpEchoConnection final : public Actor { public: explicit HttpEchoConnection(SocketFd fd) : fd_(std::move(fd)) { } @@ -85,7 +85,7 @@ class HttpEchoConnection : public Actor { }; const int N = 8; -class Server : public TcpListener::Callback { +class Server final : public TcpListener::Callback { public: void start_up() final { listener_ = create_actor("Listener", 8082, ActorOwn(actor_id(this))); diff --git a/benchmark/bench_log.cpp b/benchmark/bench_log.cpp index 723d8931b..fa42828d8 100644 --- a/benchmark/bench_log.cpp +++ b/benchmark/bench_log.cpp @@ -36,7 +36,7 @@ std::string create_tmp_file() { #endif } -class IostreamWriteBench : public td::Benchmark { +class IostreamWriteBench final : public td::Benchmark { protected: std::string file_name_; std::ofstream stream; @@ -67,7 +67,7 @@ class IostreamWriteBench : public td::Benchmark { } }; -class FILEWriteBench : public td::Benchmark { +class FILEWriteBench final : public td::Benchmark { protected: std::string file_name_; FILE *file; @@ -101,7 +101,7 @@ class FILEWriteBench : public td::Benchmark { #if TD_ANDROID #include #define ALOG(...) __android_log_print(ANDROID_LOG_VERBOSE, "XXX", __VA_ARGS__) -class ALogWriteBench : public td::Benchmark { +class ALogWriteBench final : public td::Benchmark { public: std::string get_description() const final { return "android_log"; @@ -118,7 +118,7 @@ class ALogWriteBench : public td::Benchmark { }; #endif -class LogWriteBench : public td::Benchmark { +class LogWriteBench final : public td::Benchmark { protected: std::string file_name_; std::ofstream stream; diff --git a/benchmark/bench_misc.cpp b/benchmark/bench_misc.cpp index 0b956b99f..fb412a1ad 100644 --- a/benchmark/bench_misc.cpp +++ b/benchmark/bench_misc.cpp @@ -119,7 +119,7 @@ BENCH(Time, "Clocks::monotonic") { } */ #if !TD_WINDOWS -class PipeBench : public Benchmark { +class PipeBench final : public Benchmark { public: int p[2]; @@ -153,7 +153,7 @@ class PipeBench : public Benchmark { #endif #if TD_LINUX || TD_ANDROID || TD_TIZEN -class SemBench : public Benchmark { +class SemBench final : public Benchmark { sem_t sem; public: @@ -180,7 +180,7 @@ class SemBench : public Benchmark { #endif #if !TD_WINDOWS -class UtimeBench : public Benchmark { +class UtimeBench final : public Benchmark { public: void start_up() final { FileFd::open("test", FileFd::Flags::Create | FileFd::Flags::Write).move_as_ok().close(); @@ -210,7 +210,7 @@ BENCH(Pwrite, "pwrite") { fd.close(); } -class CreateFileBench : public Benchmark { +class CreateFileBench final : public Benchmark { string get_description() const final { return "create_file"; } @@ -233,7 +233,7 @@ class CreateFileBench : public Benchmark { } }; -class WalkPathBench : public Benchmark { +class WalkPathBench final : public Benchmark { string get_description() const final { return "walk_path"; } @@ -266,7 +266,7 @@ class WalkPathBench : public Benchmark { #if !TD_THREAD_UNSUPPORTED template -class AtomicReleaseIncBench : public Benchmark { +class AtomicReleaseIncBench final : public Benchmark { string get_description() const final { return PSTRING() << "AtomicReleaseInc" << ThreadN; } @@ -290,7 +290,7 @@ template std::atomic AtomicReleaseIncBench::a_; template -class AtomicReleaseCasIncBench : public Benchmark { +class AtomicReleaseCasIncBench final : public Benchmark { string get_description() const final { return PSTRING() << "AtomicReleaseCasInc" << ThreadN; } @@ -316,7 +316,7 @@ template std::atomic AtomicReleaseCasIncBench::a_; template -class RwMutexReadBench : public Benchmark { +class RwMutexReadBench final : public Benchmark { string get_description() const final { return PSTRING() << "RwMutexRead" << ThreadN; } @@ -336,7 +336,7 @@ class RwMutexReadBench : public Benchmark { } }; template -class RwMutexWriteBench : public Benchmark { +class RwMutexWriteBench final : public Benchmark { string get_description() const final { return PSTRING() << "RwMutexWrite" << ThreadN; } diff --git a/benchmark/bench_queue.cpp b/benchmark/bench_queue.cpp index 008f2f641..749a37770 100644 --- a/benchmark/bench_queue.cpp +++ b/benchmark/bench_queue.cpp @@ -562,7 +562,7 @@ class SemCheatQueue { }; template -class QueueBenchmark2 : public td::Benchmark { +class QueueBenchmark2 final : public td::Benchmark { QueueT client, server; int connections_n, queries_n; @@ -704,7 +704,7 @@ class QueueBenchmark2 : public td::Benchmark { }; template -class QueueBenchmark : public td::Benchmark { +class QueueBenchmark final : public td::Benchmark { QueueT client, server; const int connections_n; int queries_n; @@ -836,7 +836,7 @@ class QueueBenchmark : public td::Benchmark { }; template -class RingBenchmark : public td::Benchmark { +class RingBenchmark final : public td::Benchmark { static constexpr int QN = 504; struct Thread { diff --git a/benchmark/bench_tddb.cpp b/benchmark/bench_tddb.cpp index 5f82a153d..8427a877d 100644 --- a/benchmark/bench_tddb.cpp +++ b/benchmark/bench_tddb.cpp @@ -37,7 +37,7 @@ static Status init_db(SqliteDb &db) { return Status::OK(); } -class MessagesDbBench : public Benchmark { +class MessagesDbBench final : public Benchmark { public: string get_description() const final { return "MessagesDb"; diff --git a/td/generate/tl_writer_c.h b/td/generate/tl_writer_c.h index b3a81e6a1..030afe620 100644 --- a/td/generate/tl_writer_c.h +++ b/td/generate/tl_writer_c.h @@ -16,7 +16,7 @@ namespace td { -class TlWriterCCommon : public tl::TL_writer { +class TlWriterCCommon final : public tl::TL_writer { public: int is_header_; std::string prefix_; @@ -547,7 +547,7 @@ class TlWriterCCommon : public tl::TL_writer { } }; - struct file_store_methods_to_td : public file_store_methods { + struct file_store_methods_to_td final : public file_store_methods { explicit file_store_methods_to_td(const class TlWriterCCommon *cl) : cl(cl) { } void store_simple_type(std::stringstream &ss, std::string offset, std::string res_var, std::string var, @@ -609,7 +609,7 @@ class TlWriterCCommon : public tl::TL_writer { const class TlWriterCCommon *cl; }; - struct file_store_methods_destroy : public file_store_methods { + struct file_store_methods_destroy final : public file_store_methods { explicit file_store_methods_destroy(const class TlWriterCCommon *cl) : cl(cl) { } void store_simple_type(std::stringstream &ss, std::string offset, std::string res_var, std::string var, @@ -666,7 +666,7 @@ class TlWriterCCommon : public tl::TL_writer { } const class TlWriterCCommon *cl; }; - struct file_store_methods_stack : public file_store_methods { + struct file_store_methods_stack final : public file_store_methods { explicit file_store_methods_stack(const class TlWriterCCommon *cl) : cl(cl) { } void store_simple_type(std::stringstream &ss, std::string offset, std::string res_var, std::string var, @@ -767,7 +767,7 @@ class TlWriterCCommon : public tl::TL_writer { } }; - struct file_fetch_methods_from_td : public file_fetch_methods { + struct file_fetch_methods_from_td final : public file_fetch_methods { explicit file_fetch_methods_from_td(const class TlWriterCCommon *cl) : cl(cl) { } std::string fetch_field_start(std::stringstream &ss, std::string offset, int depth, @@ -818,7 +818,7 @@ class TlWriterCCommon : public tl::TL_writer { const class TlWriterCCommon *cl; }; - struct file_fetch_methods_stack : public file_fetch_methods { + struct file_fetch_methods_stack final : public file_fetch_methods { explicit file_fetch_methods_stack(const class TlWriterCCommon *cl) : cl(cl) { } std::string fetch_field_start(std::stringstream &ss, std::string offset, int depth, diff --git a/td/generate/tl_writer_dotnet.h b/td/generate/tl_writer_dotnet.h index 0fbcadcc4..62dd0b1d8 100644 --- a/td/generate/tl_writer_dotnet.h +++ b/td/generate/tl_writer_dotnet.h @@ -17,7 +17,7 @@ namespace td { namespace tl { -class TlWriterDotNet : public TL_writer { +class TlWriterDotNet final : public TL_writer { public: bool is_header_; std::string prefix_; diff --git a/td/generate/tl_writer_hpp.h b/td/generate/tl_writer_hpp.h index adb985d80..04b96d8d2 100644 --- a/td/generate/tl_writer_hpp.h +++ b/td/generate/tl_writer_hpp.h @@ -14,7 +14,7 @@ namespace td { -class TD_TL_writer_hpp : public TD_TL_writer { +class TD_TL_writer_hpp final : public TD_TL_writer { public: TD_TL_writer_hpp(const std::string &tl_name, const std::string &string_type, const std::string &bytes_type) : TD_TL_writer(tl_name, string_type, bytes_type) { diff --git a/td/generate/tl_writer_java.h b/td/generate/tl_writer_java.h index 0789165cf..6a3a17f71 100644 --- a/td/generate/tl_writer_java.h +++ b/td/generate/tl_writer_java.h @@ -14,7 +14,7 @@ namespace td { -class TD_TL_writer_java : public tl::TL_writer { +class TD_TL_writer_java final : public tl::TL_writer { static const int MAX_ARITY = 0; static const std::string base_type_class_names[MAX_ARITY + 1]; diff --git a/td/generate/tl_writer_jni_cpp.h b/td/generate/tl_writer_jni_cpp.h index d4b4d8262..18e47afe9 100644 --- a/td/generate/tl_writer_jni_cpp.h +++ b/td/generate/tl_writer_jni_cpp.h @@ -15,7 +15,7 @@ namespace td { -class TD_TL_writer_jni_cpp : public TD_TL_writer_cpp { +class TD_TL_writer_jni_cpp final : public TD_TL_writer_cpp { std::string gen_vector_fetch(std::string field_name, const tl::tl_tree_type *t, const std::vector &vars, int parser_type) const; diff --git a/td/generate/tl_writer_jni_h.h b/td/generate/tl_writer_jni_h.h index ed6401ba1..97059f788 100644 --- a/td/generate/tl_writer_jni_h.h +++ b/td/generate/tl_writer_jni_h.h @@ -13,7 +13,7 @@ namespace td { -class TD_TL_writer_jni_h : public TD_TL_writer_h { +class TD_TL_writer_jni_h final : public TD_TL_writer_h { public: TD_TL_writer_jni_h(const std::string &tl_name, const std::string &string_type, const std::string &bytes_type, const std::vector &ext_include) diff --git a/td/mtproto/HandshakeActor.h b/td/mtproto/HandshakeActor.h index c239b9e4f..a49b56f89 100644 --- a/td/mtproto/HandshakeActor.h +++ b/td/mtproto/HandshakeActor.h @@ -19,7 +19,7 @@ namespace td { namespace mtproto { // Has Raw connection. Generates new auth key. And returns it and raw_connection. Or error... -class HandshakeActor : public Actor { +class HandshakeActor final : public Actor { public: HandshakeActor(unique_ptr handshake, unique_ptr raw_connection, unique_ptr context, double timeout, diff --git a/td/mtproto/HandshakeConnection.h b/td/mtproto/HandshakeConnection.h index bbcc41835..f7760ce05 100644 --- a/td/mtproto/HandshakeConnection.h +++ b/td/mtproto/HandshakeConnection.h @@ -24,7 +24,7 @@ namespace td { namespace mtproto { -class HandshakeConnection +class HandshakeConnection final : private RawConnection::Callback , private AuthKeyHandshake::Callback { public: diff --git a/td/mtproto/HttpTransport.h b/td/mtproto/HttpTransport.h index a1ec209c2..e246a0428 100644 --- a/td/mtproto/HttpTransport.h +++ b/td/mtproto/HttpTransport.h @@ -21,7 +21,7 @@ namespace td { namespace mtproto { namespace http { -class Transport : public IStreamTransport { +class Transport final : public IStreamTransport { public: explicit Transport(string secret) : secret_(std::move(secret)) { } diff --git a/td/mtproto/PacketStorer.h b/td/mtproto/PacketStorer.h index e8d6532f0..c71b33f81 100644 --- a/td/mtproto/PacketStorer.h +++ b/td/mtproto/PacketStorer.h @@ -15,7 +15,7 @@ namespace td { namespace mtproto { template -class PacketStorer +class PacketStorer final : public Storer , public Impl { public: diff --git a/td/mtproto/Ping.cpp b/td/mtproto/Ping.cpp index e9d5a7e4d..b3dadcc7c 100644 --- a/td/mtproto/Ping.cpp +++ b/td/mtproto/Ping.cpp @@ -21,7 +21,7 @@ namespace mtproto { ActorOwn<> create_ping_actor(string debug, unique_ptr raw_connection, unique_ptr auth_data, Promise> promise, ActorShared<> parent) { - class PingActor : public Actor { + class PingActor final : public Actor { public: PingActor(unique_ptr raw_connection, unique_ptr auth_data, Promise> promise, ActorShared<> parent) diff --git a/td/mtproto/PingConnection.cpp b/td/mtproto/PingConnection.cpp index 52631fd04..92945ea39 100644 --- a/td/mtproto/PingConnection.cpp +++ b/td/mtproto/PingConnection.cpp @@ -27,7 +27,7 @@ namespace td { namespace mtproto { namespace detail { -class PingConnectionReqPQ +class PingConnectionReqPQ final : public PingConnection , private RawConnection::Callback { public: @@ -86,7 +86,7 @@ class PingConnectionReqPQ bool was_ping_ = false; }; -class PingConnectionPingPong +class PingConnectionPingPong final : public PingConnection , private SessionConnection::Callback { public: diff --git a/td/mtproto/RawConnection.cpp b/td/mtproto/RawConnection.cpp index 5da655f98..e4b5d6086 100644 --- a/td/mtproto/RawConnection.cpp +++ b/td/mtproto/RawConnection.cpp @@ -33,7 +33,7 @@ namespace td { namespace mtproto { -class RawConnectionDefault : public RawConnection { +class RawConnectionDefault final : public RawConnection { public: RawConnectionDefault(SocketFd socket_fd, TransportType transport_type, unique_ptr stats_callback) : socket_fd_(std::move(socket_fd)) @@ -260,7 +260,7 @@ class RawConnectionDefault : public RawConnection { }; #if TD_EXPERIMENTAL_WATCH_OS -class RawConnectionHttp : public RawConnection { +class RawConnectionHttp final : public RawConnection { public: RawConnectionHttp(IPAddress ip_address, unique_ptr stats_callback) : ip_address_(std::move(ip_address)), stats_callback_(std::move(stats_callback)) { diff --git a/td/mtproto/SessionConnection.h b/td/mtproto/SessionConnection.h index 5bc3cd786..bb43dd25f 100644 --- a/td/mtproto/SessionConnection.h +++ b/td/mtproto/SessionConnection.h @@ -65,7 +65,7 @@ inline StringBuilder &operator<<(StringBuilder &stream, const MsgInfo &id) { << "] [seq_no:" << format::as_hex(id.seq_no) << "]"; } -class SessionConnection +class SessionConnection final : public Named , private RawConnection::Callback { public: diff --git a/td/mtproto/TcpTransport.h b/td/mtproto/TcpTransport.h index b57d6e836..73866132d 100644 --- a/td/mtproto/TcpTransport.h +++ b/td/mtproto/TcpTransport.h @@ -49,7 +49,7 @@ class ITransport { virtual ~ITransport() = default; }; -class AbridgedTransport : public ITransport { +class AbridgedTransport final : public ITransport { public: size_t read_from_stream(ChainBufferReader *stream, BufferSlice *message, uint32 *quick_ack) final; void write_prepare_inplace(BufferWriter *message, bool quick_ack) final; @@ -79,7 +79,7 @@ class IntermediateTransport : ITransport { using TransportImpl = IntermediateTransport; -class OldTransport : public IStreamTransport { +class OldTransport final : public IStreamTransport { public: OldTransport() = default; Result read_next(BufferSlice *message, uint32 *quick_ack) final TD_WARN_UNUSED_RESULT { @@ -126,7 +126,7 @@ class OldTransport : public IStreamTransport { ChainBufferWriter *output_; }; -class ObfuscatedTransport : public IStreamTransport { +class ObfuscatedTransport final : public IStreamTransport { public: ObfuscatedTransport(int16 dc_id, const ProxySecret &secret) : dc_id_(dc_id), secret_(secret), impl_(secret_.use_random_padding()) { diff --git a/td/mtproto/TlsInit.h b/td/mtproto/TlsInit.h index acc7d0e58..c9a0fa4a9 100644 --- a/td/mtproto/TlsInit.h +++ b/td/mtproto/TlsInit.h @@ -23,7 +23,7 @@ class Grease { static void init(MutableSlice res); }; -class TlsInit : public TransparentProxy { +class TlsInit final : public TransparentProxy { public: TlsInit(SocketFd socket_fd, string domain, string secret, unique_ptr callback, ActorShared<> parent, double server_time_difference) diff --git a/td/mtproto/utils.h b/td/mtproto/utils.h index 97c9af31e..083f01c52 100644 --- a/td/mtproto/utils.h +++ b/td/mtproto/utils.h @@ -18,7 +18,7 @@ template using TLStorer = DefaultStorer; template -class TLObjectStorer : public Storer { +class TLObjectStorer final : public Storer { mutable size_t size_ = std::numeric_limits::max(); const T &object_; diff --git a/td/telegram/AnimationsManager.cpp b/td/telegram/AnimationsManager.cpp index 2f6d8aa9b..a75b554c9 100644 --- a/td/telegram/AnimationsManager.cpp +++ b/td/telegram/AnimationsManager.cpp @@ -38,7 +38,7 @@ namespace td { -class GetSavedGifsQuery : public Td::ResultHandler { +class GetSavedGifsQuery final : public Td::ResultHandler { bool is_repair_ = false; public: @@ -66,7 +66,7 @@ class GetSavedGifsQuery : public Td::ResultHandler { } }; -class SaveGifQuery : public Td::ResultHandler { +class SaveGifQuery final : public Td::ResultHandler { FileId file_id_; string file_reference_; bool unsave_ = false; diff --git a/td/telegram/AnimationsManager.h b/td/telegram/AnimationsManager.h index 4bff114cd..ee0ea546d 100644 --- a/td/telegram/AnimationsManager.h +++ b/td/telegram/AnimationsManager.h @@ -27,7 +27,7 @@ namespace td { class Td; -class AnimationsManager : public Actor { +class AnimationsManager final : public Actor { public: AnimationsManager(Td *td, ActorShared<> parent); diff --git a/td/telegram/AuthManager.h b/td/telegram/AuthManager.h index 66aeb4327..d1850f508 100644 --- a/td/telegram/AuthManager.h +++ b/td/telegram/AuthManager.h @@ -23,7 +23,7 @@ namespace td { -class AuthManager : public NetActor { +class AuthManager final : public NetActor { public: AuthManager(int32 api_id, const string &api_hash, ActorShared<> parent); diff --git a/td/telegram/AutoDownloadSettings.cpp b/td/telegram/AutoDownloadSettings.cpp index 79a5108c8..59ffe2386 100644 --- a/td/telegram/AutoDownloadSettings.cpp +++ b/td/telegram/AutoDownloadSettings.cpp @@ -30,7 +30,7 @@ static td_api::object_ptr convert_auto_download_se settings->video_upload_maxbitrate_, video_preload_large, audio_preload_next, phonecalls_less_data); } -class GetAutoDownloadSettingsQuery : public Td::ResultHandler { +class GetAutoDownloadSettingsQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -79,7 +79,7 @@ telegram_api::object_ptr get_input_auto_down settings.max_video_file_size, settings.max_other_file_size, settings.video_upload_bitrate); } -class SaveAutoDownloadSettingsQuery : public Td::ResultHandler { +class SaveAutoDownloadSettingsQuery final : public Td::ResultHandler { Promise promise_; public: diff --git a/td/telegram/BackgroundManager.cpp b/td/telegram/BackgroundManager.cpp index 328bcbfd8..0d8859d96 100644 --- a/td/telegram/BackgroundManager.cpp +++ b/td/telegram/BackgroundManager.cpp @@ -40,7 +40,7 @@ namespace td { -class GetBackgroundQuery : public Td::ResultHandler { +class GetBackgroundQuery final : public Td::ResultHandler { Promise promise_; BackgroundId background_id_; string background_name_; @@ -75,7 +75,7 @@ class GetBackgroundQuery : public Td::ResultHandler { } }; -class GetBackgroundsQuery : public Td::ResultHandler { +class GetBackgroundsQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -101,7 +101,7 @@ class GetBackgroundsQuery : public Td::ResultHandler { } }; -class InstallBackgroundQuery : public Td::ResultHandler { +class InstallBackgroundQuery final : public Td::ResultHandler { Promise promise_; public: @@ -128,7 +128,7 @@ class InstallBackgroundQuery : public Td::ResultHandler { } }; -class UploadBackgroundQuery : public Td::ResultHandler { +class UploadBackgroundQuery final : public Td::ResultHandler { Promise promise_; FileId file_id_; BackgroundType type_; @@ -174,7 +174,7 @@ class UploadBackgroundQuery : public Td::ResultHandler { } }; -class UnsaveBackgroundQuery : public Td::ResultHandler { +class UnsaveBackgroundQuery final : public Td::ResultHandler { Promise promise_; public: @@ -205,7 +205,7 @@ class UnsaveBackgroundQuery : public Td::ResultHandler { } }; -class ResetBackgroundsQuery : public Td::ResultHandler { +class ResetBackgroundsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -235,7 +235,7 @@ class ResetBackgroundsQuery : public Td::ResultHandler { } }; -class BackgroundManager::UploadBackgroundFileCallback : public FileManager::UploadCallback { +class BackgroundManager::UploadBackgroundFileCallback final : public FileManager::UploadCallback { public: void on_upload_ok(FileId file_id, tl_object_ptr input_file) final { send_closure_later(G()->background_manager(), &BackgroundManager::on_upload_background_file, file_id, diff --git a/td/telegram/BackgroundManager.h b/td/telegram/BackgroundManager.h index df1490d28..7df9486b4 100644 --- a/td/telegram/BackgroundManager.h +++ b/td/telegram/BackgroundManager.h @@ -29,7 +29,7 @@ namespace td { class Td; -class BackgroundManager : public Actor { +class BackgroundManager final : public Actor { public: BackgroundManager(Td *td, ActorShared<> parent); diff --git a/td/telegram/BotCommand.cpp b/td/telegram/BotCommand.cpp index af915cd07..4cf4e8193 100644 --- a/td/telegram/BotCommand.cpp +++ b/td/telegram/BotCommand.cpp @@ -22,7 +22,7 @@ namespace td { -class SetBotCommandsQuery : public Td::ResultHandler { +class SetBotCommandsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -52,7 +52,7 @@ class SetBotCommandsQuery : public Td::ResultHandler { } }; -class ResetBotCommandsQuery : public Td::ResultHandler { +class ResetBotCommandsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -78,7 +78,7 @@ class ResetBotCommandsQuery : public Td::ResultHandler { } }; -class GetBotCommandsQuery : public Td::ResultHandler { +class GetBotCommandsQuery final : public Td::ResultHandler { Promise> promise_; public: diff --git a/td/telegram/CallActor.h b/td/telegram/CallActor.h index a4e39f8b5..ffff2afae 100644 --- a/td/telegram/CallActor.h +++ b/td/telegram/CallActor.h @@ -89,7 +89,7 @@ struct CallState { tl_object_ptr get_call_state_object() const; }; -class CallActor : public NetQueryCallback { +class CallActor final : public NetQueryCallback { public: CallActor(CallId call_id, ActorShared<> parent, Promise promise); diff --git a/td/telegram/CallManager.h b/td/telegram/CallManager.h index 931b1b381..85fb3f6b2 100644 --- a/td/telegram/CallManager.h +++ b/td/telegram/CallManager.h @@ -22,7 +22,7 @@ namespace td { -class CallManager : public Actor { +class CallManager final : public Actor { public: using Update = telegram_api::object_ptr; explicit CallManager(ActorShared<> parent); diff --git a/td/telegram/CallbackQueriesManager.cpp b/td/telegram/CallbackQueriesManager.cpp index 145071fbd..38dfafab5 100644 --- a/td/telegram/CallbackQueriesManager.cpp +++ b/td/telegram/CallbackQueriesManager.cpp @@ -28,7 +28,7 @@ namespace td { -class GetBotCallbackAnswerQuery : public Td::ResultHandler { +class GetBotCallbackAnswerQuery final : public Td::ResultHandler { Promise promise_; int64 result_id_; DialogId dialog_id_; @@ -97,7 +97,7 @@ class GetBotCallbackAnswerQuery : public Td::ResultHandler { } }; -class SetBotCallbackAnswerQuery : public Td::ResultHandler { +class SetBotCallbackAnswerQuery final : public Td::ResultHandler { Promise promise_; public: diff --git a/td/telegram/Client.cpp b/td/telegram/Client.cpp index ff6cd82a5..503329d66 100644 --- a/td/telegram/Client.cpp +++ b/td/telegram/Client.cpp @@ -47,7 +47,7 @@ class TdReceiver { } unique_ptr create_callback(ClientManager::ClientId client_id) { - class Callback : public TdCallback { + class Callback final : public TdCallback { public: Callback(ClientManager::ClientId client_id, TdReceiver *impl) : client_id_(client_id), impl_(impl) { } @@ -231,7 +231,7 @@ class Client::Impl final { #else -class MultiTd : public Actor { +class MultiTd final : public Actor { public: explicit MultiTd(Td::Options options) : options_(std::move(options)) { } @@ -287,7 +287,7 @@ class TdReceiver { } unique_ptr create_callback(ClientManager::ClientId client_id) { - class Callback : public TdCallback { + class Callback final : public TdCallback { public: explicit Callback(ClientManager::ClientId client_id, std::shared_ptr output_queue) : client_id_(client_id), output_queue_(std::move(output_queue)) { diff --git a/td/telegram/ClientActor.h b/td/telegram/ClientActor.h index 9d211cd00..34ac11794 100644 --- a/td/telegram/ClientActor.h +++ b/td/telegram/ClientActor.h @@ -27,7 +27,7 @@ class Td; * This is a low-level Actor interface for interaction with TDLib. The interface is a lot more flexible than * the Client interface, however, for most usages the Client interface should be sufficient. */ -class ClientActor : public Actor { +class ClientActor final : public Actor { public: /// Options for ClientActor creation. struct Options { diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index 0299febe2..6bec29eb9 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -379,7 +379,7 @@ ActorOwn<> get_simple_config_firebase_firestore(Promise prom } ActorOwn<> get_full_config(DcOption option, Promise promise, ActorShared<> parent) { - class SessionCallback : public Session::Callback { + class SessionCallback final : public Session::Callback { public: SessionCallback(ActorShared<> parent, DcOption option) : parent_(std::move(parent)), option_(std::move(option)) { } @@ -417,7 +417,7 @@ ActorOwn<> get_full_config(DcOption option, Promise promise, ActorSh std::vector>> delay_forever_; }; - class SimpleAuthData : public AuthDataShared { + class SimpleAuthData final : public AuthDataShared { public: explicit SimpleAuthData(DcId dc_id) : dc_id_(dc_id) { } @@ -487,7 +487,7 @@ ActorOwn<> get_full_config(DcOption option, Promise promise, ActorSh } }; - class GetConfigActor : public NetQueryCallback { + class GetConfigActor final : public NetQueryCallback { public: GetConfigActor(DcOption option, Promise promise, ActorShared<> parent) : option_(std::move(option)), promise_(std::move(promise)), parent_(std::move(parent)) { @@ -542,7 +542,7 @@ ActorOwn<> get_full_config(DcOption option, Promise promise, ActorSh return ActorOwn<>(create_actor("GetConfigActor", option, std::move(promise), std::move(parent))); } -class ConfigRecoverer : public Actor { +class ConfigRecoverer final : public Actor { public: explicit ConfigRecoverer(ActorShared<> parent) : parent_(std::move(parent)) { connecting_since_ = Time::now(); @@ -840,7 +840,7 @@ class ConfigRecoverer : public Actor { } void start_up() final { - class StateCallback : public StateManager::Callback { + class StateCallback final : public StateManager::Callback { public: explicit StateCallback(ActorId parent) : parent_(std::move(parent)) { } diff --git a/td/telegram/ConfigManager.h b/td/telegram/ConfigManager.h index 0cf265ffa..65caf655b 100644 --- a/td/telegram/ConfigManager.h +++ b/td/telegram/ConfigManager.h @@ -83,7 +83,7 @@ using FullConfig = tl_object_ptr; ActorOwn<> get_full_config(DcId dc_id, IPAddress ip_address, Promise promise); class ConfigRecoverer; -class ConfigManager : public NetQueryCallback { +class ConfigManager final : public NetQueryCallback { public: explicit ConfigManager(ActorShared<> parent); diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 74d050ce7..8c887e680 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -75,7 +75,7 @@ namespace td { -class DismissSuggestionQuery : public Td::ResultHandler { +class DismissSuggestionQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -107,7 +107,7 @@ class DismissSuggestionQuery : public Td::ResultHandler { } }; -class SetAccountTtlQuery : public Td::ResultHandler { +class SetAccountTtlQuery final : public Td::ResultHandler { Promise promise_; public: @@ -138,7 +138,7 @@ class SetAccountTtlQuery : public Td::ResultHandler { } }; -class GetAccountTtlQuery : public Td::ResultHandler { +class GetAccountTtlQuery final : public Td::ResultHandler { Promise promise_; public: @@ -166,7 +166,7 @@ class GetAccountTtlQuery : public Td::ResultHandler { } }; -class AcceptLoginTokenQuery : public Td::ResultHandler { +class AcceptLoginTokenQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -193,7 +193,7 @@ class AcceptLoginTokenQuery : public Td::ResultHandler { } }; -class GetAuthorizationsQuery : public Td::ResultHandler { +class GetAuthorizationsQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -234,7 +234,7 @@ class GetAuthorizationsQuery : public Td::ResultHandler { } }; -class ResetAuthorizationQuery : public Td::ResultHandler { +class ResetAuthorizationQuery final : public Td::ResultHandler { Promise promise_; public: @@ -261,7 +261,7 @@ class ResetAuthorizationQuery : public Td::ResultHandler { } }; -class ResetAuthorizationsQuery : public Td::ResultHandler { +class ResetAuthorizationsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -289,7 +289,7 @@ class ResetAuthorizationsQuery : public Td::ResultHandler { } }; -class GetWebAuthorizationsQuery : public Td::ResultHandler { +class GetWebAuthorizationsQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -337,7 +337,7 @@ class GetWebAuthorizationsQuery : public Td::ResultHandler { } }; -class ResetWebAuthorizationQuery : public Td::ResultHandler { +class ResetWebAuthorizationQuery final : public Td::ResultHandler { Promise promise_; public: @@ -364,7 +364,7 @@ class ResetWebAuthorizationQuery : public Td::ResultHandler { } }; -class ResetWebAuthorizationsQuery : public Td::ResultHandler { +class ResetWebAuthorizationsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -391,7 +391,7 @@ class ResetWebAuthorizationsQuery : public Td::ResultHandler { } }; -class GetContactsQuery : public Td::ResultHandler { +class GetContactsQuery final : public Td::ResultHandler { public: void send(int32 hash) { LOG(INFO) << "Reload contacts with hash " << hash; @@ -415,7 +415,7 @@ class GetContactsQuery : public Td::ResultHandler { } }; -class GetContactsStatusesQuery : public Td::ResultHandler { +class GetContactsStatusesQuery final : public Td::ResultHandler { public: void send() { LOG(INFO) << "Reload contacts statuses"; @@ -438,7 +438,7 @@ class GetContactsStatusesQuery : public Td::ResultHandler { } }; -class AddContactQuery : public Td::ResultHandler { +class AddContactQuery final : public Td::ResultHandler { Promise promise_; UserId user_id_; @@ -475,7 +475,7 @@ class AddContactQuery : public Td::ResultHandler { } }; -class AcceptContactQuery : public Td::ResultHandler { +class AcceptContactQuery final : public Td::ResultHandler { Promise promise_; UserId user_id_; @@ -506,7 +506,7 @@ class AcceptContactQuery : public Td::ResultHandler { } }; -class ImportContactsQuery : public Td::ResultHandler { +class ImportContactsQuery final : public Td::ResultHandler { Promise promise_; vector input_contacts_; vector imported_user_ids_; @@ -609,7 +609,7 @@ class ImportContactsQuery : public Td::ResultHandler { } }; -class DeleteContactsQuery : public Td::ResultHandler { +class DeleteContactsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -637,7 +637,7 @@ class DeleteContactsQuery : public Td::ResultHandler { } }; -class DeleteContactsByPhoneNumberQuery : public Td::ResultHandler { +class DeleteContactsByPhoneNumberQuery final : public Td::ResultHandler { Promise promise_; vector user_ids_; @@ -674,7 +674,7 @@ class DeleteContactsByPhoneNumberQuery : public Td::ResultHandler { } }; -class ResetContactsQuery : public Td::ResultHandler { +class ResetContactsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -708,7 +708,7 @@ class ResetContactsQuery : public Td::ResultHandler { } }; -class SearchDialogsNearbyQuery : public Td::ResultHandler { +class SearchDialogsNearbyQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -742,7 +742,7 @@ class SearchDialogsNearbyQuery : public Td::ResultHandler { } }; -class UploadProfilePhotoQuery : public Td::ResultHandler { +class UploadProfilePhotoQuery final : public Td::ResultHandler { Promise promise_; FileId file_id_; @@ -795,7 +795,7 @@ class UploadProfilePhotoQuery : public Td::ResultHandler { } }; -class UpdateProfilePhotoQuery : public Td::ResultHandler { +class UpdateProfilePhotoQuery final : public Td::ResultHandler { Promise promise_; FileId file_id_; int64 old_photo_id_; @@ -849,7 +849,7 @@ class UpdateProfilePhotoQuery : public Td::ResultHandler { } }; -class DeleteProfilePhotoQuery : public Td::ResultHandler { +class DeleteProfilePhotoQuery final : public Td::ResultHandler { Promise promise_; int64 profile_photo_id_; @@ -885,7 +885,7 @@ class DeleteProfilePhotoQuery : public Td::ResultHandler { } }; -class UpdateProfileQuery : public Td::ResultHandler { +class UpdateProfileQuery final : public Td::ResultHandler { Promise promise_; int32 flags_; string first_name_; @@ -923,7 +923,7 @@ class UpdateProfileQuery : public Td::ResultHandler { } }; -class CheckUsernameQuery : public Td::ResultHandler { +class CheckUsernameQuery final : public Td::ResultHandler { Promise promise_; public: @@ -948,7 +948,7 @@ class CheckUsernameQuery : public Td::ResultHandler { } }; -class UpdateUsernameQuery : public Td::ResultHandler { +class UpdateUsernameQuery final : public Td::ResultHandler { Promise promise_; public: @@ -979,7 +979,7 @@ class UpdateUsernameQuery : public Td::ResultHandler { } }; -class CheckChannelUsernameQuery : public Td::ResultHandler { +class CheckChannelUsernameQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; string username_; @@ -1018,7 +1018,7 @@ class CheckChannelUsernameQuery : public Td::ResultHandler { } }; -class UpdateChannelUsernameQuery : public Td::ResultHandler { +class UpdateChannelUsernameQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; string username_; @@ -1066,7 +1066,7 @@ class UpdateChannelUsernameQuery : public Td::ResultHandler { } }; -class SetChannelStickerSetQuery : public Td::ResultHandler { +class SetChannelStickerSetQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; StickerSetId sticker_set_id_; @@ -1115,7 +1115,7 @@ class SetChannelStickerSetQuery : public Td::ResultHandler { } }; -class ToggleChannelSignaturesQuery : public Td::ResultHandler { +class ToggleChannelSignaturesQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -1155,7 +1155,7 @@ class ToggleChannelSignaturesQuery : public Td::ResultHandler { } }; -class TogglePrehistoryHiddenQuery : public Td::ResultHandler { +class TogglePrehistoryHiddenQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; bool is_all_history_available_; @@ -1208,7 +1208,7 @@ class TogglePrehistoryHiddenQuery : public Td::ResultHandler { } }; -class ConvertToGigagroupQuery : public Td::ResultHandler { +class ConvertToGigagroupQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -1247,7 +1247,7 @@ class ConvertToGigagroupQuery : public Td::ResultHandler { } }; -class EditChatAboutQuery : public Td::ResultHandler { +class EditChatAboutQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; string about_; @@ -1309,7 +1309,7 @@ class EditChatAboutQuery : public Td::ResultHandler { } }; -class SetDiscussionGroupQuery : public Td::ResultHandler { +class SetDiscussionGroupQuery final : public Td::ResultHandler { Promise promise_; ChannelId broadcast_channel_id_; ChannelId group_channel_id_; @@ -1348,7 +1348,7 @@ class SetDiscussionGroupQuery : public Td::ResultHandler { } }; -class EditLocationQuery : public Td::ResultHandler { +class EditLocationQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; DialogLocation location_; @@ -1387,7 +1387,7 @@ class EditLocationQuery : public Td::ResultHandler { } }; -class ToggleSlowModeQuery : public Td::ResultHandler { +class ToggleSlowModeQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; int32 slow_mode_delay_ = 0; @@ -1441,7 +1441,7 @@ class ToggleSlowModeQuery : public Td::ResultHandler { } }; -class ReportChannelSpamQuery : public Td::ResultHandler { +class ReportChannelSpamQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -1482,7 +1482,7 @@ class ReportChannelSpamQuery : public Td::ResultHandler { } }; -class DeleteChatQuery : public Td::ResultHandler { +class DeleteChatQuery final : public Td::ResultHandler { Promise promise_; public: @@ -1510,7 +1510,7 @@ class DeleteChatQuery : public Td::ResultHandler { } }; -class DeleteChannelQuery : public Td::ResultHandler { +class DeleteChannelQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -1542,7 +1542,7 @@ class DeleteChannelQuery : public Td::ResultHandler { } }; -class AddChatUserQuery : public Td::ResultHandler { +class AddChatUserQuery final : public Td::ResultHandler { Promise promise_; public: @@ -1571,7 +1571,7 @@ class AddChatUserQuery : public Td::ResultHandler { } }; -class EditChatAdminQuery : public Td::ResultHandler { +class EditChatAdminQuery final : public Td::ResultHandler { Promise promise_; ChatId chat_id_; @@ -1607,7 +1607,7 @@ class EditChatAdminQuery : public Td::ResultHandler { } }; -class ExportChatInviteQuery : public Td::ResultHandler { +class ExportChatInviteQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -1666,7 +1666,7 @@ class ExportChatInviteQuery : public Td::ResultHandler { } }; -class EditChatInviteLinkQuery : public Td::ResultHandler { +class EditChatInviteLinkQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -1718,7 +1718,7 @@ class EditChatInviteLinkQuery : public Td::ResultHandler { } }; -class GetExportedChatInviteQuery : public Td::ResultHandler { +class GetExportedChatInviteQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -1768,7 +1768,7 @@ class GetExportedChatInviteQuery : public Td::ResultHandler { } }; -class GetExportedChatInvitesQuery : public Td::ResultHandler { +class GetExportedChatInvitesQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -1836,7 +1836,7 @@ class GetExportedChatInvitesQuery : public Td::ResultHandler { } }; -class GetChatAdminWithInvitesQuery : public Td::ResultHandler { +class GetChatAdminWithInvitesQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -1886,7 +1886,7 @@ class GetChatAdminWithInvitesQuery : public Td::ResultHandler { } }; -class GetChatInviteImportersQuery : public Td::ResultHandler { +class GetChatInviteImportersQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -1947,7 +1947,7 @@ class GetChatInviteImportersQuery : public Td::ResultHandler { } }; -class RevokeChatInviteLinkQuery : public Td::ResultHandler { +class RevokeChatInviteLinkQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -2022,7 +2022,7 @@ class RevokeChatInviteLinkQuery : public Td::ResultHandler { } }; -class DeleteExportedChatInviteQuery : public Td::ResultHandler { +class DeleteExportedChatInviteQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -2056,7 +2056,7 @@ class DeleteExportedChatInviteQuery : public Td::ResultHandler { } }; -class DeleteRevokedExportedChatInvitesQuery : public Td::ResultHandler { +class DeleteRevokedExportedChatInvitesQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -2093,7 +2093,7 @@ class DeleteRevokedExportedChatInvitesQuery : public Td::ResultHandler { } }; -class CheckChatInviteQuery : public Td::ResultHandler { +class CheckChatInviteQuery final : public Td::ResultHandler { Promise promise_; string invite_link_; @@ -2124,7 +2124,7 @@ class CheckChatInviteQuery : public Td::ResultHandler { } }; -class ImportChatInviteQuery : public Td::ResultHandler { +class ImportChatInviteQuery final : public Td::ResultHandler { Promise promise_; string invite_link_; @@ -2168,7 +2168,7 @@ class ImportChatInviteQuery : public Td::ResultHandler { } }; -class DeleteChatUserQuery : public Td::ResultHandler { +class DeleteChatUserQuery final : public Td::ResultHandler { Promise promise_; public: @@ -2201,7 +2201,7 @@ class DeleteChatUserQuery : public Td::ResultHandler { } }; -class JoinChannelQuery : public Td::ResultHandler { +class JoinChannelQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -2234,7 +2234,7 @@ class JoinChannelQuery : public Td::ResultHandler { } }; -class InviteToChannelQuery : public Td::ResultHandler { +class InviteToChannelQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -2269,7 +2269,7 @@ class InviteToChannelQuery : public Td::ResultHandler { } }; -class EditChannelAdminQuery : public Td::ResultHandler { +class EditChannelAdminQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -2304,7 +2304,7 @@ class EditChannelAdminQuery : public Td::ResultHandler { } }; -class EditChannelBannedQuery : public Td::ResultHandler { +class EditChannelBannedQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -2339,7 +2339,7 @@ class EditChannelBannedQuery : public Td::ResultHandler { } }; -class LeaveChannelQuery : public Td::ResultHandler { +class LeaveChannelQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -2372,7 +2372,7 @@ class LeaveChannelQuery : public Td::ResultHandler { } }; -class CanEditChannelCreatorQuery : public Td::ResultHandler { +class CanEditChannelCreatorQuery final : public Td::ResultHandler { Promise promise_; public: @@ -2403,7 +2403,7 @@ class CanEditChannelCreatorQuery : public Td::ResultHandler { } }; -class EditChannelCreatorQuery : public Td::ResultHandler { +class EditChannelCreatorQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -2445,7 +2445,7 @@ class EditChannelCreatorQuery : public Td::ResultHandler { } }; -class MigrateChatQuery : public Td::ResultHandler { +class MigrateChatQuery final : public Td::ResultHandler { Promise promise_; public: @@ -2473,7 +2473,7 @@ class MigrateChatQuery : public Td::ResultHandler { } }; -class GetCreatedPublicChannelsQuery : public Td::ResultHandler { +class GetCreatedPublicChannelsQuery final : public Td::ResultHandler { Promise promise_; PublicDialogType type_; @@ -2527,7 +2527,7 @@ class GetCreatedPublicChannelsQuery : public Td::ResultHandler { } }; -class GetGroupsForDiscussionQuery : public Td::ResultHandler { +class GetGroupsForDiscussionQuery final : public Td::ResultHandler { Promise promise_; public: @@ -2571,7 +2571,7 @@ class GetGroupsForDiscussionQuery : public Td::ResultHandler { } }; -class GetInactiveChannelsQuery : public Td::ResultHandler { +class GetInactiveChannelsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -2602,7 +2602,7 @@ class GetInactiveChannelsQuery : public Td::ResultHandler { } }; -class GetUsersQuery : public Td::ResultHandler { +class GetUsersQuery final : public Td::ResultHandler { Promise promise_; public: @@ -2629,7 +2629,7 @@ class GetUsersQuery : public Td::ResultHandler { } }; -class GetFullUserQuery : public Td::ResultHandler { +class GetFullUserQuery final : public Td::ResultHandler { Promise promise_; public: @@ -2656,7 +2656,7 @@ class GetFullUserQuery : public Td::ResultHandler { } }; -class GetUserPhotosQuery : public Td::ResultHandler { +class GetUserPhotosQuery final : public Td::ResultHandler { Promise promise_; UserId user_id_; int32 offset_; @@ -2709,7 +2709,7 @@ class GetUserPhotosQuery : public Td::ResultHandler { } }; -class GetChatsQuery : public Td::ResultHandler { +class GetChatsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -2752,7 +2752,7 @@ class GetChatsQuery : public Td::ResultHandler { } }; -class GetFullChatQuery : public Td::ResultHandler { +class GetFullChatQuery final : public Td::ResultHandler { Promise promise_; ChatId chat_id_; @@ -2783,7 +2783,7 @@ class GetFullChatQuery : public Td::ResultHandler { } }; -class GetChannelsQuery : public Td::ResultHandler { +class GetChannelsQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -2836,7 +2836,7 @@ class GetChannelsQuery : public Td::ResultHandler { } }; -class GetFullChannelQuery : public Td::ResultHandler { +class GetFullChannelQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -2868,7 +2868,7 @@ class GetFullChannelQuery : public Td::ResultHandler { } }; -class GetChannelParticipantQuery : public Td::ResultHandler { +class GetChannelParticipantQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; DialogId participant_dialog_id_; @@ -2921,7 +2921,7 @@ class GetChannelParticipantQuery : public Td::ResultHandler { } }; -class GetChannelParticipantsQuery : public Td::ResultHandler { +class GetChannelParticipantsQuery final : public Td::ResultHandler { Promise> promise_; ChannelId channel_id_; @@ -2968,7 +2968,7 @@ class GetChannelParticipantsQuery : public Td::ResultHandler { } }; -class GetChannelAdministratorsQuery : public Td::ResultHandler { +class GetChannelAdministratorsQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -3038,7 +3038,7 @@ class GetChannelAdministratorsQuery : public Td::ResultHandler { } }; -class GetSupportUserQuery : public Td::ResultHandler { +class GetSupportUserQuery final : public Td::ResultHandler { Promise promise_; public: @@ -3180,7 +3180,7 @@ tl_object_ptr ContactsManager::convert_broadcast_ convert_stats_graph(std::move(obj->iv_interactions_graph_)), std::move(recent_message_interactions)); } -class GetMegagroupStatsQuery : public Td::ResultHandler { +class GetMegagroupStatsQuery final : public Td::ResultHandler { Promise> promise_; ChannelId channel_id_; @@ -3218,7 +3218,7 @@ class GetMegagroupStatsQuery : public Td::ResultHandler { } }; -class GetBroadcastStatsQuery : public Td::ResultHandler { +class GetBroadcastStatsQuery final : public Td::ResultHandler { Promise> promise_; ChannelId channel_id_; @@ -3267,7 +3267,7 @@ tl_object_ptr ContactsManager::convert_message_stats( return make_tl_object(convert_stats_graph(std::move(obj->views_graph_))); } -class GetMessageStatsQuery : public Td::ResultHandler { +class GetMessageStatsQuery final : public Td::ResultHandler { Promise> promise_; ChannelId channel_id_; @@ -3307,7 +3307,7 @@ class GetMessageStatsQuery : public Td::ResultHandler { } }; -class LoadAsyncGraphQuery : public Td::ResultHandler { +class LoadAsyncGraphQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -3338,7 +3338,7 @@ class LoadAsyncGraphQuery : public Td::ResultHandler { } }; -class ContactsManager::UploadProfilePhotoCallback : public FileManager::UploadCallback { +class ContactsManager::UploadProfilePhotoCallback final : public FileManager::UploadCallback { public: void on_upload_ok(FileId file_id, tl_object_ptr input_file) final { send_closure_later(G()->contacts_manager(), &ContactsManager::on_upload_profile_photo, file_id, diff --git a/td/telegram/ContactsManager.h b/td/telegram/ContactsManager.h index 4bfebe948..09561a5d5 100644 --- a/td/telegram/ContactsManager.h +++ b/td/telegram/ContactsManager.h @@ -58,7 +58,7 @@ struct BinlogEvent; class Td; -class ContactsManager : public Actor { +class ContactsManager final : public Actor { public: ContactsManager(Td *td, ActorShared<> parent); ContactsManager(const ContactsManager &) = delete; diff --git a/td/telegram/CountryInfoManager.cpp b/td/telegram/CountryInfoManager.cpp index 06f313fb3..6ae7e9302 100644 --- a/td/telegram/CountryInfoManager.cpp +++ b/td/telegram/CountryInfoManager.cpp @@ -25,7 +25,7 @@ namespace td { -class GetNearestDcQuery : public Td::ResultHandler { +class GetNearestDcQuery final : public Td::ResultHandler { Promise promise_; public: @@ -54,7 +54,7 @@ class GetNearestDcQuery : public Td::ResultHandler { } }; -class GetCountriesListQuery : public Td::ResultHandler { +class GetCountriesListQuery final : public Td::ResultHandler { Promise> promise_; public: diff --git a/td/telegram/CountryInfoManager.h b/td/telegram/CountryInfoManager.h index 48267ab98..22ee605df 100644 --- a/td/telegram/CountryInfoManager.h +++ b/td/telegram/CountryInfoManager.h @@ -21,7 +21,7 @@ namespace td { class Td; -class CountryInfoManager : public Actor { +class CountryInfoManager final : public Actor { public: CountryInfoManager(Td *td, ActorShared<> parent); diff --git a/td/telegram/DelayDispatcher.h b/td/telegram/DelayDispatcher.h index e96952106..a741b82e8 100644 --- a/td/telegram/DelayDispatcher.h +++ b/td/telegram/DelayDispatcher.h @@ -16,7 +16,7 @@ namespace td { -class DelayDispatcher : public Actor { +class DelayDispatcher final : public Actor { public: DelayDispatcher(double default_delay, ActorShared<> parent) : default_delay_(default_delay), parent_(std::move(parent)) { diff --git a/td/telegram/DeviceTokenManager.h b/td/telegram/DeviceTokenManager.h index bc5e70844..685dfac93 100644 --- a/td/telegram/DeviceTokenManager.h +++ b/td/telegram/DeviceTokenManager.h @@ -22,7 +22,7 @@ namespace td { -class DeviceTokenManager : public NetQueryCallback { +class DeviceTokenManager final : public NetQueryCallback { public: explicit DeviceTokenManager(ActorShared<> parent) : parent_(std::move(parent)) { } diff --git a/td/telegram/DhCache.h b/td/telegram/DhCache.h index 1e28e0dee..3fec6bfd4 100644 --- a/td/telegram/DhCache.h +++ b/td/telegram/DhCache.h @@ -12,7 +12,7 @@ namespace td { -class DhCache : public DhCallback { +class DhCache final : public DhCallback { public: int is_good_prime(Slice prime_str) const final; void add_good_prime(Slice prime_str) const final; diff --git a/td/telegram/DialogDb.cpp b/td/telegram/DialogDb.cpp index 4a81cac12..16bf177f2 100644 --- a/td/telegram/DialogDb.cpp +++ b/td/telegram/DialogDb.cpp @@ -117,7 +117,7 @@ Status drop_dialog_db(SqliteDb &db, int version) { return status; } -class DialogDbImpl : public DialogDbSyncInterface { +class DialogDbImpl final : public DialogDbSyncInterface { public: explicit DialogDbImpl(SqliteDb db) : db_(std::move(db)) { init().ensure(); @@ -313,7 +313,7 @@ class DialogDbImpl : public DialogDbSyncInterface { std::shared_ptr create_dialog_db_sync( std::shared_ptr sqlite_connection) { - class DialogDbSyncSafe : public DialogDbSyncSafeInterface { + class DialogDbSyncSafe final : public DialogDbSyncSafeInterface { public: explicit DialogDbSyncSafe(std::shared_ptr sqlite_connection) : lsls_db_([safe_connection = std::move(sqlite_connection)] { @@ -330,7 +330,7 @@ std::shared_ptr create_dialog_db_sync( return std::make_shared(std::move(sqlite_connection)); } -class DialogDbAsync : public DialogDbAsyncInterface { +class DialogDbAsync final : public DialogDbAsyncInterface { public: DialogDbAsync(std::shared_ptr sync_db, int32 scheduler_id) { impl_ = create_actor_on_scheduler("DialogDbActor", scheduler_id, std::move(sync_db)); @@ -370,7 +370,7 @@ class DialogDbAsync : public DialogDbAsyncInterface { } private: - class Impl : public Actor { + class Impl final : public Actor { public: explicit Impl(std::shared_ptr sync_db_safe) : sync_db_safe_(std::move(sync_db_safe)) { } diff --git a/td/telegram/FileReferenceManager.h b/td/telegram/FileReferenceManager.h index f9ad4a59a..9a5466f27 100644 --- a/td/telegram/FileReferenceManager.h +++ b/td/telegram/FileReferenceManager.h @@ -33,7 +33,7 @@ class Td; extern int VERBOSITY_NAME(file_references); -class FileReferenceManager : public Actor { +class FileReferenceManager final : public Actor { public: static bool is_file_reference_error(const Status &error); static size_t get_file_reference_error_pos(const Status &error); diff --git a/td/telegram/Global.h b/td/telegram/Global.h index efb4e96fc..ee4bbf17d 100644 --- a/td/telegram/Global.h +++ b/td/telegram/Global.h @@ -60,7 +60,7 @@ class WebPagesManager; namespace td { -class Global : public ActorContext { +class Global final : public ActorContext { public: Global(); ~Global() final; diff --git a/td/telegram/GroupCallManager.cpp b/td/telegram/GroupCallManager.cpp index 3d2046118..225335adf 100644 --- a/td/telegram/GroupCallManager.cpp +++ b/td/telegram/GroupCallManager.cpp @@ -31,7 +31,7 @@ namespace td { -class GetGroupCallStreamQuery : public Td::ResultHandler { +class GetGroupCallStreamQuery final : public Td::ResultHandler { Promise promise_; public: @@ -69,7 +69,7 @@ class GetGroupCallStreamQuery : public Td::ResultHandler { } }; -class GetGroupCallJoinAsQuery : public Td::ResultHandler { +class GetGroupCallJoinAsQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -123,7 +123,7 @@ class GetGroupCallJoinAsQuery : public Td::ResultHandler { } }; -class SaveDefaultGroupCallJoinAsQuery : public Td::ResultHandler { +class SaveDefaultGroupCallJoinAsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -159,7 +159,7 @@ class SaveDefaultGroupCallJoinAsQuery : public Td::ResultHandler { } }; -class CreateGroupCallQuery : public Td::ResultHandler { +class CreateGroupCallQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -218,7 +218,7 @@ class CreateGroupCallQuery : public Td::ResultHandler { } }; -class GetGroupCallQuery : public Td::ResultHandler { +class GetGroupCallQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -248,7 +248,7 @@ class GetGroupCallQuery : public Td::ResultHandler { } }; -class GetGroupCallParticipantQuery : public Td::ResultHandler { +class GetGroupCallParticipantQuery final : public Td::ResultHandler { Promise promise_; InputGroupCallId input_group_call_id_; @@ -281,7 +281,7 @@ class GetGroupCallParticipantQuery : public Td::ResultHandler { } }; -class GetGroupCallParticipantsQuery : public Td::ResultHandler { +class GetGroupCallParticipantsQuery final : public Td::ResultHandler { Promise promise_; InputGroupCallId input_group_call_id_; string offset_; @@ -315,7 +315,7 @@ class GetGroupCallParticipantsQuery : public Td::ResultHandler { } }; -class StartScheduledGroupCallQuery : public Td::ResultHandler { +class StartScheduledGroupCallQuery final : public Td::ResultHandler { Promise promise_; public: @@ -347,7 +347,7 @@ class StartScheduledGroupCallQuery : public Td::ResultHandler { } }; -class JoinGroupCallQuery : public Td::ResultHandler { +class JoinGroupCallQuery final : public Td::ResultHandler { Promise promise_; InputGroupCallId input_group_call_id_; DialogId as_dialog_id_; @@ -406,7 +406,7 @@ class JoinGroupCallQuery : public Td::ResultHandler { } }; -class JoinGroupCallPresentationQuery : public Td::ResultHandler { +class JoinGroupCallPresentationQuery final : public Td::ResultHandler { InputGroupCallId input_group_call_id_; uint64 generation_ = 0; @@ -441,7 +441,7 @@ class JoinGroupCallPresentationQuery : public Td::ResultHandler { } }; -class LeaveGroupCallPresentationQuery : public Td::ResultHandler { +class LeaveGroupCallPresentationQuery final : public Td::ResultHandler { Promise promise_; public: @@ -473,7 +473,7 @@ class LeaveGroupCallPresentationQuery : public Td::ResultHandler { } }; -class EditGroupCallTitleQuery : public Td::ResultHandler { +class EditGroupCallTitleQuery final : public Td::ResultHandler { Promise promise_; public: @@ -505,7 +505,7 @@ class EditGroupCallTitleQuery : public Td::ResultHandler { } }; -class ToggleGroupCallStartSubscriptionQuery : public Td::ResultHandler { +class ToggleGroupCallStartSubscriptionQuery final : public Td::ResultHandler { Promise promise_; public: @@ -537,7 +537,7 @@ class ToggleGroupCallStartSubscriptionQuery : public Td::ResultHandler { } }; -class ToggleGroupCallSettingsQuery : public Td::ResultHandler { +class ToggleGroupCallSettingsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -569,7 +569,7 @@ class ToggleGroupCallSettingsQuery : public Td::ResultHandler { } }; -class InviteToGroupCallQuery : public Td::ResultHandler { +class InviteToGroupCallQuery final : public Td::ResultHandler { Promise promise_; public: @@ -597,7 +597,7 @@ class InviteToGroupCallQuery : public Td::ResultHandler { } }; -class ExportGroupCallInviteQuery : public Td::ResultHandler { +class ExportGroupCallInviteQuery final : public Td::ResultHandler { Promise promise_; public: @@ -628,7 +628,7 @@ class ExportGroupCallInviteQuery : public Td::ResultHandler { } }; -class ToggleGroupCallRecordQuery : public Td::ResultHandler { +class ToggleGroupCallRecordQuery final : public Td::ResultHandler { Promise promise_; public: @@ -667,7 +667,7 @@ class ToggleGroupCallRecordQuery : public Td::ResultHandler { } }; -class EditGroupCallParticipantQuery : public Td::ResultHandler { +class EditGroupCallParticipantQuery final : public Td::ResultHandler { Promise promise_; public: @@ -719,7 +719,7 @@ class EditGroupCallParticipantQuery : public Td::ResultHandler { } }; -class CheckGroupCallQuery : public Td::ResultHandler { +class CheckGroupCallQuery final : public Td::ResultHandler { Promise promise_; public: @@ -755,7 +755,7 @@ class CheckGroupCallQuery : public Td::ResultHandler { } }; -class LeaveGroupCallQuery : public Td::ResultHandler { +class LeaveGroupCallQuery final : public Td::ResultHandler { Promise promise_; public: @@ -783,7 +783,7 @@ class LeaveGroupCallQuery : public Td::ResultHandler { } }; -class DiscardGroupCallQuery : public Td::ResultHandler { +class DiscardGroupCallQuery final : public Td::ResultHandler { Promise promise_; public: diff --git a/td/telegram/GroupCallManager.h b/td/telegram/GroupCallManager.h index d5e10f62c..7a932bff5 100644 --- a/td/telegram/GroupCallManager.h +++ b/td/telegram/GroupCallManager.h @@ -29,7 +29,7 @@ namespace td { class Td; -class GroupCallManager : public Actor { +class GroupCallManager final : public Actor { public: GroupCallManager(Td *td, ActorShared<> parent); GroupCallManager(const GroupCallManager &) = delete; diff --git a/td/telegram/HashtagHints.h b/td/telegram/HashtagHints.h index e6db5dd72..e77ff3acc 100644 --- a/td/telegram/HashtagHints.h +++ b/td/telegram/HashtagHints.h @@ -15,7 +15,7 @@ namespace td { -class HashtagHints : public Actor { +class HashtagHints final : public Actor { public: HashtagHints(string mode, ActorShared<> parent); diff --git a/td/telegram/InlineQueriesManager.cpp b/td/telegram/InlineQueriesManager.cpp index 24d9b496f..8d327886e 100644 --- a/td/telegram/InlineQueriesManager.cpp +++ b/td/telegram/InlineQueriesManager.cpp @@ -59,7 +59,7 @@ namespace td { -class GetInlineBotResultsQuery : public Td::ResultHandler { +class GetInlineBotResultsQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; UserId bot_user_id_; @@ -116,7 +116,7 @@ class GetInlineBotResultsQuery : public Td::ResultHandler { } }; -class SetInlineBotResultsQuery : public Td::ResultHandler { +class SetInlineBotResultsQuery final : public Td::ResultHandler { Promise promise_; public: diff --git a/td/telegram/InlineQueriesManager.h b/td/telegram/InlineQueriesManager.h index eabe1f193..5d648b7f3 100644 --- a/td/telegram/InlineQueriesManager.h +++ b/td/telegram/InlineQueriesManager.h @@ -35,7 +35,7 @@ class Td; class Game; -class InlineQueriesManager : public Actor { +class InlineQueriesManager final : public Actor { public: InlineQueriesManager(Td *td, ActorShared<> parent); diff --git a/td/telegram/JsonValue.cpp b/td/telegram/JsonValue.cpp index 93692ed80..bd209e908 100644 --- a/td/telegram/JsonValue.cpp +++ b/td/telegram/JsonValue.cpp @@ -135,7 +135,7 @@ tl_object_ptr convert_json_value(td_api::object_ptr parent) : parent_(std::move(parent)) { } diff --git a/td/telegram/LinkManager.cpp b/td/telegram/LinkManager.cpp index 7f2e25371..5d05e9880 100644 --- a/td/telegram/LinkManager.cpp +++ b/td/telegram/LinkManager.cpp @@ -64,13 +64,13 @@ static bool is_valid_username(Slice username) { return true; } -class LinkManager::InternalLinkActiveSessions : public InternalLink { +class LinkManager::InternalLinkActiveSessions final : public InternalLink { td_api::object_ptr get_internal_link_type_object() const final { return td_api::make_object(); } }; -class LinkManager::InternalLinkAuthenticationCode : public InternalLink { +class LinkManager::InternalLinkAuthenticationCode final : public InternalLink { string code_; td_api::object_ptr get_internal_link_type_object() const final { @@ -82,7 +82,7 @@ class LinkManager::InternalLinkAuthenticationCode : public InternalLink { } }; -class LinkManager::InternalLinkBackground : public InternalLink { +class LinkManager::InternalLinkBackground final : public InternalLink { string background_name_; td_api::object_ptr get_internal_link_type_object() const final { @@ -94,7 +94,7 @@ class LinkManager::InternalLinkBackground : public InternalLink { } }; -class LinkManager::InternalLinkBotStart : public InternalLink { +class LinkManager::InternalLinkBotStart final : public InternalLink { string bot_username_; string start_parameter_; @@ -108,7 +108,7 @@ class LinkManager::InternalLinkBotStart : public InternalLink { } }; -class LinkManager::InternalLinkBotStartInGroup : public InternalLink { +class LinkManager::InternalLinkBotStartInGroup final : public InternalLink { string bot_username_; string start_parameter_; @@ -122,13 +122,13 @@ class LinkManager::InternalLinkBotStartInGroup : public InternalLink { } }; -class LinkManager::InternalLinkChangePhoneNumber : public InternalLink { +class LinkManager::InternalLinkChangePhoneNumber final : public InternalLink { td_api::object_ptr get_internal_link_type_object() const final { return td_api::make_object(); } }; -class LinkManager::InternalLinkConfirmPhone : public InternalLink { +class LinkManager::InternalLinkConfirmPhone final : public InternalLink { string hash_; string phone_number_; @@ -142,19 +142,19 @@ class LinkManager::InternalLinkConfirmPhone : public InternalLink { } }; -class LinkManager::InternalLinkDialogInvite : public InternalLink { +class LinkManager::InternalLinkDialogInvite final : public InternalLink { td_api::object_ptr get_internal_link_type_object() const final { return td_api::make_object(); } }; -class LinkManager::InternalLinkFilterSettings : public InternalLink { +class LinkManager::InternalLinkFilterSettings final : public InternalLink { td_api::object_ptr get_internal_link_type_object() const final { return td_api::make_object(); } }; -class LinkManager::InternalLinkGame : public InternalLink { +class LinkManager::InternalLinkGame final : public InternalLink { string bot_username_; string game_short_name_; @@ -168,7 +168,7 @@ class LinkManager::InternalLinkGame : public InternalLink { } }; -class LinkManager::InternalLinkLanguage : public InternalLink { +class LinkManager::InternalLinkLanguage final : public InternalLink { string language_pack_id_; td_api::object_ptr get_internal_link_type_object() const final { @@ -180,13 +180,13 @@ class LinkManager::InternalLinkLanguage : public InternalLink { } }; -class LinkManager::InternalLinkMessage : public InternalLink { +class LinkManager::InternalLinkMessage final : public InternalLink { td_api::object_ptr get_internal_link_type_object() const final { return td_api::make_object(); } }; -class LinkManager::InternalLinkMessageDraft : public InternalLink { +class LinkManager::InternalLinkMessageDraft final : public InternalLink { FormattedText text_; bool contains_link_ = false; @@ -200,7 +200,7 @@ class LinkManager::InternalLinkMessageDraft : public InternalLink { } }; -class LinkManager::InternalLinkPassportDataRequest : public InternalLink { +class LinkManager::InternalLinkPassportDataRequest final : public InternalLink { UserId bot_user_id_; string scope_; string public_key_; @@ -223,7 +223,7 @@ class LinkManager::InternalLinkPassportDataRequest : public InternalLink { } }; -class LinkManager::InternalLinkProxy : public InternalLink { +class LinkManager::InternalLinkProxy final : public InternalLink { string server_; int32 port_; td_api::object_ptr type_; @@ -254,7 +254,7 @@ class LinkManager::InternalLinkProxy : public InternalLink { } }; -class LinkManager::InternalLinkPublicDialog : public InternalLink { +class LinkManager::InternalLinkPublicDialog final : public InternalLink { string dialog_username_; td_api::object_ptr get_internal_link_type_object() const final { @@ -266,19 +266,19 @@ class LinkManager::InternalLinkPublicDialog : public InternalLink { } }; -class LinkManager::InternalLinkQrCodeAuthentication : public InternalLink { +class LinkManager::InternalLinkQrCodeAuthentication final : public InternalLink { td_api::object_ptr get_internal_link_type_object() const final { return td_api::make_object(); } }; -class LinkManager::InternalLinkSettings : public InternalLink { +class LinkManager::InternalLinkSettings final : public InternalLink { td_api::object_ptr get_internal_link_type_object() const final { return td_api::make_object(); } }; -class LinkManager::InternalLinkStickerSet : public InternalLink { +class LinkManager::InternalLinkStickerSet final : public InternalLink { string sticker_set_name_; td_api::object_ptr get_internal_link_type_object() const final { @@ -290,7 +290,7 @@ class LinkManager::InternalLinkStickerSet : public InternalLink { } }; -class LinkManager::InternalLinkTheme : public InternalLink { +class LinkManager::InternalLinkTheme final : public InternalLink { string theme_name_; td_api::object_ptr get_internal_link_type_object() const final { @@ -302,19 +302,19 @@ class LinkManager::InternalLinkTheme : public InternalLink { } }; -class LinkManager::InternalLinkThemeSettings : public InternalLink { +class LinkManager::InternalLinkThemeSettings final : public InternalLink { td_api::object_ptr get_internal_link_type_object() const final { return td_api::make_object(); } }; -class LinkManager::InternalLinkUnknownDeepLink : public InternalLink { +class LinkManager::InternalLinkUnknownDeepLink final : public InternalLink { td_api::object_ptr get_internal_link_type_object() const final { return td_api::make_object(); } }; -class LinkManager::InternalLinkVoiceChat : public InternalLink { +class LinkManager::InternalLinkVoiceChat final : public InternalLink { string dialog_username_; string invite_hash_; @@ -328,7 +328,7 @@ class LinkManager::InternalLinkVoiceChat : public InternalLink { } }; -class RequestUrlAuthQuery : public Td::ResultHandler { +class RequestUrlAuthQuery final : public Td::ResultHandler { Promise> promise_; string url_; DialogId dialog_id_; @@ -398,7 +398,7 @@ class RequestUrlAuthQuery : public Td::ResultHandler { } }; -class AcceptUrlAuthQuery : public Td::ResultHandler { +class AcceptUrlAuthQuery final : public Td::ResultHandler { Promise> promise_; string url_; DialogId dialog_id_; diff --git a/td/telegram/LinkManager.h b/td/telegram/LinkManager.h index 7aaf23a48..8ae0cccc5 100644 --- a/td/telegram/LinkManager.h +++ b/td/telegram/LinkManager.h @@ -23,7 +23,7 @@ namespace td { class Td; -class LinkManager : public Actor { +class LinkManager final : public Actor { public: LinkManager(Td *td, ActorShared<> parent); diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index c95a6e9dc..3aac32f07 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -88,7 +88,7 @@ namespace td { -class MessageText : public MessageContent { +class MessageText final : public MessageContent { public: FormattedText text; WebPageId web_page_id; @@ -102,7 +102,7 @@ class MessageText : public MessageContent { } }; -class MessageAnimation : public MessageContent { +class MessageAnimation final : public MessageContent { public: FileId file_id; @@ -117,7 +117,7 @@ class MessageAnimation : public MessageContent { } }; -class MessageAudio : public MessageContent { +class MessageAudio final : public MessageContent { public: FileId file_id; @@ -132,7 +132,7 @@ class MessageAudio : public MessageContent { } }; -class MessageDocument : public MessageContent { +class MessageDocument final : public MessageContent { public: FileId file_id; @@ -147,7 +147,7 @@ class MessageDocument : public MessageContent { } }; -class MessagePhoto : public MessageContent { +class MessagePhoto final : public MessageContent { public: Photo photo; @@ -162,7 +162,7 @@ class MessagePhoto : public MessageContent { } }; -class MessageSticker : public MessageContent { +class MessageSticker final : public MessageContent { public: FileId file_id; @@ -175,7 +175,7 @@ class MessageSticker : public MessageContent { } }; -class MessageVideo : public MessageContent { +class MessageVideo final : public MessageContent { public: FileId file_id; @@ -190,7 +190,7 @@ class MessageVideo : public MessageContent { } }; -class MessageVoiceNote : public MessageContent { +class MessageVoiceNote final : public MessageContent { public: FileId file_id; @@ -207,7 +207,7 @@ class MessageVoiceNote : public MessageContent { } }; -class MessageContact : public MessageContent { +class MessageContact final : public MessageContent { public: Contact contact; @@ -220,7 +220,7 @@ class MessageContact : public MessageContent { } }; -class MessageLocation : public MessageContent { +class MessageLocation final : public MessageContent { public: Location location; @@ -233,7 +233,7 @@ class MessageLocation : public MessageContent { } }; -class MessageVenue : public MessageContent { +class MessageVenue final : public MessageContent { public: Venue venue; @@ -246,7 +246,7 @@ class MessageVenue : public MessageContent { } }; -class MessageChatCreate : public MessageContent { +class MessageChatCreate final : public MessageContent { public: string title; vector participant_user_ids; @@ -261,7 +261,7 @@ class MessageChatCreate : public MessageContent { } }; -class MessageChatChangeTitle : public MessageContent { +class MessageChatChangeTitle final : public MessageContent { public: string title; @@ -274,7 +274,7 @@ class MessageChatChangeTitle : public MessageContent { } }; -class MessageChatChangePhoto : public MessageContent { +class MessageChatChangePhoto final : public MessageContent { public: Photo photo; @@ -287,21 +287,21 @@ class MessageChatChangePhoto : public MessageContent { } }; -class MessageChatDeletePhoto : public MessageContent { +class MessageChatDeletePhoto final : public MessageContent { public: MessageContentType get_type() const final { return MessageContentType::ChatDeletePhoto; } }; -class MessageChatDeleteHistory : public MessageContent { +class MessageChatDeleteHistory final : public MessageContent { public: MessageContentType get_type() const final { return MessageContentType::ChatDeleteHistory; } }; -class MessageChatAddUsers : public MessageContent { +class MessageChatAddUsers final : public MessageContent { public: vector user_ids; @@ -314,14 +314,14 @@ class MessageChatAddUsers : public MessageContent { } }; -class MessageChatJoinedByLink : public MessageContent { +class MessageChatJoinedByLink final : public MessageContent { public: MessageContentType get_type() const final { return MessageContentType::ChatJoinedByLink; } }; -class MessageChatDeleteUser : public MessageContent { +class MessageChatDeleteUser final : public MessageContent { public: UserId user_id; @@ -334,7 +334,7 @@ class MessageChatDeleteUser : public MessageContent { } }; -class MessageChatMigrateTo : public MessageContent { +class MessageChatMigrateTo final : public MessageContent { public: ChannelId migrated_to_channel_id; @@ -347,7 +347,7 @@ class MessageChatMigrateTo : public MessageContent { } }; -class MessageChannelCreate : public MessageContent { +class MessageChannelCreate final : public MessageContent { public: string title; @@ -360,7 +360,7 @@ class MessageChannelCreate : public MessageContent { } }; -class MessageChannelMigrateFrom : public MessageContent { +class MessageChannelMigrateFrom final : public MessageContent { public: string title; ChatId migrated_from_chat_id; @@ -375,7 +375,7 @@ class MessageChannelMigrateFrom : public MessageContent { } }; -class MessagePinMessage : public MessageContent { +class MessagePinMessage final : public MessageContent { public: MessageId message_id; @@ -388,7 +388,7 @@ class MessagePinMessage : public MessageContent { } }; -class MessageGame : public MessageContent { +class MessageGame final : public MessageContent { public: Game game; @@ -401,7 +401,7 @@ class MessageGame : public MessageContent { } }; -class MessageGameScore : public MessageContent { +class MessageGameScore final : public MessageContent { public: MessageId game_message_id; int64 game_id; @@ -417,14 +417,14 @@ class MessageGameScore : public MessageContent { } }; -class MessageScreenshotTaken : public MessageContent { +class MessageScreenshotTaken final : public MessageContent { public: MessageContentType get_type() const final { return MessageContentType::ScreenshotTaken; } }; -class MessageChatSetTtl : public MessageContent { +class MessageChatSetTtl final : public MessageContent { public: int32 ttl; @@ -437,7 +437,7 @@ class MessageChatSetTtl : public MessageContent { } }; -class MessageUnsupported : public MessageContent { +class MessageUnsupported final : public MessageContent { public: static constexpr int32 CURRENT_VERSION = 7; int32 version = CURRENT_VERSION; @@ -451,7 +451,7 @@ class MessageUnsupported : public MessageContent { } }; -class MessageCall : public MessageContent { +class MessageCall final : public MessageContent { public: int64 call_id; int32 duration; @@ -468,7 +468,7 @@ class MessageCall : public MessageContent { } }; -class MessageInvoice : public MessageContent { +class MessageInvoice final : public MessageContent { public: InputInvoice input_invoice; @@ -481,7 +481,7 @@ class MessageInvoice : public MessageContent { } }; -class MessagePaymentSuccessful : public MessageContent { +class MessagePaymentSuccessful final : public MessageContent { public: DialogId invoice_dialog_id; MessageId invoice_message_id; @@ -509,7 +509,7 @@ class MessagePaymentSuccessful : public MessageContent { } }; -class MessageVideoNote : public MessageContent { +class MessageVideoNote final : public MessageContent { public: FileId file_id; @@ -524,14 +524,14 @@ class MessageVideoNote : public MessageContent { } }; -class MessageContactRegistered : public MessageContent { +class MessageContactRegistered final : public MessageContent { public: MessageContentType get_type() const final { return MessageContentType::ContactRegistered; } }; -class MessageExpiredPhoto : public MessageContent { +class MessageExpiredPhoto final : public MessageContent { public: MessageExpiredPhoto() = default; @@ -540,7 +540,7 @@ class MessageExpiredPhoto : public MessageContent { } }; -class MessageExpiredVideo : public MessageContent { +class MessageExpiredVideo final : public MessageContent { public: MessageExpiredVideo() = default; @@ -549,7 +549,7 @@ class MessageExpiredVideo : public MessageContent { } }; -class MessageLiveLocation : public MessageContent { +class MessageLiveLocation final : public MessageContent { public: Location location; int32 period = 0; @@ -579,7 +579,7 @@ class MessageLiveLocation : public MessageContent { } }; -class MessageCustomServiceAction : public MessageContent { +class MessageCustomServiceAction final : public MessageContent { public: string message; @@ -592,7 +592,7 @@ class MessageCustomServiceAction : public MessageContent { } }; -class MessageWebsiteConnected : public MessageContent { +class MessageWebsiteConnected final : public MessageContent { public: string domain_name; @@ -605,7 +605,7 @@ class MessageWebsiteConnected : public MessageContent { } }; -class MessagePassportDataSent : public MessageContent { +class MessagePassportDataSent final : public MessageContent { public: vector types; @@ -618,7 +618,7 @@ class MessagePassportDataSent : public MessageContent { } }; -class MessagePassportDataReceived : public MessageContent { +class MessagePassportDataReceived final : public MessageContent { public: vector values; EncryptedSecureCredentials credentials; @@ -633,7 +633,7 @@ class MessagePassportDataReceived : public MessageContent { } }; -class MessagePoll : public MessageContent { +class MessagePoll final : public MessageContent { public: PollId poll_id; @@ -646,7 +646,7 @@ class MessagePoll : public MessageContent { } }; -class MessageDice : public MessageContent { +class MessageDice final : public MessageContent { public: string emoji; int32 dice_value = 0; @@ -676,7 +676,7 @@ class MessageDice : public MessageContent { constexpr const char *MessageDice::DEFAULT_EMOJI; -class MessageProximityAlertTriggered : public MessageContent { +class MessageProximityAlertTriggered final : public MessageContent { public: DialogId traveler_dialog_id; DialogId watcher_dialog_id; @@ -692,7 +692,7 @@ class MessageProximityAlertTriggered : public MessageContent { } }; -class MessageGroupCall : public MessageContent { +class MessageGroupCall final : public MessageContent { public: InputGroupCallId input_group_call_id; int32 duration = -1; @@ -708,7 +708,7 @@ class MessageGroupCall : public MessageContent { } }; -class MessageInviteToGroupCall : public MessageContent { +class MessageInviteToGroupCall final : public MessageContent { public: InputGroupCallId input_group_call_id; vector user_ids; diff --git a/td/telegram/MessagesDb.cpp b/td/telegram/MessagesDb.cpp index 1cd2a5853..1c67f58ce 100644 --- a/td/telegram/MessagesDb.cpp +++ b/td/telegram/MessagesDb.cpp @@ -177,7 +177,7 @@ Status drop_messages_db(SqliteDb &db, int32 version) { return db.exec("DROP TABLE IF EXISTS messages"); } -class MessagesDbImpl : public MessagesDbSyncInterface { +class MessagesDbImpl final : public MessagesDbSyncInterface { public: explicit MessagesDbImpl(SqliteDb db) : db_(std::move(db)) { init().ensure(); @@ -925,7 +925,7 @@ class MessagesDbImpl : public MessagesDbSyncInterface { std::shared_ptr create_messages_db_sync( std::shared_ptr sqlite_connection) { - class MessagesDbSyncSafe : public MessagesDbSyncSafeInterface { + class MessagesDbSyncSafe final : public MessagesDbSyncSafeInterface { public: explicit MessagesDbSyncSafe(std::shared_ptr sqlite_connection) : lsls_db_([safe_connection = std::move(sqlite_connection)] { @@ -942,7 +942,7 @@ std::shared_ptr create_messages_db_sync( return std::make_shared(std::move(sqlite_connection)); } -class MessagesDbAsync : public MessagesDbAsyncInterface { +class MessagesDbAsync final : public MessagesDbAsyncInterface { public: MessagesDbAsync(std::shared_ptr sync_db, int32 scheduler_id) { impl_ = create_actor_on_scheduler("MessagesDbActor", scheduler_id, std::move(sync_db)); @@ -1017,7 +1017,7 @@ class MessagesDbAsync : public MessagesDbAsyncInterface { } private: - class Impl : public Actor { + class Impl final : public Actor { public: explicit Impl(std::shared_ptr sync_db_safe) : sync_db_safe_(std::move(sync_db_safe)) { } diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index d72356fcf..9b8f825d6 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -84,7 +84,7 @@ namespace td { -class GetDialogFiltersQuery : public Td::ResultHandler { +class GetDialogFiltersQuery final : public Td::ResultHandler { Promise>> promise_; public: @@ -110,7 +110,7 @@ class GetDialogFiltersQuery : public Td::ResultHandler { } }; -class UpdateDialogFilterQuery : public Td::ResultHandler { +class UpdateDialogFilterQuery final : public Td::ResultHandler { Promise promise_; public: @@ -142,7 +142,7 @@ class UpdateDialogFilterQuery : public Td::ResultHandler { } }; -class UpdateDialogFiltersOrderQuery : public Td::ResultHandler { +class UpdateDialogFiltersOrderQuery final : public Td::ResultHandler { Promise promise_; public: @@ -169,7 +169,7 @@ class UpdateDialogFiltersOrderQuery : public Td::ResultHandler { } }; -class GetSuggestedDialogFiltersQuery : public Td::ResultHandler { +class GetSuggestedDialogFiltersQuery final : public Td::ResultHandler { Promise>> promise_; public: @@ -195,7 +195,7 @@ class GetSuggestedDialogFiltersQuery : public Td::ResultHandler { } }; -class GetOnlinesQuery : public Td::ResultHandler { +class GetOnlinesQuery final : public Td::ResultHandler { DialogId dialog_id_; public: @@ -226,7 +226,7 @@ class GetOnlinesQuery : public Td::ResultHandler { } }; -class GetAllDraftsQuery : public Td::ResultHandler { +class GetAllDraftsQuery final : public Td::ResultHandler { public: void send() { send_query(G()->net_query_creator().create(telegram_api::messages_getAllDrafts())); @@ -251,7 +251,7 @@ class GetAllDraftsQuery : public Td::ResultHandler { } }; -class GetDialogQuery : public Td::ResultHandler { +class GetDialogQuery final : public Td::ResultHandler { DialogId dialog_id_; public: @@ -293,7 +293,7 @@ class GetDialogQuery : public Td::ResultHandler { } }; -class GetDialogsQuery : public Td::ResultHandler { +class GetDialogsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -329,7 +329,7 @@ class GetDialogsQuery : public Td::ResultHandler { } }; -class GetPinnedDialogsActor : public NetActorOnce { +class GetPinnedDialogsActor final : public NetActorOnce { FolderId folder_id_; Promise promise_; @@ -366,7 +366,7 @@ class GetPinnedDialogsActor : public NetActorOnce { } }; -class GetDialogUnreadMarksQuery : public Td::ResultHandler { +class GetDialogUnreadMarksQuery final : public Td::ResultHandler { public: void send() { send_query(G()->net_query_creator().create(telegram_api::messages_getDialogUnreadMarks())); @@ -394,7 +394,7 @@ class GetDialogUnreadMarksQuery : public Td::ResultHandler { } }; -class GetDiscussionMessageQuery : public Td::ResultHandler { +class GetDiscussionMessageQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; MessageId message_id_; @@ -435,7 +435,7 @@ class GetDiscussionMessageQuery : public Td::ResultHandler { } }; -class GetMessagesQuery : public Td::ResultHandler { +class GetMessagesQuery final : public Td::ResultHandler { Promise promise_; public: @@ -469,7 +469,7 @@ class GetMessagesQuery : public Td::ResultHandler { } }; -class GetChannelMessagesQuery : public Td::ResultHandler { +class GetChannelMessagesQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -530,7 +530,7 @@ class GetChannelMessagesQuery : public Td::ResultHandler { } }; -class GetScheduledMessagesQuery : public Td::ResultHandler { +class GetScheduledMessagesQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -570,7 +570,7 @@ class GetScheduledMessagesQuery : public Td::ResultHandler { } }; -class UpdateDialogPinnedMessageQuery : public Td::ResultHandler { +class UpdateDialogPinnedMessageQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -618,7 +618,7 @@ class UpdateDialogPinnedMessageQuery : public Td::ResultHandler { } }; -class UnpinAllMessagesQuery : public Td::ResultHandler { +class UnpinAllMessagesQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -679,7 +679,7 @@ class UnpinAllMessagesQuery : public Td::ResultHandler { } }; -class ExportChannelMessageLinkQuery : public Td::ResultHandler { +class ExportChannelMessageLinkQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; MessageId message_id_; @@ -730,7 +730,7 @@ class ExportChannelMessageLinkQuery : public Td::ResultHandler { } }; -class GetDialogListActor : public NetActorOnce { +class GetDialogListActor final : public NetActorOnce { FolderId folder_id_; Promise promise_; @@ -792,7 +792,7 @@ class GetDialogListActor : public NetActorOnce { } }; -class SearchPublicDialogsQuery : public Td::ResultHandler { +class SearchPublicDialogsQuery final : public Td::ResultHandler { string query_; public: @@ -823,7 +823,7 @@ class SearchPublicDialogsQuery : public Td::ResultHandler { } }; -class GetCommonDialogsQuery : public Td::ResultHandler { +class GetCommonDialogsQuery final : public Td::ResultHandler { Promise promise_; UserId user_id_; int32 offset_chat_id_ = 0; @@ -877,7 +877,7 @@ class GetCommonDialogsQuery : public Td::ResultHandler { } }; -class GetBlockedDialogsQuery : public Td::ResultHandler { +class GetBlockedDialogsQuery final : public Td::ResultHandler { Promise promise_; int32 offset_; int32 limit_; @@ -937,7 +937,7 @@ class GetBlockedDialogsQuery : public Td::ResultHandler { } }; -class CreateChatQuery : public Td::ResultHandler { +class CreateChatQuery final : public Td::ResultHandler { Promise promise_; int64 random_id_; @@ -967,7 +967,7 @@ class CreateChatQuery : public Td::ResultHandler { } }; -class CreateChannelQuery : public Td::ResultHandler { +class CreateChannelQuery final : public Td::ResultHandler { Promise promise_; int64 random_id_; @@ -1013,7 +1013,7 @@ class CreateChannelQuery : public Td::ResultHandler { } }; -class CheckHistoryImportQuery : public Td::ResultHandler { +class CheckHistoryImportQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -1050,7 +1050,7 @@ class CheckHistoryImportQuery : public Td::ResultHandler { } }; -class CheckHistoryImportPeerQuery : public Td::ResultHandler { +class CheckHistoryImportPeerQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -1082,7 +1082,7 @@ class CheckHistoryImportPeerQuery : public Td::ResultHandler { } }; -class InitHistoryImportQuery : public Td::ResultHandler { +class InitHistoryImportQuery final : public Td::ResultHandler { Promise promise_; FileId file_id_; DialogId dialog_id_; @@ -1133,7 +1133,7 @@ class InitHistoryImportQuery : public Td::ResultHandler { } }; -class UploadImportedMediaQuery : public Td::ResultHandler { +class UploadImportedMediaQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; int64 import_id_; @@ -1186,7 +1186,7 @@ class UploadImportedMediaQuery : public Td::ResultHandler { } }; -class StartImportHistoryQuery : public Td::ResultHandler { +class StartImportHistoryQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -1222,7 +1222,7 @@ class StartImportHistoryQuery : public Td::ResultHandler { } }; -class EditDialogPhotoQuery : public Td::ResultHandler { +class EditDialogPhotoQuery final : public Td::ResultHandler { Promise promise_; FileId file_id_; bool was_uploaded_ = false; @@ -1306,7 +1306,7 @@ class EditDialogPhotoQuery : public Td::ResultHandler { } }; -class EditDialogTitleQuery : public Td::ResultHandler { +class EditDialogTitleQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -1362,7 +1362,7 @@ class EditDialogTitleQuery : public Td::ResultHandler { } }; -class SetHistoryTtlQuery : public Td::ResultHandler { +class SetHistoryTtlQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -1403,7 +1403,7 @@ class SetHistoryTtlQuery : public Td::ResultHandler { } }; -class EditChatDefaultBannedRightsQuery : public Td::ResultHandler { +class EditChatDefaultBannedRightsQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -1443,7 +1443,7 @@ class EditChatDefaultBannedRightsQuery : public Td::ResultHandler { } }; -class SaveDraftMessageQuery : public Td::ResultHandler { +class SaveDraftMessageQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -1507,7 +1507,7 @@ class SaveDraftMessageQuery : public Td::ResultHandler { } }; -class ClearAllDraftsQuery : public Td::ResultHandler { +class ClearAllDraftsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -1542,7 +1542,7 @@ class ClearAllDraftsQuery : public Td::ResultHandler { } }; -class ToggleDialogPinQuery : public Td::ResultHandler { +class ToggleDialogPinQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; bool is_pinned_; @@ -1592,7 +1592,7 @@ class ToggleDialogPinQuery : public Td::ResultHandler { } }; -class ReorderPinnedDialogsQuery : public Td::ResultHandler { +class ReorderPinnedDialogsQuery final : public Td::ResultHandler { FolderId folder_id_; Promise promise_; @@ -1632,7 +1632,7 @@ class ReorderPinnedDialogsQuery : public Td::ResultHandler { } }; -class ToggleDialogUnreadMarkQuery : public Td::ResultHandler { +class ToggleDialogUnreadMarkQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; bool is_marked_as_unread_; @@ -1683,7 +1683,7 @@ class ToggleDialogUnreadMarkQuery : public Td::ResultHandler { } }; -class ToggleDialogIsBlockedQuery : public Td::ResultHandler { +class ToggleDialogIsBlockedQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; bool is_blocked_; @@ -1732,7 +1732,7 @@ class ToggleDialogIsBlockedQuery : public Td::ResultHandler { } }; -class GetMessagesViewsQuery : public Td::ResultHandler { +class GetMessagesViewsQuery final : public Td::ResultHandler { DialogId dialog_id_; vector message_ids_; @@ -1785,7 +1785,7 @@ class GetMessagesViewsQuery : public Td::ResultHandler { } }; -class ReadMessagesContentsQuery : public Td::ResultHandler { +class ReadMessagesContentsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -1825,7 +1825,7 @@ class ReadMessagesContentsQuery : public Td::ResultHandler { } }; -class ReadChannelMessagesContentsQuery : public Td::ResultHandler { +class ReadChannelMessagesContentsQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -1869,7 +1869,7 @@ class ReadChannelMessagesContentsQuery : public Td::ResultHandler { } }; -class GetDialogMessageByDateQuery : public Td::ResultHandler { +class GetDialogMessageByDateQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; int32 date_; @@ -1924,7 +1924,7 @@ class GetDialogMessageByDateQuery : public Td::ResultHandler { } }; -class GetHistoryQuery : public Td::ResultHandler { +class GetHistoryQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; MessageId from_message_id_; @@ -2000,7 +2000,7 @@ class GetHistoryQuery : public Td::ResultHandler { } }; -class ReadHistoryQuery : public Td::ResultHandler { +class ReadHistoryQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -2043,7 +2043,7 @@ class ReadHistoryQuery : public Td::ResultHandler { } }; -class ReadChannelHistoryQuery : public Td::ResultHandler { +class ReadChannelHistoryQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; @@ -2077,7 +2077,7 @@ class ReadChannelHistoryQuery : public Td::ResultHandler { } }; -class ReadDiscussionQuery : public Td::ResultHandler { +class ReadDiscussionQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -2109,7 +2109,7 @@ class ReadDiscussionQuery : public Td::ResultHandler { } }; -class SearchMessagesQuery : public Td::ResultHandler { +class SearchMessagesQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; string query_; @@ -2218,7 +2218,7 @@ class SearchMessagesQuery : public Td::ResultHandler { } }; -class SearchMessagesGlobalQuery : public Td::ResultHandler { +class SearchMessagesGlobalQuery final : public Td::ResultHandler { Promise promise_; string query_; int32 offset_date_; @@ -2279,7 +2279,7 @@ class SearchMessagesGlobalQuery : public Td::ResultHandler { } }; -class GetAllScheduledMessagesQuery : public Td::ResultHandler { +class GetAllScheduledMessagesQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; uint32 generation_; @@ -2321,7 +2321,7 @@ class GetAllScheduledMessagesQuery : public Td::ResultHandler { } }; -class GetRecentLocationsQuery : public Td::ResultHandler { +class GetRecentLocationsQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; int32 limit_; @@ -2375,7 +2375,7 @@ class GetRecentLocationsQuery : public Td::ResultHandler { } }; -class GetMessagePublicForwardsQuery : public Td::ResultHandler { +class GetMessagePublicForwardsQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; int32 limit_; @@ -2420,7 +2420,7 @@ class GetMessagePublicForwardsQuery : public Td::ResultHandler { } }; -class HidePromoDataQuery : public Td::ResultHandler { +class HidePromoDataQuery final : public Td::ResultHandler { DialogId dialog_id_; public: @@ -2447,7 +2447,7 @@ class HidePromoDataQuery : public Td::ResultHandler { } }; -class DeleteHistoryQuery : public Td::ResultHandler { +class DeleteHistoryQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; MessageId max_message_id_; @@ -2516,7 +2516,7 @@ class DeleteHistoryQuery : public Td::ResultHandler { } }; -class DeleteChannelHistoryQuery : public Td::ResultHandler { +class DeleteChannelHistoryQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; MessageId max_message_id_; @@ -2558,7 +2558,7 @@ class DeleteChannelHistoryQuery : public Td::ResultHandler { } }; -class DeletePhoneCallHistoryQuery : public Td::ResultHandler { +class DeletePhoneCallHistoryQuery final : public Td::ResultHandler { Promise promise_; bool revoke_; @@ -2613,7 +2613,7 @@ class DeletePhoneCallHistoryQuery : public Td::ResultHandler { } }; -class BlockFromRepliesQuery : public Td::ResultHandler { +class BlockFromRepliesQuery final : public Td::ResultHandler { Promise promise_; public: @@ -2651,7 +2651,7 @@ class BlockFromRepliesQuery : public Td::ResultHandler { } }; -class DeleteUserHistoryQuery : public Td::ResultHandler { +class DeleteUserHistoryQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; UserId user_id_; @@ -2712,7 +2712,7 @@ class DeleteUserHistoryQuery : public Td::ResultHandler { } }; -class ReadMentionsQuery : public Td::ResultHandler { +class ReadMentionsQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -2772,7 +2772,7 @@ class ReadMentionsQuery : public Td::ResultHandler { } }; -class SendSecretMessageActor : public NetActor { +class SendSecretMessageActor final : public NetActor { int64 random_id_; public: @@ -2822,7 +2822,7 @@ class SendSecretMessageActor : public NetActor { } }; -class SendMessageActor : public NetActorOnce { +class SendMessageActor final : public NetActorOnce { int64 random_id_; DialogId dialog_id_; @@ -2907,7 +2907,7 @@ class SendMessageActor : public NetActorOnce { } }; -class StartBotQuery : public Td::ResultHandler { +class StartBotQuery final : public Td::ResultHandler { int64 random_id_; DialogId dialog_id_; @@ -2957,7 +2957,7 @@ class StartBotQuery : public Td::ResultHandler { } }; -class SendInlineBotResultQuery : public Td::ResultHandler { +class SendInlineBotResultQuery final : public Td::ResultHandler { int64 random_id_; DialogId dialog_id_; @@ -3001,7 +3001,7 @@ class SendInlineBotResultQuery : public Td::ResultHandler { } }; -class SendMultiMediaActor : public NetActorOnce { +class SendMultiMediaActor final : public NetActorOnce { vector file_ids_; vector file_references_; vector random_ids_; @@ -3107,7 +3107,7 @@ class SendMultiMediaActor : public NetActorOnce { } }; -class SendMediaActor : public NetActorOnce { +class SendMediaActor final : public NetActorOnce { int64 random_id_ = 0; FileId file_id_; FileId thumbnail_file_id_; @@ -3216,7 +3216,7 @@ class SendMediaActor : public NetActorOnce { } }; -class UploadMediaQuery : public Td::ResultHandler { +class UploadMediaQuery final : public Td::ResultHandler { DialogId dialog_id_; MessageId message_id_; FileId file_id_; @@ -3295,7 +3295,7 @@ class UploadMediaQuery : public Td::ResultHandler { } }; -class SendScheduledMessageActor : public NetActorOnce { +class SendScheduledMessageActor final : public NetActorOnce { Promise promise_; DialogId dialog_id_; @@ -3342,7 +3342,7 @@ class SendScheduledMessageActor : public NetActorOnce { } }; -class EditMessageActor : public NetActorOnce { +class EditMessageActor final : public NetActorOnce { Promise promise_; DialogId dialog_id_; @@ -3431,7 +3431,7 @@ class EditMessageActor : public NetActorOnce { } }; -class EditInlineMessageQuery : public Td::ResultHandler { +class EditInlineMessageQuery final : public Td::ResultHandler { Promise promise_; public: @@ -3487,7 +3487,7 @@ class EditInlineMessageQuery : public Td::ResultHandler { } }; -class SetGameScoreActor : public NetActorOnce { +class SetGameScoreActor final : public NetActorOnce { Promise promise_; DialogId dialog_id_; @@ -3544,7 +3544,7 @@ class SetGameScoreActor : public NetActorOnce { } }; -class SetInlineGameScoreQuery : public Td::ResultHandler { +class SetInlineGameScoreQuery final : public Td::ResultHandler { Promise promise_; public: @@ -3589,7 +3589,7 @@ class SetInlineGameScoreQuery : public Td::ResultHandler { } }; -class GetGameHighScoresQuery : public Td::ResultHandler { +class GetGameHighScoresQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; int64 random_id_; @@ -3629,7 +3629,7 @@ class GetGameHighScoresQuery : public Td::ResultHandler { } }; -class GetInlineGameHighScoresQuery : public Td::ResultHandler { +class GetInlineGameHighScoresQuery final : public Td::ResultHandler { Promise promise_; int64 random_id_; @@ -3667,7 +3667,7 @@ class GetInlineGameHighScoresQuery : public Td::ResultHandler { } }; -class ForwardMessagesActor : public NetActorOnce { +class ForwardMessagesActor final : public NetActorOnce { Promise promise_; vector random_ids_; DialogId to_dialog_id_; @@ -3773,7 +3773,7 @@ class ForwardMessagesActor : public NetActorOnce { } }; -class SendScreenshotNotificationQuery : public Td::ResultHandler { +class SendScreenshotNotificationQuery final : public Td::ResultHandler { Promise promise_; int64 random_id_; DialogId dialog_id_; @@ -3819,7 +3819,7 @@ class SendScreenshotNotificationQuery : public Td::ResultHandler { } }; -class SetTypingQuery : public Td::ResultHandler { +class SetTypingQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -3866,7 +3866,7 @@ class SetTypingQuery : public Td::ResultHandler { } }; -class DeleteMessagesQuery : public Td::ResultHandler { +class DeleteMessagesQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; int32 query_count_; @@ -3929,7 +3929,7 @@ class DeleteMessagesQuery : public Td::ResultHandler { } }; -class DeleteChannelMessagesQuery : public Td::ResultHandler { +class DeleteChannelMessagesQuery final : public Td::ResultHandler { Promise promise_; int32 query_count_; ChannelId channel_id_; @@ -3988,7 +3988,7 @@ class DeleteChannelMessagesQuery : public Td::ResultHandler { } }; -class DeleteScheduledMessagesQuery : public Td::ResultHandler { +class DeleteScheduledMessagesQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -4027,7 +4027,7 @@ class DeleteScheduledMessagesQuery : public Td::ResultHandler { } }; -class GetDialogNotifySettingsQuery : public Td::ResultHandler { +class GetDialogNotifySettingsQuery final : public Td::ResultHandler { DialogId dialog_id_; public: @@ -4055,7 +4055,7 @@ class GetDialogNotifySettingsQuery : public Td::ResultHandler { } }; -class GetNotifySettingsExceptionsQuery : public Td::ResultHandler { +class GetNotifySettingsExceptionsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -4117,7 +4117,7 @@ class GetNotifySettingsExceptionsQuery : public Td::ResultHandler { } }; -class GetScopeNotifySettingsQuery : public Td::ResultHandler { +class GetScopeNotifySettingsQuery final : public Td::ResultHandler { Promise promise_; NotificationSettingsScope scope_; @@ -4149,7 +4149,7 @@ class GetScopeNotifySettingsQuery : public Td::ResultHandler { } }; -class UpdateDialogNotifySettingsQuery : public Td::ResultHandler { +class UpdateDialogNotifySettingsQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -4212,7 +4212,7 @@ class UpdateDialogNotifySettingsQuery : public Td::ResultHandler { } }; -class UpdateScopeNotifySettingsQuery : public Td::ResultHandler { +class UpdateScopeNotifySettingsQuery final : public Td::ResultHandler { Promise promise_; NotificationSettingsScope scope_; @@ -4259,7 +4259,7 @@ class UpdateScopeNotifySettingsQuery : public Td::ResultHandler { } }; -class ResetNotifySettingsQuery : public Td::ResultHandler { +class ResetNotifySettingsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -4292,7 +4292,7 @@ class ResetNotifySettingsQuery : public Td::ResultHandler { } }; -class GetPeerSettingsQuery : public Td::ResultHandler { +class GetPeerSettingsQuery final : public Td::ResultHandler { DialogId dialog_id_; public: @@ -4320,7 +4320,7 @@ class GetPeerSettingsQuery : public Td::ResultHandler { } }; -class UpdatePeerSettingsQuery : public Td::ResultHandler { +class UpdatePeerSettingsQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -4370,7 +4370,7 @@ class UpdatePeerSettingsQuery : public Td::ResultHandler { } }; -class ReportEncryptedSpamQuery : public Td::ResultHandler { +class ReportEncryptedSpamQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -4414,7 +4414,7 @@ class ReportEncryptedSpamQuery : public Td::ResultHandler { } }; -class ReportPeerQuery : public Td::ResultHandler { +class ReportPeerQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -4463,7 +4463,7 @@ class ReportPeerQuery : public Td::ResultHandler { } }; -class ReportProfilePhotoQuery : public Td::ResultHandler { +class ReportProfilePhotoQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; FileId file_id_; @@ -4527,7 +4527,7 @@ class ReportProfilePhotoQuery : public Td::ResultHandler { } }; -class EditPeerFoldersQuery : public Td::ResultHandler { +class EditPeerFoldersQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -4570,7 +4570,7 @@ class EditPeerFoldersQuery : public Td::ResultHandler { } }; -class GetStatsUrlQuery : public Td::ResultHandler { +class GetStatsUrlQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -4606,7 +4606,7 @@ class GetStatsUrlQuery : public Td::ResultHandler { } }; -class GetChannelDifferenceQuery : public Td::ResultHandler { +class GetChannelDifferenceQuery final : public Td::ResultHandler { DialogId dialog_id_; int32 pts_; int32 limit_; @@ -4647,7 +4647,7 @@ class GetChannelDifferenceQuery : public Td::ResultHandler { } }; -class ResolveUsernameQuery : public Td::ResultHandler { +class ResolveUsernameQuery final : public Td::ResultHandler { Promise promise_; string username_; @@ -4686,7 +4686,7 @@ class ResolveUsernameQuery : public Td::ResultHandler { } }; -class GetChannelAdminLogQuery : public Td::ResultHandler { +class GetChannelAdminLogQuery final : public Td::ResultHandler { Promise promise_; ChannelId channel_id_; int64 random_id_; @@ -4733,7 +4733,7 @@ class GetChannelAdminLogQuery : public Td::ResultHandler { } }; -class MessagesManager::UploadMediaCallback : public FileManager::UploadCallback { +class MessagesManager::UploadMediaCallback final : public FileManager::UploadCallback { public: void on_progress(FileId file_id) final { } @@ -4753,7 +4753,7 @@ class MessagesManager::UploadMediaCallback : public FileManager::UploadCallback } }; -class MessagesManager::UploadThumbnailCallback : public FileManager::UploadCallback { +class MessagesManager::UploadThumbnailCallback final : public FileManager::UploadCallback { public: void on_upload_ok(FileId file_id, tl_object_ptr input_file) final { send_closure_later(G()->messages_manager(), &MessagesManager::on_upload_thumbnail, file_id, std::move(input_file)); @@ -4769,7 +4769,7 @@ class MessagesManager::UploadThumbnailCallback : public FileManager::UploadCallb } }; -class MessagesManager::UploadDialogPhotoCallback : public FileManager::UploadCallback { +class MessagesManager::UploadDialogPhotoCallback final : public FileManager::UploadCallback { public: void on_upload_ok(FileId file_id, tl_object_ptr input_file) final { send_closure_later(G()->messages_manager(), &MessagesManager::on_upload_dialog_photo, file_id, @@ -4787,7 +4787,7 @@ class MessagesManager::UploadDialogPhotoCallback : public FileManager::UploadCal } }; -class MessagesManager::UploadImportedMessagesCallback : public FileManager::UploadCallback { +class MessagesManager::UploadImportedMessagesCallback final : public FileManager::UploadCallback { public: void on_upload_ok(FileId file_id, tl_object_ptr input_file) final { send_closure_later(G()->messages_manager(), &MessagesManager::on_upload_imported_messages, file_id, @@ -4805,7 +4805,7 @@ class MessagesManager::UploadImportedMessagesCallback : public FileManager::Uplo } }; -class MessagesManager::UploadImportedMessageAttachmentCallback : public FileManager::UploadCallback { +class MessagesManager::UploadImportedMessageAttachmentCallback final : public FileManager::UploadCallback { public: void on_upload_ok(FileId file_id, tl_object_ptr input_file) final { send_closure_later(G()->messages_manager(), &MessagesManager::on_upload_imported_message_attachment, file_id, @@ -8500,7 +8500,7 @@ Result MessagesManager::get_login_button_url(FullMessageId full_message_ } void MessagesManager::load_secret_thumbnail(FileId thumbnail_file_id) { - class Callback : public FileManager::DownloadCallback { + class Callback final : public FileManager::DownloadCallback { public: explicit Callback(Promise<> download_promise) : download_promise_(std::move(download_promise)) { } diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 540dd1161..9641fc8a1 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -89,7 +89,7 @@ class MessageContent; class MultiSequenceDispatcher; class Td; -class MessagesManager : public Actor { +class MessagesManager final : public Actor { public: // static constexpr int32 MESSAGE_FLAG_IS_UNREAD = 1 << 0; static constexpr int32 MESSAGE_FLAG_IS_OUT = 1 << 1; @@ -1539,7 +1539,7 @@ class MessagesManager : public Actor { } }; - class MessagesIterator : public MessagesIteratorBase { + class MessagesIterator final : public MessagesIteratorBase { public: MessagesIterator() = default; @@ -1553,7 +1553,7 @@ class MessagesManager : public Actor { } }; - class MessagesConstIterator : public MessagesIteratorBase { + class MessagesConstIterator final : public MessagesIteratorBase { public: MessagesConstIterator() = default; @@ -2988,7 +2988,7 @@ class MessagesManager : public Actor { being_loaded_secret_thumbnails_; // thumbnail_file_id -> ... // TTL - class TtlNode : private HeapNode { + class TtlNode final : private HeapNode { public: TtlNode(DialogId dialog_id, MessageId message_id, bool by_ttl_period) : full_message_id_(dialog_id, message_id), by_ttl_period_(by_ttl_period) { diff --git a/td/telegram/NotificationManager.cpp b/td/telegram/NotificationManager.cpp index 8362341af..1beb52f97 100644 --- a/td/telegram/NotificationManager.cpp +++ b/td/telegram/NotificationManager.cpp @@ -67,7 +67,7 @@ namespace td { int VERBOSITY_NAME(notifications) = VERBOSITY_NAME(INFO); -class SetContactSignUpNotificationQuery : public Td::ResultHandler { +class SetContactSignUpNotificationQuery final : public Td::ResultHandler { Promise promise_; public: @@ -95,7 +95,7 @@ class SetContactSignUpNotificationQuery : public Td::ResultHandler { } }; -class GetContactSignUpNotificationQuery : public Td::ResultHandler { +class GetContactSignUpNotificationQuery final : public Td::ResultHandler { Promise promise_; public: @@ -288,7 +288,7 @@ void NotificationManager::init() { } } - class StateCallback : public StateManager::Callback { + class StateCallback final : public StateManager::Callback { public: explicit StateCallback(ActorId parent) : parent_(std::move(parent)) { } diff --git a/td/telegram/NotificationManager.h b/td/telegram/NotificationManager.h index 8f1ee4810..0f5f251e5 100644 --- a/td/telegram/NotificationManager.h +++ b/td/telegram/NotificationManager.h @@ -42,7 +42,7 @@ struct BinlogEvent; class Td; -class NotificationManager : public Actor { +class NotificationManager final : public Actor { public: static constexpr int32 MIN_NOTIFICATION_GROUP_COUNT_MAX = 0; static constexpr int32 MAX_NOTIFICATION_GROUP_COUNT_MAX = 25; diff --git a/td/telegram/NotificationType.cpp b/td/telegram/NotificationType.cpp index 479fc42c4..033587cde 100644 --- a/td/telegram/NotificationType.cpp +++ b/td/telegram/NotificationType.cpp @@ -24,7 +24,7 @@ namespace td { -class NotificationTypeMessage : public NotificationType { +class NotificationTypeMessage final : public NotificationType { bool can_be_delayed() const final { return message_id_.is_valid() && message_id_.is_server(); } @@ -60,7 +60,7 @@ class NotificationTypeMessage : public NotificationType { } }; -class NotificationTypeSecretChat : public NotificationType { +class NotificationTypeSecretChat final : public NotificationType { bool can_be_delayed() const final { return false; } @@ -90,7 +90,7 @@ class NotificationTypeSecretChat : public NotificationType { } }; -class NotificationTypeCall : public NotificationType { +class NotificationTypeCall final : public NotificationType { bool can_be_delayed() const final { return false; } @@ -122,7 +122,7 @@ class NotificationTypeCall : public NotificationType { } }; -class NotificationTypePushMessage : public NotificationType { +class NotificationTypePushMessage final : public NotificationType { bool can_be_delayed() const final { return false; } diff --git a/td/telegram/PasswordManager.h b/td/telegram/PasswordManager.h index 13d6b09d1..d622352db 100644 --- a/td/telegram/PasswordManager.h +++ b/td/telegram/PasswordManager.h @@ -49,7 +49,7 @@ struct TempPasswordState { } }; -class PasswordManager : public NetQueryCallback { +class PasswordManager final : public NetQueryCallback { public: using State = tl_object_ptr; using TempState = tl_object_ptr; diff --git a/td/telegram/Payments.cpp b/td/telegram/Payments.cpp index e9072ce37..932118418 100644 --- a/td/telegram/Payments.cpp +++ b/td/telegram/Payments.cpp @@ -31,7 +31,7 @@ namespace td { -class SetBotShippingAnswerQuery : public Td::ResultHandler { +class SetBotShippingAnswerQuery final : public Td::ResultHandler { Promise promise_; public: @@ -69,7 +69,7 @@ class SetBotShippingAnswerQuery : public Td::ResultHandler { } }; -class SetBotPreCheckoutAnswerQuery : public Td::ResultHandler { +class SetBotPreCheckoutAnswerQuery final : public Td::ResultHandler { Promise promise_; public: @@ -259,7 +259,7 @@ static tl_object_ptr convert_saved_credentials( std::move(saved_credentials->title_)); } -class GetPaymentFormQuery : public Td::ResultHandler { +class GetPaymentFormQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -322,7 +322,7 @@ class GetPaymentFormQuery : public Td::ResultHandler { } }; -class ValidateRequestedInfoQuery : public Td::ResultHandler { +class ValidateRequestedInfoQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -371,7 +371,7 @@ class ValidateRequestedInfoQuery : public Td::ResultHandler { } }; -class SendPaymentFormQuery : public Td::ResultHandler { +class SendPaymentFormQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -440,7 +440,7 @@ class SendPaymentFormQuery : public Td::ResultHandler { } }; -class GetPaymentReceiptQuery : public Td::ResultHandler { +class GetPaymentReceiptQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; @@ -498,7 +498,7 @@ class GetPaymentReceiptQuery : public Td::ResultHandler { } }; -class GetSavedInfoQuery : public Td::ResultHandler { +class GetSavedInfoQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -525,7 +525,7 @@ class GetSavedInfoQuery : public Td::ResultHandler { } }; -class ClearSavedInfoQuery : public Td::ResultHandler { +class ClearSavedInfoQuery final : public Td::ResultHandler { Promise promise_; public: @@ -559,7 +559,7 @@ class ClearSavedInfoQuery : public Td::ResultHandler { } }; -class GetBankCardInfoQuery : public Td::ResultHandler { +class GetBankCardInfoQuery final : public Td::ResultHandler { Promise> promise_; public: diff --git a/td/telegram/PhoneNumberManager.h b/td/telegram/PhoneNumberManager.h index c622d3127..da71ce238 100644 --- a/td/telegram/PhoneNumberManager.h +++ b/td/telegram/PhoneNumberManager.h @@ -18,7 +18,7 @@ namespace td { -class PhoneNumberManager : public NetActor { +class PhoneNumberManager final : public NetActor { public: enum class Type : int32 { ChangePhone, VerifyPhone, ConfirmPhone }; PhoneNumberManager(Type type, ActorShared<> parent); diff --git a/td/telegram/Photo.h b/td/telegram/Photo.h index 1d594262c..47a87847c 100644 --- a/td/telegram/Photo.h +++ b/td/telegram/Photo.h @@ -40,7 +40,7 @@ struct DialogPhoto { bool has_animation = false; }; -struct ProfilePhoto : public DialogPhoto { +struct ProfilePhoto final : public DialogPhoto { int64 id = 0; }; @@ -52,7 +52,7 @@ struct PhotoSize { vector progressive_sizes; }; -struct AnimationSize : public PhotoSize { +struct AnimationSize final : public PhotoSize { double main_frame_timestamp = 0.0; }; diff --git a/td/telegram/PhotoSizeSource.h b/td/telegram/PhotoSizeSource.h index baf801b72..c67f5c69e 100644 --- a/td/telegram/PhotoSizeSource.h +++ b/td/telegram/PhotoSizeSource.h @@ -65,11 +65,11 @@ struct PhotoSizeSource { int64 dialog_access_hash = 0; }; - struct DialogPhotoSmall : public DialogPhoto { + struct DialogPhotoSmall final : public DialogPhoto { using DialogPhoto::DialogPhoto; }; - struct DialogPhotoBig : public DialogPhoto { + struct DialogPhotoBig final : public DialogPhoto { using DialogPhoto::DialogPhoto; }; @@ -111,16 +111,16 @@ struct PhotoSizeSource { int32 local_id = 0; }; - struct DialogPhotoSmallLegacy : public DialogPhotoLegacy { + struct DialogPhotoSmallLegacy final : public DialogPhotoLegacy { using DialogPhotoLegacy::DialogPhotoLegacy; }; - struct DialogPhotoBigLegacy : public DialogPhotoLegacy { + struct DialogPhotoBigLegacy final : public DialogPhotoLegacy { using DialogPhotoLegacy::DialogPhotoLegacy; }; // for legacy sticker set thumbnails - struct StickerSetThumbnailLegacy : public StickerSetThumbnail { + struct StickerSetThumbnailLegacy final : public StickerSetThumbnail { StickerSetThumbnailLegacy() = default; StickerSetThumbnailLegacy(int64 sticker_set_id, int64 sticker_set_access_hash, int64 volume_id, int32 local_id) : StickerSetThumbnail(sticker_set_id, sticker_set_access_hash), volume_id(volume_id), local_id(local_id) { @@ -131,7 +131,7 @@ struct PhotoSizeSource { }; // for sticker set thumbnails identified by version - struct StickerSetThumbnailVersion : public StickerSetThumbnail { + struct StickerSetThumbnailVersion final : public StickerSetThumbnail { StickerSetThumbnailVersion() = default; StickerSetThumbnailVersion(int64 sticker_set_id, int64 sticker_set_access_hash, int32 version) : StickerSetThumbnail(sticker_set_id, sticker_set_access_hash), version(version) { diff --git a/td/telegram/PollManager.cpp b/td/telegram/PollManager.cpp index ab634428b..28b88c1d3 100644 --- a/td/telegram/PollManager.cpp +++ b/td/telegram/PollManager.cpp @@ -48,7 +48,7 @@ namespace td { -class GetPollResultsQuery : public Td::ResultHandler { +class GetPollResultsQuery final : public Td::ResultHandler { Promise> promise_; PollId poll_id_; DialogId dialog_id_; @@ -89,7 +89,7 @@ class GetPollResultsQuery : public Td::ResultHandler { } }; -class GetPollVotersQuery : public Td::ResultHandler { +class GetPollVotersQuery final : public Td::ResultHandler { Promise> promise_; PollId poll_id_; DialogId dialog_id_; @@ -137,7 +137,7 @@ class GetPollVotersQuery : public Td::ResultHandler { } }; -class SetPollAnswerActor : public NetActorOnce { +class SetPollAnswerActor final : public NetActorOnce { Promise> promise_; DialogId dialog_id_; @@ -179,7 +179,7 @@ class SetPollAnswerActor : public NetActorOnce { } }; -class StopPollActor : public NetActorOnce { +class StopPollActor final : public NetActorOnce { Promise promise_; DialogId dialog_id_; @@ -247,7 +247,7 @@ PollManager::PollManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::m } void PollManager::start_up() { - class StateCallback : public StateManager::Callback { + class StateCallback final : public StateManager::Callback { public: explicit StateCallback(ActorId parent) : parent_(std::move(parent)) { } diff --git a/td/telegram/PollManager.h b/td/telegram/PollManager.h index 367616b2e..c26ab5a59 100644 --- a/td/telegram/PollManager.h +++ b/td/telegram/PollManager.h @@ -33,7 +33,7 @@ struct BinlogEvent; class Td; -class PollManager : public Actor { +class PollManager final : public Actor { public: PollManager(Td *td, ActorShared<> parent); diff --git a/td/telegram/PrivacyManager.h b/td/telegram/PrivacyManager.h index febf09e7b..7567bb9dc 100644 --- a/td/telegram/PrivacyManager.h +++ b/td/telegram/PrivacyManager.h @@ -22,7 +22,7 @@ namespace td { -class PrivacyManager : public NetQueryCallback { +class PrivacyManager final : public NetQueryCallback { public: explicit PrivacyManager(ActorShared<> parent) : parent_(std::move(parent)) { } diff --git a/td/telegram/QueryCombiner.h b/td/telegram/QueryCombiner.h index 5ff29b2f1..140a0b79c 100644 --- a/td/telegram/QueryCombiner.h +++ b/td/telegram/QueryCombiner.h @@ -19,7 +19,7 @@ namespace td { // combines identical queries into one request -class QueryCombiner : public Actor { +class QueryCombiner final : public Actor { public: QueryCombiner(Slice name, double min_delay); diff --git a/td/telegram/SecretChatActor.h b/td/telegram/SecretChatActor.h index 838fd43ec..4726bb540 100644 --- a/td/telegram/SecretChatActor.h +++ b/td/telegram/SecretChatActor.h @@ -46,7 +46,7 @@ namespace td { class BinlogInterface; class NetQueryCreator; -class SecretChatActor : public NetQueryCallback { +class SecretChatActor final : public NetQueryCallback { public: enum : int32 { DEFAULT_LAYER = 73, diff --git a/td/telegram/SecretChatsManager.cpp b/td/telegram/SecretChatsManager.cpp index f37a89b87..2ca5cfd15 100644 --- a/td/telegram/SecretChatsManager.cpp +++ b/td/telegram/SecretChatsManager.cpp @@ -82,7 +82,7 @@ void SecretChatsManager::start_up() { return; } - class StateCallback : public StateManager::Callback { + class StateCallback final : public StateManager::Callback { public: explicit StateCallback(ActorId parent) : parent_(std::move(parent)) { } @@ -291,7 +291,7 @@ ActorId SecretChatsManager::create_chat_actor(int32 id) { } unique_ptr SecretChatsManager::make_secret_chat_context(int32 id) { - class Context : public SecretChatActor::Context { + class Context final : public SecretChatActor::Context { public: Context(int32 id, ActorShared parent, unique_ptr secret_chat_db) : secret_chat_id_(SecretChatId(id)), parent_(std::move(parent)), secret_chat_db_(std::move(secret_chat_db)) { diff --git a/td/telegram/SecretChatsManager.h b/td/telegram/SecretChatsManager.h index 0265af504..c11eba855 100644 --- a/td/telegram/SecretChatsManager.h +++ b/td/telegram/SecretChatsManager.h @@ -27,7 +27,7 @@ namespace td { struct BinlogEvent; -class SecretChatsManager : public Actor { +class SecretChatsManager final : public Actor { public: explicit SecretChatsManager(ActorShared<> parent); diff --git a/td/telegram/SecureManager.cpp b/td/telegram/SecureManager.cpp index 96a0a13cd..41db3ed1b 100644 --- a/td/telegram/SecureManager.cpp +++ b/td/telegram/SecureManager.cpp @@ -29,7 +29,7 @@ namespace td { -class GetSecureValue : public NetQueryCallback { +class GetSecureValue final : public NetQueryCallback { public: GetSecureValue(ActorShared parent, std::string password, SecureValueType type, Promise promise); @@ -50,7 +50,7 @@ class GetSecureValue : public NetQueryCallback { void on_result(NetQueryPtr query) final; }; -class GetAllSecureValues : public NetQueryCallback { +class GetAllSecureValues final : public NetQueryCallback { public: GetAllSecureValues(ActorShared parent, std::string password, Promise promise); @@ -69,7 +69,7 @@ class GetAllSecureValues : public NetQueryCallback { void on_result(NetQueryPtr query) final; }; -class SetSecureValue : public NetQueryCallback { +class SetSecureValue final : public NetQueryCallback { public: SetSecureValue(ActorShared parent, string password, SecureValue secure_value, Promise promise); @@ -94,7 +94,7 @@ class SetSecureValue : public NetQueryCallback { enum class State : int32 { WaitSecret, WaitSetValue } state_ = State::WaitSecret; - class UploadCallback : public FileManager::UploadCallback { + class UploadCallback final : public FileManager::UploadCallback { public: UploadCallback(ActorId actor_id, uint32 upload_generation); @@ -128,7 +128,7 @@ class SetSecureValue : public NetQueryCallback { void merge(FileManager *file_manager, FileId file_id, EncryptedSecureFile &encrypted_file); }; -class SetSecureValueErrorsQuery : public Td::ResultHandler { +class SetSecureValueErrorsQuery final : public Td::ResultHandler { Promise promise_; public: @@ -652,7 +652,7 @@ void SetSecureValue::merge(FileManager *file_manager, FileId file_id, EncryptedS LOG_IF(ERROR, status.is_error()) << status.error(); } -class DeleteSecureValue : public NetQueryCallback { +class DeleteSecureValue final : public NetQueryCallback { public: DeleteSecureValue(ActorShared parent, SecureValueType type, Promise promise) : parent_(std::move(parent)), type_(std::move(type)), promise_(std::move(promise)) { @@ -681,7 +681,7 @@ class DeleteSecureValue : public NetQueryCallback { } }; -class GetPassportAuthorizationForm : public NetQueryCallback { +class GetPassportAuthorizationForm final : public NetQueryCallback { public: GetPassportAuthorizationForm(ActorShared parent, UserId bot_user_id, string scope, string public_key, Promise> promise) @@ -752,7 +752,7 @@ void SecureManager::get_secure_value(std::string password, SecureValueType type, .release(); } -class GetPassportConfig : public NetQueryCallback { +class GetPassportConfig final : public NetQueryCallback { public: GetPassportConfig(ActorShared parent, string country_code, Promise> promise) diff --git a/td/telegram/SecureManager.h b/td/telegram/SecureManager.h index fade3bea3..3ac79bb3c 100644 --- a/td/telegram/SecureManager.h +++ b/td/telegram/SecureManager.h @@ -34,7 +34,7 @@ using TdApiSecureValues = td_api::object_ptr; using TdApiSecureValuesWithErrors = td_api::object_ptr; using TdApiAuthorizationForm = td_api::object_ptr; -class SecureManager : public NetQueryCallback { +class SecureManager final : public NetQueryCallback { public: explicit SecureManager(ActorShared<> parent); diff --git a/td/telegram/SecureStorage.cpp b/td/telegram/SecureStorage.cpp index dd57dab7c..74d25dedb 100644 --- a/td/telegram/SecureStorage.cpp +++ b/td/telegram/SecureStorage.cpp @@ -90,7 +90,7 @@ BufferSlice gen_random_prefix(int64 data_size) { return buff; } -class FileDataView : public DataView { +class FileDataView final : public DataView { public: FileDataView(FileFd &fd, int64 size); diff --git a/td/telegram/SecureStorage.h b/td/telegram/SecureStorage.h index 8ffd365b7..0a4d45979 100644 --- a/td/telegram/SecureStorage.h +++ b/td/telegram/SecureStorage.h @@ -74,7 +74,7 @@ class DataView { virtual ~DataView() = default; }; -class BufferSliceDataView : public DataView { +class BufferSliceDataView final : public DataView { public: explicit BufferSliceDataView(BufferSlice buffer_slice); int64 size() const final; @@ -84,7 +84,7 @@ class BufferSliceDataView : public DataView { BufferSlice buffer_slice_; }; -class ConcatDataView : public DataView { +class ConcatDataView final : public DataView { public: ConcatDataView(const DataView &left, const DataView &right); int64 size() const final; @@ -161,7 +161,7 @@ class Decryptor { }; // Encryption -class Encryptor : public DataView { +class Encryptor final : public DataView { public: Encryptor(AesCbcState aes_cbc_state, const DataView &data_view); int64 size() const final; diff --git a/td/telegram/SequenceDispatcher.h b/td/telegram/SequenceDispatcher.h index 5a39df42c..1a4d1858c 100644 --- a/td/telegram/SequenceDispatcher.h +++ b/td/telegram/SequenceDispatcher.h @@ -18,7 +18,7 @@ namespace td { -class SequenceDispatcher : public NetQueryCallback { +class SequenceDispatcher final : public NetQueryCallback { public: class Parent : public Actor { public: @@ -73,7 +73,7 @@ class SequenceDispatcher : public NetQueryCallback { void tear_down() final; }; -class MultiSequenceDispatcher : public SequenceDispatcher::Parent { +class MultiSequenceDispatcher final : public SequenceDispatcher::Parent { public: void send_with_callback(NetQueryPtr query, ActorShared callback, uint64 sequence_id); diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index 74501be42..b8a47477d 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -61,7 +61,7 @@ namespace td { -class GetAllStickersQuery : public Td::ResultHandler { +class GetAllStickersQuery final : public Td::ResultHandler { bool is_masks_; public: @@ -96,7 +96,7 @@ class GetAllStickersQuery : public Td::ResultHandler { } }; -class SearchStickersQuery : public Td::ResultHandler { +class SearchStickersQuery final : public Td::ResultHandler { string emoji_; public: @@ -124,7 +124,7 @@ class SearchStickersQuery : public Td::ResultHandler { } }; -class GetEmojiKeywordsLanguageQuery : public Td::ResultHandler { +class GetEmojiKeywordsLanguageQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -151,7 +151,7 @@ class GetEmojiKeywordsLanguageQuery : public Td::ResultHandler { } }; -class GetEmojiKeywordsQuery : public Td::ResultHandler { +class GetEmojiKeywordsQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -177,7 +177,7 @@ class GetEmojiKeywordsQuery : public Td::ResultHandler { } }; -class GetEmojiKeywordsDifferenceQuery : public Td::ResultHandler { +class GetEmojiKeywordsDifferenceQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -205,7 +205,7 @@ class GetEmojiKeywordsDifferenceQuery : public Td::ResultHandler { } }; -class GetEmojiUrlQuery : public Td::ResultHandler { +class GetEmojiUrlQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -231,7 +231,7 @@ class GetEmojiUrlQuery : public Td::ResultHandler { } }; -class GetArchivedStickerSetsQuery : public Td::ResultHandler { +class GetArchivedStickerSetsQuery final : public Td::ResultHandler { Promise promise_; StickerSetId offset_sticker_set_id_; bool is_masks_; @@ -275,7 +275,7 @@ class GetArchivedStickerSetsQuery : public Td::ResultHandler { } }; -class GetFeaturedStickerSetsQuery : public Td::ResultHandler { +class GetFeaturedStickerSetsQuery final : public Td::ResultHandler { public: void send(int32 hash) { LOG(INFO) << "Get trending sticker sets with hash " << hash; @@ -298,7 +298,7 @@ class GetFeaturedStickerSetsQuery : public Td::ResultHandler { } }; -class GetOldFeaturedStickerSetsQuery : public Td::ResultHandler { +class GetOldFeaturedStickerSetsQuery final : public Td::ResultHandler { int32 offset_; int32 limit_; uint32 generation_; @@ -328,7 +328,7 @@ class GetOldFeaturedStickerSetsQuery : public Td::ResultHandler { } }; -class GetAttachedStickerSetsQuery : public Td::ResultHandler { +class GetAttachedStickerSetsQuery final : public Td::ResultHandler { Promise promise_; FileId file_id_; string file_reference_; @@ -377,7 +377,7 @@ class GetAttachedStickerSetsQuery : public Td::ResultHandler { } }; -class GetRecentStickersQuery : public Td::ResultHandler { +class GetRecentStickersQuery final : public Td::ResultHandler { bool is_repair_ = false; bool is_attached_ = false; @@ -414,7 +414,7 @@ class GetRecentStickersQuery : public Td::ResultHandler { } }; -class SaveRecentStickerQuery : public Td::ResultHandler { +class SaveRecentStickerQuery final : public Td::ResultHandler { Promise promise_; FileId file_id_; string file_reference_; @@ -483,7 +483,7 @@ class SaveRecentStickerQuery : public Td::ResultHandler { } }; -class ClearRecentStickersQuery : public Td::ResultHandler { +class ClearRecentStickersQuery final : public Td::ResultHandler { Promise promise_; bool is_attached_; @@ -527,7 +527,7 @@ class ClearRecentStickersQuery : public Td::ResultHandler { } }; -class GetFavedStickersQuery : public Td::ResultHandler { +class GetFavedStickersQuery final : public Td::ResultHandler { bool is_repair_ = false; public: @@ -555,7 +555,7 @@ class GetFavedStickersQuery : public Td::ResultHandler { } }; -class FaveStickerQuery : public Td::ResultHandler { +class FaveStickerQuery final : public Td::ResultHandler { FileId file_id_; string file_reference_; bool unsave_ = false; @@ -616,7 +616,7 @@ class FaveStickerQuery : public Td::ResultHandler { } }; -class ReorderStickerSetsQuery : public Td::ResultHandler { +class ReorderStickerSetsQuery final : public Td::ResultHandler { bool is_masks_; public: @@ -650,7 +650,7 @@ class ReorderStickerSetsQuery : public Td::ResultHandler { } }; -class GetStickerSetQuery : public Td::ResultHandler { +class GetStickerSetQuery final : public Td::ResultHandler { Promise promise_; StickerSetId sticker_set_id_; string sticker_set_name_; @@ -699,7 +699,7 @@ class GetStickerSetQuery : public Td::ResultHandler { } }; -class ReloadSpecialStickerSetQuery : public Td::ResultHandler { +class ReloadSpecialStickerSetQuery final : public Td::ResultHandler { SpecialStickerSetType type_; public: @@ -729,7 +729,7 @@ class ReloadSpecialStickerSetQuery : public Td::ResultHandler { } }; -class SearchStickerSetsQuery : public Td::ResultHandler { +class SearchStickerSetsQuery final : public Td::ResultHandler { string query_; public: @@ -758,7 +758,7 @@ class SearchStickerSetsQuery : public Td::ResultHandler { } }; -class InstallStickerSetQuery : public Td::ResultHandler { +class InstallStickerSetQuery final : public Td::ResultHandler { Promise promise_; StickerSetId set_id_; bool is_archived_; @@ -791,7 +791,7 @@ class InstallStickerSetQuery : public Td::ResultHandler { } }; -class UninstallStickerSetQuery : public Td::ResultHandler { +class UninstallStickerSetQuery final : public Td::ResultHandler { Promise promise_; StickerSetId set_id_; @@ -826,7 +826,7 @@ class UninstallStickerSetQuery : public Td::ResultHandler { } }; -class ReadFeaturedStickerSetsQuery : public Td::ResultHandler { +class ReadFeaturedStickerSetsQuery final : public Td::ResultHandler { public: void send(vector sticker_set_ids) { LOG(INFO) << "Read trending sticker sets " << format::as_array(sticker_set_ids); @@ -852,7 +852,7 @@ class ReadFeaturedStickerSetsQuery : public Td::ResultHandler { } }; -class UploadStickerFileQuery : public Td::ResultHandler { +class UploadStickerFileQuery final : public Td::ResultHandler { Promise promise_; FileId file_id_; bool was_uploaded_ = false; @@ -900,7 +900,7 @@ class UploadStickerFileQuery : public Td::ResultHandler { } }; -class SuggestStickerSetShortNameQuery : public Td::ResultHandler { +class SuggestStickerSetShortNameQuery final : public Td::ResultHandler { Promise promise_; public: @@ -928,7 +928,7 @@ class SuggestStickerSetShortNameQuery : public Td::ResultHandler { } }; -class CheckStickerSetShortNameQuery : public Td::ResultHandler { +class CheckStickerSetShortNameQuery final : public Td::ResultHandler { Promise promise_; public: @@ -953,7 +953,7 @@ class CheckStickerSetShortNameQuery : public Td::ResultHandler { } }; -class CreateNewStickerSetQuery : public Td::ResultHandler { +class CreateNewStickerSetQuery final : public Td::ResultHandler { Promise promise_; public: @@ -999,7 +999,7 @@ class CreateNewStickerSetQuery : public Td::ResultHandler { } }; -class AddStickerToSetQuery : public Td::ResultHandler { +class AddStickerToSetQuery final : public Td::ResultHandler { Promise promise_; public: @@ -1029,7 +1029,7 @@ class AddStickerToSetQuery : public Td::ResultHandler { } }; -class SetStickerSetThumbnailQuery : public Td::ResultHandler { +class SetStickerSetThumbnailQuery final : public Td::ResultHandler { Promise promise_; public: @@ -1059,7 +1059,7 @@ class SetStickerSetThumbnailQuery : public Td::ResultHandler { } }; -class SetStickerPositionQuery : public Td::ResultHandler { +class SetStickerPositionQuery final : public Td::ResultHandler { Promise promise_; public: @@ -1089,7 +1089,7 @@ class SetStickerPositionQuery : public Td::ResultHandler { } }; -class DeleteStickerFromSetQuery : public Td::ResultHandler { +class DeleteStickerFromSetQuery final : public Td::ResultHandler { Promise promise_; public: @@ -1167,7 +1167,7 @@ class StickersManager::StickerSetListLogEvent { } }; -class StickersManager::UploadStickerFileCallback : public FileManager::UploadCallback { +class StickersManager::UploadStickerFileCallback final : public FileManager::UploadCallback { public: void on_upload_ok(FileId file_id, tl_object_ptr input_file) final { send_closure_later(G()->stickers_manager(), &StickersManager::on_upload_sticker_file, file_id, diff --git a/td/telegram/StickersManager.h b/td/telegram/StickersManager.h index 8697e7e2a..b19311c7b 100644 --- a/td/telegram/StickersManager.h +++ b/td/telegram/StickersManager.h @@ -38,7 +38,7 @@ namespace td { class Td; -class StickersManager : public Actor { +class StickersManager final : public Actor { public: static constexpr int64 GREAT_MINDS_SET_ID = 1842540969984001; diff --git a/td/telegram/StorageManager.h b/td/telegram/StorageManager.h index b05dedf5b..b6715df78 100644 --- a/td/telegram/StorageManager.h +++ b/td/telegram/StorageManager.h @@ -29,7 +29,7 @@ struct DatabaseStats { tl_object_ptr get_database_statistics_object() const; }; -class StorageManager : public Actor { +class StorageManager final : public Actor { public: StorageManager(ActorShared<> parent, int32 scheduler_id); void get_storage_stats(bool need_all_files, int32 dialog_limit, Promise promise); diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 9a8b66e39..74109e706 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -170,7 +170,7 @@ void Td::ResultHandler::send_query(NetQueryPtr query) { td->send(std::move(query)); } -class GetPromoDataQuery : public Td::ResultHandler { +class GetPromoDataQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -197,7 +197,7 @@ class GetPromoDataQuery : public Td::ResultHandler { } }; -class GetRecentMeUrlsQuery : public Td::ResultHandler { +class GetRecentMeUrlsQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -296,7 +296,7 @@ class GetRecentMeUrlsQuery : public Td::ResultHandler { } }; -class SendCustomRequestQuery : public Td::ResultHandler { +class SendCustomRequestQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -324,7 +324,7 @@ class SendCustomRequestQuery : public Td::ResultHandler { } }; -class AnswerCustomQueryQuery : public Td::ResultHandler { +class AnswerCustomQueryQuery final : public Td::ResultHandler { Promise promise_; public: @@ -354,7 +354,7 @@ class AnswerCustomQueryQuery : public Td::ResultHandler { } }; -class SetBotUpdatesStatusQuery : public Td::ResultHandler { +class SetBotUpdatesStatusQuery final : public Td::ResultHandler { public: void send(int32 pending_update_count, const string &error_message) { send_query( @@ -379,7 +379,7 @@ class SetBotUpdatesStatusQuery : public Td::ResultHandler { } }; -class UpdateStatusQuery : public Td::ResultHandler { +class UpdateStatusQuery final : public Td::ResultHandler { bool is_offline_; public: @@ -410,7 +410,7 @@ class UpdateStatusQuery : public Td::ResultHandler { } }; -class GetInviteTextQuery : public Td::ResultHandler { +class GetInviteTextQuery final : public Td::ResultHandler { Promise promise_; public: @@ -436,7 +436,7 @@ class GetInviteTextQuery : public Td::ResultHandler { } }; -class GetDeepLinkInfoQuery : public Td::ResultHandler { +class GetDeepLinkInfoQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -497,7 +497,7 @@ class GetDeepLinkInfoQuery : public Td::ResultHandler { } }; -class SaveAppLogQuery : public Td::ResultHandler { +class SaveAppLogQuery final : public Td::ResultHandler { Promise promise_; public: @@ -528,7 +528,7 @@ class SaveAppLogQuery : public Td::ResultHandler { } }; -class TestQuery : public Td::ResultHandler { +class TestQuery final : public Td::ResultHandler { public: explicit TestQuery(uint64 request_id) : request_id_(request_id) { } @@ -556,7 +556,7 @@ class TestQuery : public Td::ResultHandler { uint64 request_id_; }; -class TestProxyRequest : public RequestOnceActor { +class TestProxyRequest final : public RequestOnceActor { Proxy proxy_; int16 dc_id_; double timeout_; @@ -604,7 +604,7 @@ class TestProxyRequest : public RequestOnceActor { if (r_data.is_error()) { return promise_.set_error(r_data.move_as_error()); } - class HandshakeContext : public mtproto::AuthKeyHandshakeContext { + class HandshakeContext final : public mtproto::AuthKeyHandshakeContext { public: DhCallback *get_dh_callback() final { return nullptr; @@ -664,7 +664,7 @@ class TestProxyRequest : public RequestOnceActor { } }; -class GetMeRequest : public RequestActor<> { +class GetMeRequest final : public RequestActor<> { UserId user_id_; void do_run(Promise &&promise) final { @@ -680,7 +680,7 @@ class GetMeRequest : public RequestActor<> { } }; -class GetUserRequest : public RequestActor<> { +class GetUserRequest final : public RequestActor<> { UserId user_id_; void do_run(Promise &&promise) final { @@ -698,7 +698,7 @@ class GetUserRequest : public RequestActor<> { } }; -class GetUserFullInfoRequest : public RequestActor<> { +class GetUserFullInfoRequest final : public RequestActor<> { UserId user_id_; void do_run(Promise &&promise) final { @@ -715,7 +715,7 @@ class GetUserFullInfoRequest : public RequestActor<> { } }; -class GetGroupRequest : public RequestActor<> { +class GetGroupRequest final : public RequestActor<> { ChatId chat_id_; void do_run(Promise &&promise) final { @@ -733,7 +733,7 @@ class GetGroupRequest : public RequestActor<> { } }; -class GetGroupFullInfoRequest : public RequestActor<> { +class GetGroupFullInfoRequest final : public RequestActor<> { ChatId chat_id_; void do_run(Promise &&promise) final { @@ -750,7 +750,7 @@ class GetGroupFullInfoRequest : public RequestActor<> { } }; -class GetSupergroupRequest : public RequestActor<> { +class GetSupergroupRequest final : public RequestActor<> { ChannelId channel_id_; void do_run(Promise &&promise) final { @@ -768,7 +768,7 @@ class GetSupergroupRequest : public RequestActor<> { } }; -class GetSupergroupFullInfoRequest : public RequestActor<> { +class GetSupergroupFullInfoRequest final : public RequestActor<> { ChannelId channel_id_; void do_run(Promise &&promise) final { @@ -785,7 +785,7 @@ class GetSupergroupFullInfoRequest : public RequestActor<> { } }; -class GetSecretChatRequest : public RequestActor<> { +class GetSecretChatRequest final : public RequestActor<> { SecretChatId secret_chat_id_; void do_run(Promise &&promise) final { @@ -802,7 +802,7 @@ class GetSecretChatRequest : public RequestActor<> { } }; -class GetChatRequest : public RequestActor<> { +class GetChatRequest final : public RequestActor<> { DialogId dialog_id_; bool dialog_found_ = false; @@ -826,7 +826,7 @@ class GetChatRequest : public RequestActor<> { } }; -class GetChatFilterRequest : public RequestActor<> { +class GetChatFilterRequest final : public RequestActor<> { DialogFilterId dialog_filter_id_; void do_run(Promise &&promise) final { @@ -844,7 +844,7 @@ class GetChatFilterRequest : public RequestActor<> { } }; -class GetChatsRequest : public RequestActor<> { +class GetChatsRequest final : public RequestActor<> { DialogListId dialog_list_id_; DialogDate offset_; int32 limit_; @@ -872,7 +872,7 @@ class GetChatsRequest : public RequestActor<> { } }; -class SearchPublicChatRequest : public RequestActor<> { +class SearchPublicChatRequest final : public RequestActor<> { string username_; DialogId dialog_id_; @@ -892,7 +892,7 @@ class SearchPublicChatRequest : public RequestActor<> { } }; -class SearchPublicChatsRequest : public RequestActor<> { +class SearchPublicChatsRequest final : public RequestActor<> { string query_; vector dialog_ids_; @@ -911,7 +911,7 @@ class SearchPublicChatsRequest : public RequestActor<> { } }; -class SearchChatsRequest : public RequestActor<> { +class SearchChatsRequest final : public RequestActor<> { string query_; int32 limit_; @@ -931,7 +931,7 @@ class SearchChatsRequest : public RequestActor<> { } }; -class SearchChatsOnServerRequest : public RequestActor<> { +class SearchChatsOnServerRequest final : public RequestActor<> { string query_; int32 limit_; @@ -951,7 +951,7 @@ class SearchChatsOnServerRequest : public RequestActor<> { } }; -class GetGroupsInCommonRequest : public RequestActor<> { +class GetGroupsInCommonRequest final : public RequestActor<> { UserId user_id_; DialogId offset_dialog_id_; int32 limit_; @@ -973,7 +973,7 @@ class GetGroupsInCommonRequest : public RequestActor<> { } }; -class GetCreatedPublicChatsRequest : public RequestActor<> { +class GetCreatedPublicChatsRequest final : public RequestActor<> { vector dialog_ids_; PublicDialogType type_; @@ -991,7 +991,7 @@ class GetCreatedPublicChatsRequest : public RequestActor<> { } }; -class GetSuitableDiscussionChatsRequest : public RequestActor<> { +class GetSuitableDiscussionChatsRequest final : public RequestActor<> { vector dialog_ids_; void do_run(Promise &&promise) final { @@ -1007,7 +1007,7 @@ class GetSuitableDiscussionChatsRequest : public RequestActor<> { } }; -class GetInactiveSupergroupChatsRequest : public RequestActor<> { +class GetInactiveSupergroupChatsRequest final : public RequestActor<> { vector dialog_ids_; void do_run(Promise &&promise) final { @@ -1023,7 +1023,7 @@ class GetInactiveSupergroupChatsRequest : public RequestActor<> { } }; -class GetMessageRequest : public RequestOnceActor { +class GetMessageRequest final : public RequestOnceActor { FullMessageId full_message_id_; void do_run(Promise &&promise) final { @@ -1040,7 +1040,7 @@ class GetMessageRequest : public RequestOnceActor { } }; -class GetRepliedMessageRequest : public RequestOnceActor { +class GetRepliedMessageRequest final : public RequestOnceActor { DialogId dialog_id_; MessageId message_id_; @@ -1062,7 +1062,7 @@ class GetRepliedMessageRequest : public RequestOnceActor { } }; -class GetMessageThreadRequest : public RequestActor { +class GetMessageThreadRequest final : public RequestActor { DialogId dialog_id_; MessageId message_id_; @@ -1090,7 +1090,7 @@ class GetMessageThreadRequest : public RequestActor message_ids_; @@ -1153,7 +1153,7 @@ class GetMessagesRequest : public RequestOnceActor { } }; -class GetMessageEmbeddingCodeRequest : public RequestActor<> { +class GetMessageEmbeddingCodeRequest final : public RequestActor<> { FullMessageId full_message_id_; bool for_group_; @@ -1176,7 +1176,7 @@ class GetMessageEmbeddingCodeRequest : public RequestActor<> { } }; -class GetMessageLinkInfoRequest : public RequestActor { +class GetMessageLinkInfoRequest final : public RequestActor { string url_; MessageLinkInfo message_link_info_; @@ -1203,7 +1203,7 @@ class GetMessageLinkInfoRequest : public RequestActor { } }; -class EditMessageTextRequest : public RequestOnceActor { +class EditMessageTextRequest final : public RequestOnceActor { FullMessageId full_message_id_; tl_object_ptr reply_markup_; tl_object_ptr input_message_content_; @@ -1228,7 +1228,7 @@ class EditMessageTextRequest : public RequestOnceActor { } }; -class EditMessageLiveLocationRequest : public RequestOnceActor { +class EditMessageLiveLocationRequest final : public RequestOnceActor { FullMessageId full_message_id_; tl_object_ptr reply_markup_; tl_object_ptr location_; @@ -1257,7 +1257,7 @@ class EditMessageLiveLocationRequest : public RequestOnceActor { } }; -class EditMessageMediaRequest : public RequestOnceActor { +class EditMessageMediaRequest final : public RequestOnceActor { FullMessageId full_message_id_; tl_object_ptr reply_markup_; tl_object_ptr input_message_content_; @@ -1282,7 +1282,7 @@ class EditMessageMediaRequest : public RequestOnceActor { } }; -class EditMessageCaptionRequest : public RequestOnceActor { +class EditMessageCaptionRequest final : public RequestOnceActor { FullMessageId full_message_id_; tl_object_ptr reply_markup_; tl_object_ptr caption_; @@ -1307,7 +1307,7 @@ class EditMessageCaptionRequest : public RequestOnceActor { } }; -class EditMessageReplyMarkupRequest : public RequestOnceActor { +class EditMessageReplyMarkupRequest final : public RequestOnceActor { FullMessageId full_message_id_; tl_object_ptr reply_markup_; @@ -1328,7 +1328,7 @@ class EditMessageReplyMarkupRequest : public RequestOnceActor { } }; -class SetGameScoreRequest : public RequestOnceActor { +class SetGameScoreRequest final : public RequestOnceActor { FullMessageId full_message_id_; bool edit_message_; UserId user_id_; @@ -1356,7 +1356,7 @@ class SetGameScoreRequest : public RequestOnceActor { } }; -class GetGameHighScoresRequest : public RequestOnceActor { +class GetGameHighScoresRequest final : public RequestOnceActor { FullMessageId full_message_id_; UserId user_id_; @@ -1380,7 +1380,7 @@ class GetGameHighScoresRequest : public RequestOnceActor { } }; -class GetInlineGameHighScoresRequest : public RequestOnceActor { +class GetInlineGameHighScoresRequest final : public RequestOnceActor { string inline_message_id_; UserId user_id_; @@ -1404,7 +1404,7 @@ class GetInlineGameHighScoresRequest : public RequestOnceActor { } }; -class GetChatHistoryRequest : public RequestActor<> { +class GetChatHistoryRequest final : public RequestActor<> { DialogId dialog_id_; MessageId from_message_id_; int32 offset_; @@ -1437,7 +1437,7 @@ class GetChatHistoryRequest : public RequestActor<> { } }; -class GetMessageThreadHistoryRequest : public RequestActor<> { +class GetMessageThreadHistoryRequest final : public RequestActor<> { DialogId dialog_id_; MessageId message_id_; MessageId from_message_id_; @@ -1470,7 +1470,7 @@ class GetMessageThreadHistoryRequest : public RequestActor<> { } }; -class SearchChatMessagesRequest : public RequestActor<> { +class SearchChatMessagesRequest final : public RequestActor<> { DialogId dialog_id_; string query_; td_api::object_ptr sender_; @@ -1520,7 +1520,7 @@ class SearchChatMessagesRequest : public RequestActor<> { } }; -class SearchSecretMessagesRequest : public RequestActor<> { +class SearchSecretMessagesRequest final : public RequestActor<> { DialogId dialog_id_; string query_; string offset_; @@ -1552,7 +1552,7 @@ class SearchSecretMessagesRequest : public RequestActor<> { } }; -class SearchMessagesRequest : public RequestActor<> { +class SearchMessagesRequest final : public RequestActor<> { FolderId folder_id_; bool ignore_folder_id_; string query_; @@ -1605,7 +1605,7 @@ class SearchMessagesRequest : public RequestActor<> { } }; -class SearchCallMessagesRequest : public RequestActor<> { +class SearchCallMessagesRequest final : public RequestActor<> { MessageId from_message_id_; int32 limit_; bool only_missed_; @@ -1633,7 +1633,7 @@ class SearchCallMessagesRequest : public RequestActor<> { } }; -class SearchChatRecentLocationMessagesRequest : public RequestActor<> { +class SearchChatRecentLocationMessagesRequest final : public RequestActor<> { DialogId dialog_id_; int32 limit_; int64 random_id_; @@ -1655,7 +1655,7 @@ class SearchChatRecentLocationMessagesRequest : public RequestActor<> { } }; -class GetActiveLiveLocationMessagesRequest : public RequestActor<> { +class GetActiveLiveLocationMessagesRequest final : public RequestActor<> { vector full_message_ids_; void do_run(Promise &&promise) final { @@ -1672,7 +1672,7 @@ class GetActiveLiveLocationMessagesRequest : public RequestActor<> { } }; -class GetChatMessageByDateRequest : public RequestOnceActor { +class GetChatMessageByDateRequest final : public RequestOnceActor { DialogId dialog_id_; int32 date_; @@ -1692,7 +1692,7 @@ class GetChatMessageByDateRequest : public RequestOnceActor { } }; -class GetChatMessageCountRequest : public RequestActor<> { +class GetChatMessageCountRequest final : public RequestActor<> { DialogId dialog_id_; MessageSearchFilter filter_; bool return_local_; @@ -1720,7 +1720,7 @@ class GetChatMessageCountRequest : public RequestActor<> { } }; -class GetChatScheduledMessagesRequest : public RequestActor<> { +class GetChatScheduledMessagesRequest final : public RequestActor<> { DialogId dialog_id_; vector message_ids_; @@ -1741,7 +1741,7 @@ class GetChatScheduledMessagesRequest : public RequestActor<> { } }; -class GetMessagePublicForwardsRequest : public RequestActor<> { +class GetMessagePublicForwardsRequest final : public RequestActor<> { FullMessageId full_message_id_; string offset_; int32 limit_; @@ -1769,7 +1769,7 @@ class GetMessagePublicForwardsRequest : public RequestActor<> { } }; -class GetWebPagePreviewRequest : public RequestOnceActor { +class GetWebPagePreviewRequest final : public RequestOnceActor { td_api::object_ptr text_; int64 request_id_ = 0; @@ -1788,7 +1788,7 @@ class GetWebPagePreviewRequest : public RequestOnceActor { } }; -class GetWebPageInstantViewRequest : public RequestActor<> { +class GetWebPageInstantViewRequest final : public RequestActor<> { string url_; bool force_full_; @@ -1810,7 +1810,7 @@ class GetWebPageInstantViewRequest : public RequestActor<> { } }; -class CreateChatRequest : public RequestActor<> { +class CreateChatRequest final : public RequestActor<> { DialogId dialog_id_; bool force_; @@ -1828,7 +1828,7 @@ class CreateChatRequest : public RequestActor<> { } }; -class CreateNewGroupChatRequest : public RequestActor<> { +class CreateNewGroupChatRequest final : public RequestActor<> { vector user_ids_; string title_; int64 random_id_; @@ -1853,7 +1853,7 @@ class CreateNewGroupChatRequest : public RequestActor<> { } }; -class CreateNewSecretChatRequest : public RequestActor { +class CreateNewSecretChatRequest final : public RequestActor { UserId user_id_; SecretChatId secret_chat_id_; @@ -1888,7 +1888,7 @@ class CreateNewSecretChatRequest : public RequestActor { } }; -class CreateNewSupergroupChatRequest : public RequestActor<> { +class CreateNewSupergroupChatRequest final : public RequestActor<> { string title_; bool is_megagroup_; string description_; @@ -1922,7 +1922,7 @@ class CreateNewSupergroupChatRequest : public RequestActor<> { } }; -class UpgradeGroupChatToSupergroupChatRequest : public RequestActor<> { +class UpgradeGroupChatToSupergroupChatRequest final : public RequestActor<> { string title_; DialogId dialog_id_; @@ -1943,7 +1943,7 @@ class UpgradeGroupChatToSupergroupChatRequest : public RequestActor<> { } }; -class GetChatMemberRequest : public RequestActor<> { +class GetChatMemberRequest final : public RequestActor<> { DialogId dialog_id_; DialogId participant_dialog_id_; int64 random_id_; @@ -1974,7 +1974,7 @@ class GetChatMemberRequest : public RequestActor<> { } }; -class GetChatAdministratorsRequest : public RequestActor<> { +class GetChatAdministratorsRequest final : public RequestActor<> { DialogId dialog_id_; vector administrators_; @@ -1998,7 +1998,7 @@ class GetChatAdministratorsRequest : public RequestActor<> { } }; -class CheckChatInviteLinkRequest : public RequestActor<> { +class CheckChatInviteLinkRequest final : public RequestActor<> { string invite_link_; void do_run(Promise &&promise) final { @@ -2017,7 +2017,7 @@ class CheckChatInviteLinkRequest : public RequestActor<> { } }; -class JoinChatByInviteLinkRequest : public RequestActor { +class JoinChatByInviteLinkRequest final : public RequestActor { string invite_link_; DialogId dialog_id_; @@ -2046,7 +2046,7 @@ class JoinChatByInviteLinkRequest : public RequestActor { } }; -class GetChatEventLogRequest : public RequestOnceActor { +class GetChatEventLogRequest final : public RequestOnceActor { DialogId dialog_id_; string query_; int64 from_event_id_; @@ -2079,7 +2079,7 @@ class GetChatEventLogRequest : public RequestOnceActor { } }; -class GetBlockedMessageSendersRequest : public RequestActor<> { +class GetBlockedMessageSendersRequest final : public RequestActor<> { int32 offset_; int32 limit_; int64 random_id_; @@ -2104,7 +2104,7 @@ class GetBlockedMessageSendersRequest : public RequestActor<> { } }; -class ImportContactsRequest : public RequestActor<> { +class ImportContactsRequest final : public RequestActor<> { vector> contacts_; int64 random_id_; @@ -2132,7 +2132,7 @@ class ImportContactsRequest : public RequestActor<> { } }; -class SearchContactsRequest : public RequestActor<> { +class SearchContactsRequest final : public RequestActor<> { string query_; int32 limit_; @@ -2152,7 +2152,7 @@ class SearchContactsRequest : public RequestActor<> { } }; -class RemoveContactsRequest : public RequestActor<> { +class RemoveContactsRequest final : public RequestActor<> { vector user_ids_; void do_run(Promise &&promise) final { @@ -2166,7 +2166,7 @@ class RemoveContactsRequest : public RequestActor<> { } }; -class GetImportedContactCountRequest : public RequestActor<> { +class GetImportedContactCountRequest final : public RequestActor<> { int32 imported_contact_count_ = 0; void do_run(Promise &&promise) final { @@ -2182,7 +2182,7 @@ class GetImportedContactCountRequest : public RequestActor<> { } }; -class ChangeImportedContactsRequest : public RequestActor<> { +class ChangeImportedContactsRequest final : public RequestActor<> { vector> contacts_; size_t contacts_size_; int64 random_id_; @@ -2216,7 +2216,7 @@ class ChangeImportedContactsRequest : public RequestActor<> { } }; -class GetRecentInlineBotsRequest : public RequestActor<> { +class GetRecentInlineBotsRequest final : public RequestActor<> { vector user_ids_; void do_run(Promise &&promise) final { @@ -2232,7 +2232,7 @@ class GetRecentInlineBotsRequest : public RequestActor<> { } }; -class GetUserProfilePhotosRequest : public RequestActor<> { +class GetUserProfilePhotosRequest final : public RequestActor<> { UserId user_id_; int32 offset_; int32 limit_; @@ -2259,7 +2259,7 @@ class GetUserProfilePhotosRequest : public RequestActor<> { } }; -class GetChatNotificationSettingsExceptionsRequest : public RequestActor<> { +class GetChatNotificationSettingsExceptionsRequest final : public RequestActor<> { NotificationSettingsScope scope_; bool filter_scope_; bool compare_sound_; @@ -2286,7 +2286,7 @@ class GetChatNotificationSettingsExceptionsRequest : public RequestActor<> { } }; -class GetScopeNotificationSettingsRequest : public RequestActor<> { +class GetScopeNotificationSettingsRequest final : public RequestActor<> { NotificationSettingsScope scope_; const ScopeNotificationSettings *notification_settings_ = nullptr; @@ -2306,7 +2306,7 @@ class GetScopeNotificationSettingsRequest : public RequestActor<> { } }; -class GetStickersRequest : public RequestActor<> { +class GetStickersRequest final : public RequestActor<> { string emoji_; int32 limit_; @@ -2327,7 +2327,7 @@ class GetStickersRequest : public RequestActor<> { } }; -class SearchStickersRequest : public RequestActor<> { +class SearchStickersRequest final : public RequestActor<> { string emoji_; int32 limit_; @@ -2347,7 +2347,7 @@ class SearchStickersRequest : public RequestActor<> { } }; -class GetInstalledStickerSetsRequest : public RequestActor<> { +class GetInstalledStickerSetsRequest final : public RequestActor<> { bool is_masks_; vector sticker_set_ids_; @@ -2366,7 +2366,7 @@ class GetInstalledStickerSetsRequest : public RequestActor<> { } }; -class GetArchivedStickerSetsRequest : public RequestActor<> { +class GetArchivedStickerSetsRequest final : public RequestActor<> { bool is_masks_; StickerSetId offset_sticker_set_id_; int32 limit_; @@ -2393,7 +2393,7 @@ class GetArchivedStickerSetsRequest : public RequestActor<> { } }; -class GetTrendingStickerSetsRequest : public RequestActor<> { +class GetTrendingStickerSetsRequest final : public RequestActor<> { std::pair> sticker_set_ids_; int32 offset_; int32 limit_; @@ -2413,7 +2413,7 @@ class GetTrendingStickerSetsRequest : public RequestActor<> { } }; -class GetAttachedStickerSetsRequest : public RequestActor<> { +class GetAttachedStickerSetsRequest final : public RequestActor<> { FileId file_id_; vector sticker_set_ids_; @@ -2432,7 +2432,7 @@ class GetAttachedStickerSetsRequest : public RequestActor<> { } }; -class GetStickerSetRequest : public RequestActor<> { +class GetStickerSetRequest final : public RequestActor<> { StickerSetId set_id_; StickerSetId sticker_set_id_; @@ -2452,7 +2452,7 @@ class GetStickerSetRequest : public RequestActor<> { } }; -class SearchStickerSetRequest : public RequestActor<> { +class SearchStickerSetRequest final : public RequestActor<> { string name_; StickerSetId sticker_set_id_; @@ -2472,7 +2472,7 @@ class SearchStickerSetRequest : public RequestActor<> { } }; -class SearchInstalledStickerSetsRequest : public RequestActor<> { +class SearchInstalledStickerSetsRequest final : public RequestActor<> { bool is_masks_; string query_; int32 limit_; @@ -2494,7 +2494,7 @@ class SearchInstalledStickerSetsRequest : public RequestActor<> { } }; -class SearchStickerSetsRequest : public RequestActor<> { +class SearchStickerSetsRequest final : public RequestActor<> { string query_; vector sticker_set_ids_; @@ -2513,7 +2513,7 @@ class SearchStickerSetsRequest : public RequestActor<> { } }; -class ChangeStickerSetRequest : public RequestOnceActor { +class ChangeStickerSetRequest final : public RequestOnceActor { StickerSetId set_id_; bool is_installed_; bool is_archived_; @@ -2532,7 +2532,7 @@ class ChangeStickerSetRequest : public RequestOnceActor { } }; -class UploadStickerFileRequest : public RequestOnceActor { +class UploadStickerFileRequest final : public RequestOnceActor { UserId user_id_; tl_object_ptr sticker_; @@ -2553,7 +2553,7 @@ class UploadStickerFileRequest : public RequestOnceActor { } }; -class CreateNewStickerSetRequest : public RequestOnceActor { +class CreateNewStickerSetRequest final : public RequestOnceActor { UserId user_id_; string title_; string name_; @@ -2587,7 +2587,7 @@ class CreateNewStickerSetRequest : public RequestOnceActor { } }; -class AddStickerToSetRequest : public RequestOnceActor { +class AddStickerToSetRequest final : public RequestOnceActor { UserId user_id_; string name_; tl_object_ptr sticker_; @@ -2614,7 +2614,7 @@ class AddStickerToSetRequest : public RequestOnceActor { } }; -class SetStickerSetThumbnailRequest : public RequestOnceActor { +class SetStickerSetThumbnailRequest final : public RequestOnceActor { UserId user_id_; string name_; tl_object_ptr thumbnail_; @@ -2641,7 +2641,7 @@ class SetStickerSetThumbnailRequest : public RequestOnceActor { } }; -class GetRecentStickersRequest : public RequestActor<> { +class GetRecentStickersRequest final : public RequestActor<> { bool is_attached_; vector sticker_ids_; @@ -2660,7 +2660,7 @@ class GetRecentStickersRequest : public RequestActor<> { } }; -class AddRecentStickerRequest : public RequestActor<> { +class AddRecentStickerRequest final : public RequestActor<> { bool is_attached_; tl_object_ptr input_file_; @@ -2676,7 +2676,7 @@ class AddRecentStickerRequest : public RequestActor<> { } }; -class RemoveRecentStickerRequest : public RequestActor<> { +class RemoveRecentStickerRequest final : public RequestActor<> { bool is_attached_; tl_object_ptr input_file_; @@ -2692,7 +2692,7 @@ class RemoveRecentStickerRequest : public RequestActor<> { } }; -class ClearRecentStickersRequest : public RequestActor<> { +class ClearRecentStickersRequest final : public RequestActor<> { bool is_attached_; void do_run(Promise &&promise) final { @@ -2706,7 +2706,7 @@ class ClearRecentStickersRequest : public RequestActor<> { } }; -class GetFavoriteStickersRequest : public RequestActor<> { +class GetFavoriteStickersRequest final : public RequestActor<> { vector sticker_ids_; void do_run(Promise &&promise) final { @@ -2722,7 +2722,7 @@ class GetFavoriteStickersRequest : public RequestActor<> { } }; -class AddFavoriteStickerRequest : public RequestOnceActor { +class AddFavoriteStickerRequest final : public RequestOnceActor { tl_object_ptr input_file_; void do_run(Promise &&promise) final { @@ -2736,7 +2736,7 @@ class AddFavoriteStickerRequest : public RequestOnceActor { } }; -class RemoveFavoriteStickerRequest : public RequestOnceActor { +class RemoveFavoriteStickerRequest final : public RequestOnceActor { tl_object_ptr input_file_; void do_run(Promise &&promise) final { @@ -2750,7 +2750,7 @@ class RemoveFavoriteStickerRequest : public RequestOnceActor { } }; -class GetStickerEmojisRequest : public RequestActor<> { +class GetStickerEmojisRequest final : public RequestActor<> { tl_object_ptr input_file_; vector emojis_; @@ -2770,7 +2770,7 @@ class GetStickerEmojisRequest : public RequestActor<> { } }; -class SearchEmojisRequest : public RequestActor<> { +class SearchEmojisRequest final : public RequestActor<> { string text_; bool exact_match_; vector input_language_codes_; @@ -2797,7 +2797,7 @@ class SearchEmojisRequest : public RequestActor<> { } }; -class GetEmojiSuggestionsUrlRequest : public RequestOnceActor { +class GetEmojiSuggestionsUrlRequest final : public RequestOnceActor { string language_code_; int64 random_id_; @@ -2816,7 +2816,7 @@ class GetEmojiSuggestionsUrlRequest : public RequestOnceActor { } }; -class GetSavedAnimationsRequest : public RequestActor<> { +class GetSavedAnimationsRequest final : public RequestActor<> { vector animation_ids_; void do_run(Promise &&promise) final { @@ -2834,7 +2834,7 @@ class GetSavedAnimationsRequest : public RequestActor<> { } }; -class AddSavedAnimationRequest : public RequestOnceActor { +class AddSavedAnimationRequest final : public RequestOnceActor { tl_object_ptr input_file_; void do_run(Promise &&promise) final { @@ -2848,7 +2848,7 @@ class AddSavedAnimationRequest : public RequestOnceActor { } }; -class RemoveSavedAnimationRequest : public RequestOnceActor { +class RemoveSavedAnimationRequest final : public RequestOnceActor { tl_object_ptr input_file_; void do_run(Promise &&promise) final { @@ -2862,7 +2862,7 @@ class RemoveSavedAnimationRequest : public RequestOnceActor { } }; -class GetInlineQueryResultsRequest : public RequestOnceActor { +class GetInlineQueryResultsRequest final : public RequestOnceActor { UserId bot_user_id_; DialogId dialog_id_; Location user_location_; @@ -2893,7 +2893,7 @@ class GetInlineQueryResultsRequest : public RequestOnceActor { } }; -class GetCallbackQueryAnswerRequest : public RequestOnceActor { +class GetCallbackQueryAnswerRequest final : public RequestOnceActor { FullMessageId full_message_id_; tl_object_ptr payload_; @@ -2925,7 +2925,7 @@ class GetCallbackQueryAnswerRequest : public RequestOnceActor { } }; -class GetSupportUserRequest : public RequestActor<> { +class GetSupportUserRequest final : public RequestActor<> { UserId user_id_; void do_run(Promise &&promise) final { @@ -2941,7 +2941,7 @@ class GetSupportUserRequest : public RequestActor<> { } }; -class GetBackgroundsRequest : public RequestOnceActor { +class GetBackgroundsRequest final : public RequestOnceActor { bool for_dark_theme_; void do_run(Promise &&promise) final { @@ -2958,7 +2958,7 @@ class GetBackgroundsRequest : public RequestOnceActor { } }; -class SearchBackgroundRequest : public RequestActor<> { +class SearchBackgroundRequest final : public RequestActor<> { string name_; std::pair background_; @@ -2978,7 +2978,7 @@ class SearchBackgroundRequest : public RequestActor<> { } }; -class SetBackgroundRequest : public RequestActor<> { +class SetBackgroundRequest final : public RequestActor<> { td_api::object_ptr input_background_; td_api::object_ptr background_type_; bool for_dark_theme_ = false; @@ -4056,7 +4056,7 @@ void Td::close_impl(bool destroy_flag) { send_closure_later(actor_id(this), &Td::dec_request_actor_refcnt); // remove guard } -class Td::DownloadFileCallback : public FileManager::DownloadCallback { +class Td::DownloadFileCallback final : public FileManager::DownloadCallback { public: void on_progress(FileId file_id) final { } @@ -4070,7 +4070,7 @@ class Td::DownloadFileCallback : public FileManager::DownloadCallback { } }; -class Td::UploadFileCallback : public FileManager::UploadCallback { +class Td::UploadFileCallback final : public FileManager::UploadCallback { public: void on_progress(FileId file_id) final { } @@ -4246,7 +4246,7 @@ Status Td::init(DbKey key) { void Td::init_options_and_network() { VLOG(td_init) << "Create StateManager"; - class StateManagerCallback : public StateManager::Callback { + class StateManagerCallback final : public StateManager::Callback { public: explicit StateManagerCallback(ActorShared td) : td_(std::move(td)) { } @@ -4298,7 +4298,7 @@ void Td::init_options_and_network() { G()->set_config_manager(config_manager_.get()); VLOG(td_init) << "Set ConfigShared callback"; - class ConfigSharedCallback : public ConfigShared::Callback { + class ConfigSharedCallback final : public ConfigShared::Callback { public: void on_option_updated(const string &name, const string &value) const final { send_closure(G()->td(), &Td::on_config_option_updated, name); @@ -4357,7 +4357,7 @@ void Td::init_file_manager() { download_file_callback_ = std::make_shared(); upload_file_callback_ = std::make_shared(); - class FileManagerContext : public FileManager::Context { + class FileManagerContext final : public FileManager::Context { public: explicit FileManagerContext(Td *td) : td_(td) { } diff --git a/td/telegram/TermsOfService.cpp b/td/telegram/TermsOfService.cpp index 1201ee9bd..654be4697 100644 --- a/td/telegram/TermsOfService.cpp +++ b/td/telegram/TermsOfService.cpp @@ -17,7 +17,7 @@ namespace td { -class GetTermsOfServiceUpdateQuery : public Td::ResultHandler { +class GetTermsOfServiceUpdateQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -58,7 +58,7 @@ class GetTermsOfServiceUpdateQuery : public Td::ResultHandler { } }; -class AcceptTermsOfServiceQuery : public Td::ResultHandler { +class AcceptTermsOfServiceQuery final : public Td::ResultHandler { Promise promise_; public: diff --git a/td/telegram/TopDialogManager.h b/td/telegram/TopDialogManager.h index ad996abc3..dedb31d13 100644 --- a/td/telegram/TopDialogManager.h +++ b/td/telegram/TopDialogManager.h @@ -22,7 +22,7 @@ namespace td { -class TopDialogManager : public NetQueryCallback { +class TopDialogManager final : public NetQueryCallback { public: explicit TopDialogManager(ActorShared<> parent) : parent_(std::move(parent)) { } diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 9c8419811..4748242fe 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -86,7 +86,7 @@ class OnUpdate { } }; -class GetUpdatesStateQuery : public Td::ResultHandler { +class GetUpdatesStateQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -112,7 +112,7 @@ class GetUpdatesStateQuery : public Td::ResultHandler { } }; -class PingServerQuery : public Td::ResultHandler { +class PingServerQuery final : public Td::ResultHandler { Promise> promise_; public: @@ -138,7 +138,7 @@ class PingServerQuery : public Td::ResultHandler { } }; -class GetDifferenceQuery : public Td::ResultHandler { +class GetDifferenceQuery final : public Td::ResultHandler { Promise> promise_; public: diff --git a/td/telegram/UpdatesManager.h b/td/telegram/UpdatesManager.h index fee234470..4013dd882 100644 --- a/td/telegram/UpdatesManager.h +++ b/td/telegram/UpdatesManager.h @@ -33,7 +33,7 @@ extern int VERBOSITY_NAME(get_difference); class Td; -class dummyUpdate : public telegram_api::Update { +class dummyUpdate final : public telegram_api::Update { public: static constexpr int32 ID = 1234567891; int32 get_id() const final { @@ -54,7 +54,7 @@ class dummyUpdate : public telegram_api::Update { } }; -class updateSentMessage : public telegram_api::Update { +class updateSentMessage final : public telegram_api::Update { public: int64 random_id_; MessageId message_id_; @@ -88,7 +88,7 @@ class updateSentMessage : public telegram_api::Update { } }; -class UpdatesManager : public Actor { +class UpdatesManager final : public Actor { public: UpdatesManager(Td *td, ActorShared<> parent); diff --git a/td/telegram/WebPageBlock.cpp b/td/telegram/WebPageBlock.cpp index 791157552..4e7a9068f 100644 --- a/td/telegram/WebPageBlock.cpp +++ b/td/telegram/WebPageBlock.cpp @@ -432,7 +432,7 @@ class RelatedArticle { } }; -class WebPageBlockTitle : public WebPageBlock { +class WebPageBlockTitle final : public WebPageBlock { RichText title; public: @@ -466,7 +466,7 @@ class WebPageBlockTitle : public WebPageBlock { } }; -class WebPageBlockSubtitle : public WebPageBlock { +class WebPageBlockSubtitle final : public WebPageBlock { RichText subtitle; public: @@ -499,7 +499,7 @@ class WebPageBlockSubtitle : public WebPageBlock { } }; -class WebPageBlockAuthorDate : public WebPageBlock { +class WebPageBlockAuthorDate final : public WebPageBlock { RichText author; int32 date = 0; @@ -535,7 +535,7 @@ class WebPageBlockAuthorDate : public WebPageBlock { } }; -class WebPageBlockHeader : public WebPageBlock { +class WebPageBlockHeader final : public WebPageBlock { RichText header; public: @@ -568,7 +568,7 @@ class WebPageBlockHeader : public WebPageBlock { } }; -class WebPageBlockSubheader : public WebPageBlock { +class WebPageBlockSubheader final : public WebPageBlock { RichText subheader; public: @@ -601,7 +601,7 @@ class WebPageBlockSubheader : public WebPageBlock { } }; -class WebPageBlockKicker : public WebPageBlock { +class WebPageBlockKicker final : public WebPageBlock { RichText kicker; public: @@ -634,7 +634,7 @@ class WebPageBlockKicker : public WebPageBlock { } }; -class WebPageBlockParagraph : public WebPageBlock { +class WebPageBlockParagraph final : public WebPageBlock { RichText text; public: @@ -667,7 +667,7 @@ class WebPageBlockParagraph : public WebPageBlock { } }; -class WebPageBlockPreformatted : public WebPageBlock { +class WebPageBlockPreformatted final : public WebPageBlock { RichText text; string language; @@ -703,7 +703,7 @@ class WebPageBlockPreformatted : public WebPageBlock { } }; -class WebPageBlockFooter : public WebPageBlock { +class WebPageBlockFooter final : public WebPageBlock { RichText footer; public: @@ -736,7 +736,7 @@ class WebPageBlockFooter : public WebPageBlock { } }; -class WebPageBlockDivider : public WebPageBlock { +class WebPageBlockDivider final : public WebPageBlock { public: Type get_type() const final { return Type::Divider; @@ -758,7 +758,7 @@ class WebPageBlockDivider : public WebPageBlock { } }; -class WebPageBlockAnchor : public WebPageBlock { +class WebPageBlockAnchor final : public WebPageBlock { string name; public: @@ -793,7 +793,7 @@ class WebPageBlockAnchor : public WebPageBlock { } }; -class WebPageBlockList : public WebPageBlock { +class WebPageBlockList final : public WebPageBlock { public: struct Item { string label; @@ -883,7 +883,7 @@ class WebPageBlockList : public WebPageBlock { } }; -class WebPageBlockBlockQuote : public WebPageBlock { +class WebPageBlockBlockQuote final : public WebPageBlock { RichText text; RichText credit; @@ -921,7 +921,7 @@ class WebPageBlockBlockQuote : public WebPageBlock { } }; -class WebPageBlockPullQuote : public WebPageBlock { +class WebPageBlockPullQuote final : public WebPageBlock { RichText text; RichText credit; @@ -959,7 +959,7 @@ class WebPageBlockPullQuote : public WebPageBlock { } }; -class WebPageBlockAnimation : public WebPageBlock { +class WebPageBlockAnimation final : public WebPageBlock { FileId animation_file_id; WebPageBlockCaption caption; bool need_autoplay = false; @@ -1025,7 +1025,7 @@ class WebPageBlockAnimation : public WebPageBlock { } }; -class WebPageBlockPhoto : public WebPageBlock { +class WebPageBlockPhoto final : public WebPageBlock { Photo photo; WebPageBlockCaption caption; string url; @@ -1075,7 +1075,7 @@ class WebPageBlockPhoto : public WebPageBlock { } }; -class WebPageBlockVideo : public WebPageBlock { +class WebPageBlockVideo final : public WebPageBlock { FileId video_file_id; WebPageBlockCaption caption; bool need_autoplay = false; @@ -1144,7 +1144,7 @@ class WebPageBlockVideo : public WebPageBlock { } }; -class WebPageBlockCover : public WebPageBlock { +class WebPageBlockCover final : public WebPageBlock { unique_ptr cover; public: @@ -1177,7 +1177,7 @@ class WebPageBlockCover : public WebPageBlock { } }; -class WebPageBlockEmbedded : public WebPageBlock { +class WebPageBlockEmbedded final : public WebPageBlock { string url; string html; Photo poster_photo; @@ -1245,7 +1245,7 @@ class WebPageBlockEmbedded : public WebPageBlock { } }; -class WebPageBlockEmbeddedPost : public WebPageBlock { +class WebPageBlockEmbeddedPost final : public WebPageBlock { string url; string author; Photo author_photo; @@ -1306,7 +1306,7 @@ class WebPageBlockEmbeddedPost : public WebPageBlock { } }; -class WebPageBlockCollage : public WebPageBlock { +class WebPageBlockCollage final : public WebPageBlock { vector> page_blocks; WebPageBlockCaption caption; @@ -1347,7 +1347,7 @@ class WebPageBlockCollage : public WebPageBlock { } }; -class WebPageBlockSlideshow : public WebPageBlock { +class WebPageBlockSlideshow final : public WebPageBlock { vector> page_blocks; WebPageBlockCaption caption; @@ -1388,7 +1388,7 @@ class WebPageBlockSlideshow : public WebPageBlock { } }; -class WebPageBlockChatLink : public WebPageBlock { +class WebPageBlockChatLink final : public WebPageBlock { string title; DialogPhoto photo; string username; @@ -1429,7 +1429,7 @@ class WebPageBlockChatLink : public WebPageBlock { } }; -class WebPageBlockAudio : public WebPageBlock { +class WebPageBlockAudio final : public WebPageBlock { FileId audio_file_id; WebPageBlockCaption caption; @@ -1498,7 +1498,7 @@ class WebPageBlockAudio : public WebPageBlock { } }; -class WebPageBlockTable : public WebPageBlock { +class WebPageBlockTable final : public WebPageBlock { RichText title; vector> cells; bool is_bordered = false; @@ -1556,7 +1556,7 @@ class WebPageBlockTable : public WebPageBlock { } }; -class WebPageBlockDetails : public WebPageBlock { +class WebPageBlockDetails final : public WebPageBlock { RichText header; vector> page_blocks; bool is_open; @@ -1604,7 +1604,7 @@ class WebPageBlockDetails : public WebPageBlock { } }; -class WebPageBlockRelatedArticles : public WebPageBlock { +class WebPageBlockRelatedArticles final : public WebPageBlock { RichText header; vector related_articles; @@ -1652,7 +1652,7 @@ class WebPageBlockRelatedArticles : public WebPageBlock { } }; -class WebPageBlockMap : public WebPageBlock { +class WebPageBlockMap final : public WebPageBlock { Location location; int32 zoom = 0; Dimensions dimensions; @@ -1696,7 +1696,7 @@ class WebPageBlockMap : public WebPageBlock { } }; -class WebPageBlockVoiceNote : public WebPageBlock { +class WebPageBlockVoiceNote final : public WebPageBlock { FileId voice_note_file_id; WebPageBlockCaption caption; diff --git a/td/telegram/WebPagesManager.cpp b/td/telegram/WebPagesManager.cpp index 0bae16567..bb3195a21 100644 --- a/td/telegram/WebPagesManager.cpp +++ b/td/telegram/WebPagesManager.cpp @@ -53,7 +53,7 @@ namespace td { -class GetWebPagePreviewQuery : public Td::ResultHandler { +class GetWebPagePreviewQuery final : public Td::ResultHandler { Promise promise_; int64 request_id_; string url_; @@ -92,7 +92,7 @@ class GetWebPagePreviewQuery : public Td::ResultHandler { } }; -class GetWebPageQuery : public Td::ResultHandler { +class GetWebPageQuery final : public Td::ResultHandler { Promise promise_; WebPageId web_page_id_; string url_; diff --git a/td/telegram/WebPagesManager.h b/td/telegram/WebPagesManager.h index 96f4b0b47..dff35a444 100644 --- a/td/telegram/WebPagesManager.h +++ b/td/telegram/WebPagesManager.h @@ -33,7 +33,7 @@ struct BinlogEvent; class Td; -class WebPagesManager : public Actor { +class WebPagesManager final : public Actor { public: WebPagesManager(Td *td, ActorShared<> parent); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 2da425263..20c30f969 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -190,7 +190,7 @@ static char **tg_cli_completion(const char *text, int start, int end) { } #endif -class CliLog : public LogInterface { +class CliLog final : public LogInterface { void do_append(int log_level, CSlice slice) final { #ifdef USE_READLINE deactivate_readline(); @@ -915,7 +915,7 @@ class CliClient final : public Actor { } LOG(WARNING) << "Creating new TD " << name << " with generation " << generation_ + 1; - class TdCallbackImpl : public TdCallback { + class TdCallbackImpl final : public TdCallback { public: TdCallbackImpl(CliClient *client, uint64 generation) : client_(client), generation_(generation) { } @@ -4594,7 +4594,7 @@ void main(int argc, char **argv) { ConcurrentScheduler scheduler; scheduler.init(3); - class CreateClient : public Actor { + class CreateClient final : public Actor { public: CreateClient(ConcurrentScheduler *scheduler, bool use_test_dc, bool get_chat_list, bool disable_network, int32 api_id, std::string api_hash) diff --git a/td/telegram/files/FileDb.cpp b/td/telegram/files/FileDb.cpp index 99ae0ee07..e9d2ad5ac 100644 --- a/td/telegram/files/FileDb.cpp +++ b/td/telegram/files/FileDb.cpp @@ -57,9 +57,9 @@ Status init_file_db(SqliteDb &db, int32 version) { return Status::OK(); } -class FileDb : public FileDbInterface { +class FileDb final : public FileDbInterface { public: - class FileDbActor : public Actor { + class FileDbActor final : public Actor { public: FileDbActor(FileDbId current_pmc_id, std::shared_ptr file_kv_safe) : current_pmc_id_(current_pmc_id), file_kv_safe_(std::move(file_kv_safe)) { diff --git a/td/telegram/files/FileDownloader.h b/td/telegram/files/FileDownloader.h index c78e33ccc..bb03cab18 100644 --- a/td/telegram/files/FileDownloader.h +++ b/td/telegram/files/FileDownloader.h @@ -23,7 +23,7 @@ #include namespace td { -class FileDownloader : public FileLoader { +class FileDownloader final : public FileLoader { public: class Callback : public FileLoader::Callback { public: diff --git a/td/telegram/files/FileFromBytes.h b/td/telegram/files/FileFromBytes.h index 7d9125447..73ec0a00e 100644 --- a/td/telegram/files/FileFromBytes.h +++ b/td/telegram/files/FileFromBytes.h @@ -18,7 +18,7 @@ #include "td/utils/Status.h" namespace td { -class FileFromBytes : public FileLoaderActor { +class FileFromBytes final : public FileLoaderActor { public: class Callback { public: diff --git a/td/telegram/files/FileGcWorker.h b/td/telegram/files/FileGcWorker.h index ae91fb179..e7e6f8dbc 100644 --- a/td/telegram/files/FileGcWorker.h +++ b/td/telegram/files/FileGcWorker.h @@ -24,7 +24,7 @@ struct FileGcResult { FileStats removed_file_stats_; }; -class FileGcWorker : public Actor { +class FileGcWorker final : public Actor { public: FileGcWorker(ActorShared<> parent, CancellationToken token) : parent_(std::move(parent)), token_(std::move(token)) { } diff --git a/td/telegram/files/FileGenerateManager.cpp b/td/telegram/files/FileGenerateManager.cpp index 886bcea99..0af04cb75 100644 --- a/td/telegram/files/FileGenerateManager.cpp +++ b/td/telegram/files/FileGenerateManager.cpp @@ -44,7 +44,7 @@ class FileGenerateActor : public Actor { virtual void file_generate_finish(Status status, Promise<> promise) = 0; }; -class FileDownloadGenerateActor : public FileGenerateActor { +class FileDownloadGenerateActor final : public FileGenerateActor { public: FileDownloadGenerateActor(FileType file_type, FileId file_id, unique_ptr callback, ActorShared<> parent) @@ -65,7 +65,7 @@ class FileDownloadGenerateActor : public FileGenerateActor { void start_up() final { LOG(INFO) << "Generate by downloading " << file_id_; - class Callback : public FileManager::DownloadCallback { + class Callback final : public FileManager::DownloadCallback { public: explicit Callback(ActorId parent) : parent_(std::move(parent)) { } @@ -112,7 +112,7 @@ class FileDownloadGenerateActor : public FileGenerateActor { } }; -class MapDownloadGenerateActor : public FileGenerateActor { +class MapDownloadGenerateActor final : public FileGenerateActor { public: MapDownloadGenerateActor(string conversion, unique_ptr callback, ActorShared<> parent) : conversion_(std::move(conversion)), callback_(std::move(callback)), parent_(std::move(parent)) { @@ -130,7 +130,7 @@ class MapDownloadGenerateActor : public FileGenerateActor { ActorShared<> parent_; string file_name_; - class Callback : public NetQueryCallback { + class Callback final : public NetQueryCallback { ActorId parent_; public: @@ -236,7 +236,7 @@ class MapDownloadGenerateActor : public FileGenerateActor { } }; -class FileExternalGenerateActor : public FileGenerateActor { +class FileExternalGenerateActor final : public FileGenerateActor { public: FileExternalGenerateActor(uint64 query_id, const FullGenerateFileLocation &generate_location, const LocalFileLocation &local_location, string name, diff --git a/td/telegram/files/FileGenerateManager.h b/td/telegram/files/FileGenerateManager.h index 7088aaecf..a5063e7b3 100644 --- a/td/telegram/files/FileGenerateManager.h +++ b/td/telegram/files/FileGenerateManager.h @@ -31,7 +31,7 @@ class FileGenerateCallback { virtual void on_error(Status error) = 0; }; -class FileGenerateManager : public Actor { +class FileGenerateManager final : public Actor { public: explicit FileGenerateManager(ActorShared<> parent) : parent_(std::move(parent)) { } diff --git a/td/telegram/files/FileHashUploader.h b/td/telegram/files/FileHashUploader.h index 516169f0d..3652cfd2b 100644 --- a/td/telegram/files/FileHashUploader.h +++ b/td/telegram/files/FileHashUploader.h @@ -19,7 +19,7 @@ namespace td { -class FileHashUploader : public FileLoaderActor { +class FileHashUploader final : public FileLoaderActor { public: class Callback { public: diff --git a/td/telegram/files/FileLoadManager.h b/td/telegram/files/FileLoadManager.h index 6fa82357e..47fdaf85c 100644 --- a/td/telegram/files/FileLoadManager.h +++ b/td/telegram/files/FileLoadManager.h @@ -93,7 +93,7 @@ class FileLoadManager final : public Actor { void on_error(Status status); void on_error_impl(NodeId node_id, Status status); - class FileDownloaderCallback : public FileDownloader::Callback { + class FileDownloaderCallback final : public FileDownloader::Callback { public: explicit FileDownloaderCallback(ActorShared actor_id) : actor_id_(std::move(actor_id)) { } @@ -115,7 +115,7 @@ class FileLoadManager final : public Actor { } }; - class FileUploaderCallback : public FileUploader::Callback { + class FileUploaderCallback final : public FileUploader::Callback { public: explicit FileUploaderCallback(ActorShared actor_id) : actor_id_(std::move(actor_id)) { } @@ -136,7 +136,7 @@ class FileLoadManager final : public Actor { send_closure(std::move(actor_id_), &FileLoadManager::on_error, std::move(status)); } }; - class FileHashUploaderCallback : public FileHashUploader::Callback { + class FileHashUploaderCallback final : public FileHashUploader::Callback { public: explicit FileHashUploaderCallback(ActorShared actor_id) : actor_id_(std::move(actor_id)) { } @@ -152,7 +152,7 @@ class FileLoadManager final : public Actor { } }; - class FileFromBytesCallback : public FileFromBytes::Callback { + class FileFromBytesCallback final : public FileFromBytes::Callback { public: explicit FileFromBytesCallback(ActorShared actor_id) : actor_id_(std::move(actor_id)) { } diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp index e7660c591..85e82c9a6 100644 --- a/td/telegram/files/FileManager.cpp +++ b/td/telegram/files/FileManager.cpp @@ -2327,7 +2327,7 @@ void FileManager::run_download(FileNodePtr node, bool force_update_priority) { download_limit, priority); } -class FileManager::ForceUploadActor : public Actor { +class FileManager::ForceUploadActor final : public Actor { public: ForceUploadActor(FileManager *file_manager, FileId file_id, std::shared_ptr callback, int32 new_priority, uint64 upload_order, bool prefer_small, ActorShared<> parent) @@ -2351,7 +2351,7 @@ class FileManager::ForceUploadActor : public Actor { bool is_active_{false}; int attempt_{0}; - class UploadCallback : public FileManager::UploadCallback { + class UploadCallback final : public FileManager::UploadCallback { public: explicit UploadCallback(ActorId callback) : callback_(std::move(callback)) { } @@ -2678,7 +2678,7 @@ void FileManager::run_generate(FileNodePtr node) { node->generate_id_ = id; send_closure(file_generate_manager_, &FileGenerateManager::generate_file, id, *node->generate_, node->local_, node->suggested_path(), [file_manager = this, id] { - class Callback : public FileGenerateCallback { + class Callback final : public FileGenerateCallback { ActorId actor_; uint64 query_id_; diff --git a/td/telegram/files/FileManager.h b/td/telegram/files/FileManager.h index 857c56442..5d16b5ad3 100644 --- a/td/telegram/files/FileManager.h +++ b/td/telegram/files/FileManager.h @@ -341,7 +341,7 @@ class FileView { static string get_persistent_id(const FullRemoteFileLocation &location); }; -class FileManager : public FileLoadManager::Callback { +class FileManager final : public FileLoadManager::Callback { public: class DownloadCallback { public: diff --git a/td/telegram/files/FileStatsWorker.h b/td/telegram/files/FileStatsWorker.h index ff5516f4c..c3f545c02 100644 --- a/td/telegram/files/FileStatsWorker.h +++ b/td/telegram/files/FileStatsWorker.h @@ -15,7 +15,7 @@ namespace td { -class FileStatsWorker : public Actor { +class FileStatsWorker final : public Actor { public: FileStatsWorker(ActorShared<> parent, CancellationToken token) : parent_(std::move(parent)), token_(std::move(token)) { diff --git a/td/telegram/files/FileUploader.h b/td/telegram/files/FileUploader.h index 1eea72476..81a89e24d 100644 --- a/td/telegram/files/FileUploader.h +++ b/td/telegram/files/FileUploader.h @@ -19,7 +19,7 @@ namespace td { -class FileUploader : public FileLoader { +class FileUploader final : public FileLoader { public: class Callback : public FileLoader::Callback { public: diff --git a/td/telegram/files/ResourceManager.h b/td/telegram/files/ResourceManager.h index 3a2b4a9bc..1fe1753ec 100644 --- a/td/telegram/files/ResourceManager.h +++ b/td/telegram/files/ResourceManager.h @@ -18,7 +18,7 @@ namespace td { -class ResourceManager : public Actor { +class ResourceManager final : public Actor { public: enum class Mode : int32 { Baseline, Greedy }; explicit ResourceManager(Mode mode) : mode_(mode) { @@ -34,7 +34,7 @@ class ResourceManager : public Actor { private: Mode mode_; using NodeId = uint64; - struct Node : public HeapNode { + struct Node final : public HeapNode { NodeId node_id; ResourceState resource_state_; diff --git a/td/telegram/logevent/LogEvent.h b/td/telegram/logevent/LogEvent.h index 1c17dec3e..e8f5195c2 100644 --- a/td/telegram/logevent/LogEvent.h +++ b/td/telegram/logevent/LogEvent.h @@ -169,7 +169,7 @@ Result> from_buffer_slice(BufferSlice slice) { } template -class StorerImpl : public Storer { +class StorerImpl final : public Storer { public: explicit StorerImpl(const T &event) : event_(event) { } @@ -211,7 +211,7 @@ class LogEventBase : public LogEvent { } }; -class LogEventParser : public WithVersion> { +class LogEventParser final : public WithVersion> { public: explicit LogEventParser(Slice data) : WithVersion>(data) { set_version(fetch_int()); @@ -220,7 +220,7 @@ class LogEventParser : public WithVersion> { } }; -class LogEventStorerCalcLength : public WithContext { +class LogEventStorerCalcLength final : public WithContext { public: LogEventStorerCalcLength() : WithContext() { store_int(static_cast(Version::Next) - 1); @@ -228,7 +228,7 @@ class LogEventStorerCalcLength : public WithContext { +class LogEventStorerUnsafe final : public WithContext { public: explicit LogEventStorerUnsafe(unsigned char *buf) : WithContext(buf) { store_int(static_cast(Version::Next) - 1); @@ -237,7 +237,7 @@ class LogEventStorerUnsafe : public WithContext { }; template -class LogEventStorerImpl : public Storer { +class LogEventStorerImpl final : public Storer { public: explicit LogEventStorerImpl(const T &event) : event_(event) { } diff --git a/td/telegram/logevent/SecretChatEvent.h b/td/telegram/logevent/SecretChatEvent.h index 3b6872b8d..128070151 100644 --- a/td/telegram/logevent/SecretChatEvent.h +++ b/td/telegram/logevent/SecretChatEvent.h @@ -200,7 +200,7 @@ inline StringBuilder &operator<<(StringBuilder &sb, const EncryptedFileLocation // LogEvents // TODO: Qts and SeqNoState could be just Logevents that are updated during regenerate -class InboundSecretMessage : public SecretChatLogEventBase { +class InboundSecretMessage final : public SecretChatLogEventBase { public: static constexpr Type type = SecretChatEvent::Type::InboundSecretMessage; @@ -301,7 +301,7 @@ class InboundSecretMessage : public SecretChatLogEventBase } }; -class OutboundSecretMessage : public SecretChatLogEventBase { +class OutboundSecretMessage final : public SecretChatLogEventBase { public: static constexpr Type type = SecretChatEvent::Type::OutboundSecretMessage; @@ -407,7 +407,7 @@ class OutboundSecretMessage : public SecretChatLogEventBase { +class CloseSecretChat final : public SecretChatLogEventBase { public: static constexpr Type type = SecretChatEvent::Type::CloseSecretChat; int32 chat_id = 0; @@ -442,7 +442,7 @@ class CloseSecretChat : public SecretChatLogEventBase { } }; -class CreateSecretChat : public SecretChatLogEventBase { +class CreateSecretChat final : public SecretChatLogEventBase { public: static constexpr Type type = SecretChatEvent::Type::CreateSecretChat; int32 random_id = 0; diff --git a/td/telegram/net/AuthDataShared.cpp b/td/telegram/net/AuthDataShared.cpp index a17fee056..2dc28eaca 100644 --- a/td/telegram/net/AuthDataShared.cpp +++ b/td/telegram/net/AuthDataShared.cpp @@ -18,7 +18,7 @@ namespace td { -class AuthDataSharedImpl : public AuthDataShared { +class AuthDataSharedImpl final : public AuthDataShared { public: AuthDataSharedImpl(DcId dc_id, std::shared_ptr public_rsa_key, std::shared_ptr guard) : dc_id_(dc_id), public_rsa_key_(std::move(public_rsa_key)), guard_(std::move(guard)) { diff --git a/td/telegram/net/ConnectionCreator.cpp b/td/telegram/net/ConnectionCreator.cpp index 8c466800c..00a0636a6 100644 --- a/td/telegram/net/ConnectionCreator.cpp +++ b/td/telegram/net/ConnectionCreator.cpp @@ -747,7 +747,7 @@ ActorOwn<> ConnectionCreator::prepare_connection(IPAddress ip_address, SocketFd Promise promise) { if (proxy.use_socks5_proxy() || proxy.use_http_tcp_proxy() || transport_type.secret.emulate_tls()) { VLOG(connections) << "Create new transparent proxy connection " << debug_str; - class Callback : public TransparentProxy::Callback { + class Callback final : public TransparentProxy::Callback { public: explicit Callback(Promise promise, IPAddress ip_address, unique_ptr stats_callback, bool use_connection_token, @@ -1086,7 +1086,7 @@ void ConnectionCreator::update_mtproto_header(const Proxy &proxy) { } void ConnectionCreator::start_up() { - class StateCallback : public StateManager::Callback { + class StateCallback final : public StateManager::Callback { public: explicit StateCallback(ActorId connection_creator) : connection_creator_(std::move(connection_creator)) { diff --git a/td/telegram/net/ConnectionCreator.h b/td/telegram/net/ConnectionCreator.h index a831f5f99..21537c76b 100644 --- a/td/telegram/net/ConnectionCreator.h +++ b/td/telegram/net/ConnectionCreator.h @@ -54,7 +54,7 @@ namespace td { extern int VERBOSITY_NAME(connections); -class ConnectionCreator : public NetQueryCallback { +class ConnectionCreator final : public NetQueryCallback { public: explicit ConnectionCreator(ActorShared<> parent); ConnectionCreator(ConnectionCreator &&other); diff --git a/td/telegram/net/DcAuthManager.cpp b/td/telegram/net/DcAuthManager.cpp index 9866ab3e6..39f830f16 100644 --- a/td/telegram/net/DcAuthManager.cpp +++ b/td/telegram/net/DcAuthManager.cpp @@ -43,7 +43,7 @@ DcAuthManager::DcAuthManager(ActorShared<> parent) { void DcAuthManager::add_dc(std::shared_ptr auth_data) { VLOG(dc) << "Register " << auth_data->dc_id(); - class Listener : public AuthDataShared::Listener { + class Listener final : public AuthDataShared::Listener { public: explicit Listener(ActorShared dc_manager) : dc_manager_(std::move(dc_manager)) { } diff --git a/td/telegram/net/DcAuthManager.h b/td/telegram/net/DcAuthManager.h index 310e0eca7..612bf61a9 100644 --- a/td/telegram/net/DcAuthManager.h +++ b/td/telegram/net/DcAuthManager.h @@ -23,7 +23,7 @@ namespace td { extern int VERBOSITY_NAME(dc); -class DcAuthManager : public NetQueryCallback { +class DcAuthManager final : public NetQueryCallback { public: explicit DcAuthManager(ActorShared<> parent); diff --git a/td/telegram/net/NetQuery.h b/td/telegram/net/NetQuery.h index 7a5897f6d..8684e661d 100644 --- a/td/telegram/net/NetQuery.h +++ b/td/telegram/net/NetQuery.h @@ -43,7 +43,7 @@ class NetQueryCallback : public Actor { virtual void on_result_resendable(NetQueryPtr query, Promise promise); }; -class NetQuery : public TsListNode { +class NetQuery final : public TsListNode { public: NetQuery() = default; @@ -296,7 +296,7 @@ class NetQuery : public TsListNode { int8 priority_{0}; template - struct movable_atomic : public std::atomic { + struct movable_atomic final : public std::atomic { movable_atomic() = default; movable_atomic(T &&x) : std::atomic(std::forward(x)) { } diff --git a/td/telegram/net/NetQueryDelayer.h b/td/telegram/net/NetQueryDelayer.h index 2e5e056af..c6f5bf68a 100644 --- a/td/telegram/net/NetQueryDelayer.h +++ b/td/telegram/net/NetQueryDelayer.h @@ -15,7 +15,7 @@ namespace td { -class NetQueryDelayer : public Actor { +class NetQueryDelayer final : public Actor { public: explicit NetQueryDelayer(ActorShared<> parent) : parent_(std::move(parent)) { } diff --git a/td/telegram/net/NetStatsManager.cpp b/td/telegram/net/NetStatsManager.cpp index d032deac3..ce64866c8 100644 --- a/td/telegram/net/NetStatsManager.cpp +++ b/td/telegram/net/NetStatsManager.cpp @@ -48,7 +48,7 @@ static void parse(NetStatsData &net_stats, ParserT &parser) { void NetStatsManager::init() { LOG_CHECK(!empty()) << G()->close_flag(); - class NetStatsInternalCallback : public NetStats::Callback { + class NetStatsInternalCallback final : public NetStats::Callback { public: NetStatsInternalCallback(ActorId parent, size_t id) : parent_(std::move(parent)), id_(id) { } @@ -232,7 +232,7 @@ void NetStatsManager::start_up() { G()->td_db()->get_binlog_pmc()->set("net_stats_since", to_string(since_total_)); } - class NetCallback : public StateManager::Callback { + class NetCallback final : public StateManager::Callback { public: explicit NetCallback(ActorId net_stats_manager) : net_stats_manager_(std::move(net_stats_manager)) { diff --git a/td/telegram/net/NetStatsManager.h b/td/telegram/net/NetStatsManager.h index b1e3891be..98299abbd 100644 --- a/td/telegram/net/NetStatsManager.h +++ b/td/telegram/net/NetStatsManager.h @@ -61,7 +61,7 @@ struct NetworkStats { } }; -class NetStatsManager : public Actor { +class NetStatsManager final : public Actor { public: explicit NetStatsManager(ActorShared<> parent) : parent_(std::move(parent)) { } diff --git a/td/telegram/net/PublicRsaKeyShared.h b/td/telegram/net/PublicRsaKeyShared.h index 406272aa5..fc16f23a7 100644 --- a/td/telegram/net/PublicRsaKeyShared.h +++ b/td/telegram/net/PublicRsaKeyShared.h @@ -18,7 +18,7 @@ namespace td { -class PublicRsaKeyShared : public PublicRsaKeyInterface { +class PublicRsaKeyShared final : public PublicRsaKeyInterface { public: PublicRsaKeyShared(DcId dc_id, bool is_test); diff --git a/td/telegram/net/PublicRsaKeyWatchdog.cpp b/td/telegram/net/PublicRsaKeyWatchdog.cpp index 5954be555..cd2d054f5 100644 --- a/td/telegram/net/PublicRsaKeyWatchdog.cpp +++ b/td/telegram/net/PublicRsaKeyWatchdog.cpp @@ -23,7 +23,7 @@ PublicRsaKeyWatchdog::PublicRsaKeyWatchdog(ActorShared<> parent) : parent_(std:: } void PublicRsaKeyWatchdog::add_public_rsa_key(std::shared_ptr key) { - class Listener : public PublicRsaKeyShared::Listener { + class Listener final : public PublicRsaKeyShared::Listener { public: explicit Listener(ActorId parent) : parent_(std::move(parent)) { } diff --git a/td/telegram/net/PublicRsaKeyWatchdog.h b/td/telegram/net/PublicRsaKeyWatchdog.h index 202dd366a..632df9d2b 100644 --- a/td/telegram/net/PublicRsaKeyWatchdog.h +++ b/td/telegram/net/PublicRsaKeyWatchdog.h @@ -24,7 +24,7 @@ namespace td { -class PublicRsaKeyWatchdog : public NetActor { +class PublicRsaKeyWatchdog final : public NetActor { public: explicit PublicRsaKeyWatchdog(ActorShared<> parent); diff --git a/td/telegram/net/Session.cpp b/td/telegram/net/Session.cpp index aac29d2ea..b0e628ba7 100644 --- a/td/telegram/net/Session.cpp +++ b/td/telegram/net/Session.cpp @@ -47,7 +47,7 @@ namespace td { namespace detail { -class GenAuthKeyActor : public Actor { +class GenAuthKeyActor final : public Actor { public: GenAuthKeyActor(Slice name, unique_ptr handshake, unique_ptr context, @@ -190,7 +190,7 @@ bool Session::can_destroy_auth_key() const { } void Session::start_up() { - class StateCallback : public StateManager::Callback { + class StateCallback final : public StateManager::Callback { public: explicit StateCallback(ActorId session) : session_(std::move(session)) { } @@ -1254,7 +1254,7 @@ void Session::create_gen_auth_key_actor(HandshakeId handshake_id) { if (!info.handshake_) { info.handshake_ = make_unique(dc_id_, is_main && !is_cdn_ ? 0 : 24 * 60 * 60); } - class AuthKeyHandshakeContext : public mtproto::AuthKeyHandshakeContext { + class AuthKeyHandshakeContext final : public mtproto::AuthKeyHandshakeContext { public: AuthKeyHandshakeContext(DhCallback *dh_callback, std::shared_ptr public_rsa_key) : dh_callback_(dh_callback), public_rsa_key_(std::move(public_rsa_key)) { diff --git a/td/telegram/net/Session.h b/td/telegram/net/Session.h index f072fe0f5..32776fd6d 100644 --- a/td/telegram/net/Session.h +++ b/td/telegram/net/Session.h @@ -76,7 +76,7 @@ class Session final void close(); private: - struct Query : private ListNode { + struct Query final : private ListNode { uint64 container_id; NetQueryPtr query; diff --git a/td/telegram/net/SessionMultiProxy.cpp b/td/telegram/net/SessionMultiProxy.cpp index b6141a923..5308aef7d 100644 --- a/td/telegram/net/SessionMultiProxy.cpp +++ b/td/telegram/net/SessionMultiProxy.cpp @@ -126,7 +126,7 @@ void SessionMultiProxy::init() { << format::cond(session_count_ > 1, format::concat("#", i)); SessionInfo info; - class Callback : public SessionProxy::Callback { + class Callback final : public SessionProxy::Callback { public: Callback(ActorId parent, uint32 generation, int32 session_id) : parent_(parent), generation_(generation), session_id_(session_id) { diff --git a/td/telegram/net/SessionMultiProxy.h b/td/telegram/net/SessionMultiProxy.h index bd63220f0..8208c3d24 100644 --- a/td/telegram/net/SessionMultiProxy.h +++ b/td/telegram/net/SessionMultiProxy.h @@ -17,7 +17,7 @@ namespace td { class SessionProxy; -class SessionMultiProxy : public Actor { +class SessionMultiProxy final : public Actor { public: SessionMultiProxy(); SessionMultiProxy(const SessionMultiProxy &other) = delete; diff --git a/td/telegram/net/SessionProxy.cpp b/td/telegram/net/SessionProxy.cpp index 7c1a0e1bb..b8c04f50f 100644 --- a/td/telegram/net/SessionProxy.cpp +++ b/td/telegram/net/SessionProxy.cpp @@ -28,7 +28,7 @@ namespace mtproto { class RawConnection; } // namespace mtproto -class SessionCallback : public Session::Callback { +class SessionCallback final : public Session::Callback { public: SessionCallback(ActorShared parent, DcId dc_id, bool allow_media_only, bool is_media, size_t hash) : parent_(std::move(parent)) @@ -88,7 +88,7 @@ SessionProxy::SessionProxy(unique_ptr callback, std::shared_ptr session_proxy) : session_proxy_(std::move(session_proxy)) { } diff --git a/td/telegram/net/SessionProxy.h b/td/telegram/net/SessionProxy.h index f2db0ba7a..fef984f9d 100644 --- a/td/telegram/net/SessionProxy.h +++ b/td/telegram/net/SessionProxy.h @@ -20,7 +20,7 @@ namespace td { class Session; -class SessionProxy : public Actor { +class SessionProxy final : public Actor { public: friend class SessionCallback; class Callback { diff --git a/td/telegram/net/TempAuthKeyWatchdog.h b/td/telegram/net/TempAuthKeyWatchdog.h index b9384cb5b..388ae97d3 100644 --- a/td/telegram/net/TempAuthKeyWatchdog.h +++ b/td/telegram/net/TempAuthKeyWatchdog.h @@ -23,7 +23,7 @@ namespace td { -class TempAuthKeyWatchdog : public NetQueryCallback { +class TempAuthKeyWatchdog final : public NetQueryCallback { class RegisteredAuthKeyImpl { public: explicit RegisteredAuthKeyImpl(int64 auth_key_id) diff --git a/td/tl/tl_json.h b/td/tl/tl_json.h index 4aa7daefc..2c77c8a9b 100644 --- a/td/tl/tl_json.h +++ b/td/tl/tl_json.h @@ -150,7 +150,7 @@ Status from_json(std::vector &to, JsonValue from) { } template -class DowncastHelper : public T { +class DowncastHelper final : public T { public: explicit DowncastHelper(int32 constructor) : constructor_(constructor) { } diff --git a/tdactor/example/example.cpp b/tdactor/example/example.cpp index a58ad96ab..119d18d94 100644 --- a/tdactor/example/example.cpp +++ b/tdactor/example/example.cpp @@ -10,14 +10,14 @@ #include "td/utils/logging.h" #include "td/utils/Time.h" -class Worker : public td::Actor { +class Worker final : public td::Actor { public: void ping(int x) { LOG(ERROR) << "Got ping " << x; } }; -class MainActor : public td::Actor { +class MainActor final : public td::Actor { public: void start_up() final { LOG(ERROR) << "Start up"; diff --git a/tdactor/td/actor/ConcurrentScheduler.h b/tdactor/td/actor/ConcurrentScheduler.h index a6ce6a916..e940e632c 100644 --- a/tdactor/td/actor/ConcurrentScheduler.h +++ b/tdactor/td/actor/ConcurrentScheduler.h @@ -24,7 +24,7 @@ namespace td { -class ConcurrentScheduler : private Scheduler::Callback { +class ConcurrentScheduler final : private Scheduler::Callback { public: void init(int32 threads_n); diff --git a/tdactor/td/actor/MultiPromise.h b/tdactor/td/actor/MultiPromise.h index 8c69996ec..630a689ad 100644 --- a/tdactor/td/actor/MultiPromise.h +++ b/tdactor/td/actor/MultiPromise.h @@ -30,7 +30,7 @@ class MultiPromiseInterface { virtual ~MultiPromiseInterface() = default; }; -class MultiPromise : public MultiPromiseInterface { +class MultiPromise final : public MultiPromiseInterface { public: void add_promise(Promise<> &&promise) final { impl_->add_promise(std::move(promise)); @@ -91,7 +91,7 @@ class MultiPromiseActor final } }; -class MultiPromiseActorSafe : public MultiPromiseInterface { +class MultiPromiseActorSafe final : public MultiPromiseInterface { public: void add_promise(Promise &&promise) final; Promise get_promise() final; diff --git a/tdactor/td/actor/PromiseFuture.h b/tdactor/td/actor/PromiseFuture.h index cdd968130..92b3df822 100644 --- a/tdactor/td/actor/PromiseFuture.h +++ b/tdactor/td/actor/PromiseFuture.h @@ -69,7 +69,7 @@ class PromiseInterface { namespace detail { template -struct GetArg : public GetArg {}; +struct GetArg final : public GetArg {}; template class GetArg { @@ -368,7 +368,7 @@ Promise &Promise::operator=(SafePromise &&other) { namespace detail { -class EventPromise : public PromiseInterface { +class EventPromise final : public PromiseInterface { public: void set_value(Unit &&) final { ok_.try_emit(); @@ -407,7 +407,7 @@ class EventPromise : public PromiseInterface { }; template -class CancellablePromise : public PromiseT { +class CancellablePromise final : public PromiseT { public: template CancellablePromise(CancellationToken cancellation_token, ArgsT &&... args) @@ -425,7 +425,7 @@ class CancellablePromise : public PromiseT { }; template -class JoinPromise : public PromiseInterface { +class JoinPromise final : public PromiseInterface { public: explicit JoinPromise(ArgsT &&... arg) : promises_(std::forward(arg)...) { } diff --git a/tdactor/td/actor/SleepActor.h b/tdactor/td/actor/SleepActor.h index 9eab389e7..659db5f1a 100644 --- a/tdactor/td/actor/SleepActor.h +++ b/tdactor/td/actor/SleepActor.h @@ -13,7 +13,7 @@ namespace td { -class SleepActor : public Actor { +class SleepActor final : public Actor { public: SleepActor(double timeout, Promise<> promise) : timeout_(timeout), promise_(std::move(promise)) { } diff --git a/tdactor/td/actor/Timeout.h b/tdactor/td/actor/Timeout.h index f1407edf2..de4216546 100644 --- a/tdactor/td/actor/Timeout.h +++ b/tdactor/td/actor/Timeout.h @@ -69,7 +69,7 @@ class Timeout final : public Actor { // TODO optimize class MultiTimeout final : public Actor { - struct Item : public HeapNode { + struct Item final : public HeapNode { int64 key; explicit Item(int64 key) : key(key) { diff --git a/tdactor/td/actor/impl/Event.h b/tdactor/td/actor/impl/Event.h index 293d9933d..30d55d6f7 100644 --- a/tdactor/td/actor/impl/Event.h +++ b/tdactor/td/actor/impl/Event.h @@ -57,7 +57,7 @@ class CustomEvent { }; template -class ClosureEvent : public CustomEvent { +class ClosureEvent final : public CustomEvent { public: void run(Actor *actor) final { closure_.run(static_cast(actor)); @@ -88,7 +88,7 @@ class ClosureEvent : public CustomEvent { }; template -class LambdaEvent : public CustomEvent { +class LambdaEvent final : public CustomEvent { public: void run(Actor *actor) final { f_(); diff --git a/tdactor/test/actors_bugs.cpp b/tdactor/test/actors_bugs.cpp index dca054a60..683f1f74f 100644 --- a/tdactor/test/actors_bugs.cpp +++ b/tdactor/test/actors_bugs.cpp @@ -51,7 +51,7 @@ TEST(MultiTimeout, bug) { sched.finish(); } -class TimeoutManager : public Actor { +class TimeoutManager final : public Actor { public: static int32 count; diff --git a/tdactor/test/actors_main.cpp b/tdactor/test/actors_main.cpp index edf2ee0df..aed69d216 100644 --- a/tdactor/test/actors_main.cpp +++ b/tdactor/test/actors_main.cpp @@ -182,7 +182,7 @@ class QueryActor final : public Actor { }; class MainQueryActor final : public Actor { - class QueryActorCallback : public QueryActor::Callback { + class QueryActorCallback final : public QueryActor::Callback { public: void on_result(Query &&query) final { if (query.ready()) { @@ -342,9 +342,9 @@ class SimpleActor final : public Actor { }; } // namespace -class SendToDead : public Actor { +class SendToDead final : public Actor { public: - class Parent : public Actor { + class Parent final : public Actor { public: explicit Parent(ActorShared<> parent, int ttl = 3) : parent_(std::move(parent)), ttl_(ttl) { } @@ -439,7 +439,7 @@ TEST(Actors, main) { sched.finish(); } -class DoAfterStop : public Actor { +class DoAfterStop final : public Actor { public: void loop() final { ptr = make_unique(10); @@ -467,7 +467,7 @@ TEST(Actors, do_after_stop) { sched.finish(); } -class XContext : public ActorContext { +class XContext final : public ActorContext { public: int32 get_id() const final { return 123456789; @@ -482,7 +482,7 @@ class XContext : public ActorContext { int x = 1234; }; -class WithXContext : public Actor { +class WithXContext final : public Actor { public: void start_up() final { auto old_context = set_context(std::make_shared()); diff --git a/tdactor/test/actors_simple.cpp b/tdactor/test/actors_simple.cpp index 247b87beb..f360bde30 100644 --- a/tdactor/test/actors_simple.cpp +++ b/tdactor/test/actors_simple.cpp @@ -50,7 +50,7 @@ TEST(Actors, SendLater) { scheduler.init(0, {create_queue()}, nullptr); auto guard = scheduler.get_guard(); - class Worker : public Actor { + class Worker final : public Actor { public: void f() { sb << "A"; @@ -327,7 +327,7 @@ class MsgActor : public Actor { virtual void msg() = 0; }; -class Slave : public Actor { +class Slave final : public Actor { public: ActorId msg; explicit Slave(ActorId msg) : msg(msg) { @@ -337,7 +337,7 @@ class Slave : public Actor { } }; -class MasterActor : public MsgActor { +class MasterActor final : public MsgActor { public: void loop() final { alive_ = true; @@ -372,7 +372,7 @@ TEST(Actors, call_after_destruct) { scheduler.run(Timestamp::now()); } -class LinkTokenSlave : public Actor { +class LinkTokenSlave final : public Actor { public: explicit LinkTokenSlave(ActorShared<> parent) : parent_(std::move(parent)) { } @@ -387,7 +387,7 @@ class LinkTokenSlave : public Actor { ActorShared<> parent_; }; -class LinkTokenMasterActor : public Actor { +class LinkTokenMasterActor final : public Actor { public: explicit LinkTokenMasterActor(int cnt) : cnt_(cnt) { } @@ -458,7 +458,7 @@ TEST(Actors, promise) { ASSERT_EQ(1, value); } -class LaterSlave : public Actor { +class LaterSlave final : public Actor { public: explicit LaterSlave(ActorShared<> parent) : parent_(std::move(parent)) { } @@ -476,7 +476,7 @@ class LaterSlave : public Actor { } }; -class LaterMasterActor : public Actor { +class LaterMasterActor final : public Actor { int cnt_ = 3; std::vector> children_; void start_up() final { @@ -509,7 +509,7 @@ TEST(Actors, later) { ASSERT_STREQ(sb.as_cslice().c_str(), "AAABBB"); } -class MultiPromise2 : public Actor { +class MultiPromise2 final : public Actor { public: void start_up() final { auto promise = PromiseCreator::lambda([](Result result) { @@ -525,7 +525,7 @@ class MultiPromise2 : public Actor { } }; -class MultiPromise1 : public Actor { +class MultiPromise1 final : public Actor { public: void start_up() final { auto promise = PromiseCreator::lambda([](Result result) { @@ -549,7 +549,7 @@ TEST(Actors, MultiPromise) { scheduler.finish(); } -class FastPromise : public Actor { +class FastPromise final : public Actor { public: void start_up() final { PromiseFuture pf; @@ -573,7 +573,7 @@ TEST(Actors, FastPromise) { scheduler.finish(); } -class StopInTeardown : public Actor { +class StopInTeardown final : public Actor { void loop() final { stop(); } @@ -595,7 +595,7 @@ TEST(Actors, stop_in_teardown) { scheduler.finish(); } -class AlwaysWaitForMailbox : public Actor { +class AlwaysWaitForMailbox final : public Actor { public: void start_up() final { always_wait_for_mailbox(); @@ -637,7 +637,7 @@ TEST(Actors, send_from_other_threads) { ConcurrentScheduler scheduler; scheduler.init(1); int thread_n = 10; - class Listener : public Actor { + class Listener final : public Actor { public: explicit Listener(int cnt) : cnt_(cnt) { } diff --git a/tdactor/test/actors_workers.cpp b/tdactor/test/actors_workers.cpp index 43a44aad5..30492834c 100644 --- a/tdactor/test/actors_workers.cpp +++ b/tdactor/test/actors_workers.cpp @@ -56,7 +56,7 @@ class Manager final : public Actor { , query_size_(query_size) { } - class Callback : public PowerWorker::Callback { + class Callback final : public PowerWorker::Callback { public: Callback(ActorId actor_id, int worker_id) : actor_id_(actor_id), worker_id_(worker_id) { } diff --git a/tddb/td/db/BinlogKeyValue.h b/tddb/td/db/BinlogKeyValue.h index b74aadef6..010f6d808 100644 --- a/tddb/td/db/BinlogKeyValue.h +++ b/tddb/td/db/BinlogKeyValue.h @@ -31,11 +31,11 @@ namespace td { template -class BinlogKeyValue : public KeyValueSyncInterface { +class BinlogKeyValue final : public KeyValueSyncInterface { public: static constexpr int32 MAGIC = 0x2a280000; - struct Event : public Storer { + struct Event final : public Storer { Event() = default; Event(Slice key, Slice value) : key(key), value(value) { } diff --git a/tddb/td/db/SqliteKeyValueAsync.cpp b/tddb/td/db/SqliteKeyValueAsync.cpp index 08a3056ce..5f594e488 100644 --- a/tddb/td/db/SqliteKeyValueAsync.cpp +++ b/tddb/td/db/SqliteKeyValueAsync.cpp @@ -18,7 +18,7 @@ namespace td { -class SqliteKeyValueAsync : public SqliteKeyValueAsyncInterface { +class SqliteKeyValueAsync final : public SqliteKeyValueAsyncInterface { public: explicit SqliteKeyValueAsync(std::shared_ptr kv_safe, int32 scheduler_id = -1) { impl_ = create_actor_on_scheduler("KV", scheduler_id, std::move(kv_safe)); @@ -40,7 +40,7 @@ class SqliteKeyValueAsync : public SqliteKeyValueAsyncInterface { } private: - class Impl : public Actor { + class Impl final : public Actor { public: explicit Impl(std::shared_ptr kv_safe) : kv_safe_(std::move(kv_safe)) { } diff --git a/tddb/td/db/TQueue.cpp b/tddb/td/db/TQueue.cpp index 0534c29af..70095eb93 100644 --- a/tddb/td/db/TQueue.cpp +++ b/tddb/td/db/TQueue.cpp @@ -80,7 +80,7 @@ bool EventId::is_valid_id(int32 id) { return 0 <= id && id < MAX_ID; } -class TQueueImpl : public TQueue { +class TQueueImpl final : public TQueue { static constexpr size_t MAX_EVENT_LENGTH = 65536 * 8; static constexpr size_t MAX_QUEUE_EVENTS = 1000000; static constexpr size_t MAX_TOTAL_EVENT_LENGTH = 1 << 30; @@ -383,7 +383,7 @@ unique_ptr TQueue::create() { return make_unique(); } -struct TQueueLogEvent : public Storer { +struct TQueueLogEvent final : public Storer { int64 queue_id; int32 event_id; int32 expires_at; diff --git a/tddb/td/db/TQueue.h b/tddb/td/db/TQueue.h index 76284af63..6301e20ba 100644 --- a/tddb/td/db/TQueue.h +++ b/tddb/td/db/TQueue.h @@ -122,7 +122,7 @@ StringBuilder &operator<<(StringBuilder &string_builder, const TQueue::EventId i struct BinlogEvent; template -class TQueueBinlog : public TQueue::StorageCallback { +class TQueueBinlog final : public TQueue::StorageCallback { public: uint64 push(QueueId queue_id, const RawEvent &event) final; void pop(uint64 log_event_id) final; @@ -138,7 +138,7 @@ class TQueueBinlog : public TQueue::StorageCallback { static constexpr int32 BINLOG_EVENT_TYPE = 2314; }; -class TQueueMemoryStorage : public TQueue::StorageCallback { +class TQueueMemoryStorage final : public TQueue::StorageCallback { public: uint64 push(QueueId queue_id, const RawEvent &event) final; void pop(uint64 log_event_id) final; diff --git a/tddb/td/db/binlog/ConcurrentBinlog.cpp b/tddb/td/db/binlog/ConcurrentBinlog.cpp index 7c3513172..ff0385603 100644 --- a/tddb/td/db/binlog/ConcurrentBinlog.cpp +++ b/tddb/td/db/binlog/ConcurrentBinlog.cpp @@ -15,7 +15,7 @@ namespace td { namespace detail { -class BinlogActor : public Actor { +class BinlogActor final : public Actor { public: BinlogActor(unique_ptr binlog, uint64 seq_no) : binlog_(std::move(binlog)), processor_(seq_no) { } diff --git a/tddb/td/db/binlog/ConcurrentBinlog.h b/tddb/td/db/binlog/ConcurrentBinlog.h index 961a83b98..876572e05 100644 --- a/tddb/td/db/binlog/ConcurrentBinlog.h +++ b/tddb/td/db/binlog/ConcurrentBinlog.h @@ -27,7 +27,7 @@ namespace detail { class BinlogActor; } // namespace detail -class ConcurrentBinlog : public BinlogInterface { +class ConcurrentBinlog final : public BinlogInterface { public: using Callback = std::function; Result init(string path, const Callback &callback, DbKey db_key = DbKey::empty(), diff --git a/tdnet/td/net/GetHostByNameActor.cpp b/tdnet/td/net/GetHostByNameActor.cpp index c1f944c31..227780287 100644 --- a/tdnet/td/net/GetHostByNameActor.cpp +++ b/tdnet/td/net/GetHostByNameActor.cpp @@ -21,7 +21,7 @@ namespace td { namespace detail { -class GoogleDnsResolver : public Actor { +class GoogleDnsResolver final : public Actor { public: GoogleDnsResolver(std::string host, bool prefer_ipv6, Promise promise) : host_(std::move(host)), prefer_ipv6_(prefer_ipv6), promise_(std::move(promise)) { @@ -86,7 +86,7 @@ class GoogleDnsResolver : public Actor { } }; -class NativeDnsResolver : public Actor { +class NativeDnsResolver final : public Actor { public: NativeDnsResolver(std::string host, bool prefer_ipv6, Promise promise) : host_(std::move(host)), prefer_ipv6_(prefer_ipv6), promise_(std::move(promise)) { diff --git a/tdnet/td/net/HttpProxy.h b/tdnet/td/net/HttpProxy.h index 613dfc513..3604af43b 100644 --- a/tdnet/td/net/HttpProxy.h +++ b/tdnet/td/net/HttpProxy.h @@ -12,7 +12,7 @@ namespace td { -class HttpProxy : public TransparentProxy { +class HttpProxy final : public TransparentProxy { public: using TransparentProxy::TransparentProxy; diff --git a/tdnet/td/net/NetStats.h b/tdnet/td/net/NetStats.h index d3cc0ba4b..71478b025 100644 --- a/tdnet/td/net/NetStats.h +++ b/tdnet/td/net/NetStats.h @@ -91,7 +91,7 @@ class NetStats { } private: - class Impl : public NetStatsCallback { + class Impl final : public NetStatsCallback { public: NetStatsData get_stats() const { NetStatsData res; diff --git a/tdnet/td/net/Socks5.h b/tdnet/td/net/Socks5.h index 97531011f..3ad30eed2 100644 --- a/tdnet/td/net/Socks5.h +++ b/tdnet/td/net/Socks5.h @@ -12,7 +12,7 @@ namespace td { -class Socks5 : public TransparentProxy { +class Socks5 final : public TransparentProxy { public: using TransparentProxy::TransparentProxy; diff --git a/tdnet/td/net/SslStream.cpp b/tdnet/td/net/SslStream.cpp index 8d43c43a0..b9061b94d 100644 --- a/tdnet/td/net/SslStream.cpp +++ b/tdnet/td/net/SslStream.cpp @@ -384,7 +384,7 @@ class SslStreamImpl { return size; } - class SslReadByteFlow : public ByteFlowBase { + class SslReadByteFlow final : public ByteFlowBase { public: explicit SslReadByteFlow(SslStreamImpl *stream) : stream_(stream) { } @@ -411,7 +411,7 @@ class SslStreamImpl { SslStreamImpl *stream_; }; - class SslWriteByteFlow : public ByteFlowBase { + class SslWriteByteFlow final : public ByteFlowBase { public: explicit SslWriteByteFlow(SslStreamImpl *stream) : stream_(stream) { } diff --git a/tdnet/td/net/Wget.h b/tdnet/td/net/Wget.h index 4f22a085e..723efda12 100644 --- a/tdnet/td/net/Wget.h +++ b/tdnet/td/net/Wget.h @@ -20,7 +20,7 @@ namespace td { -class Wget : public HttpOutboundConnection::Callback { +class Wget final : public HttpOutboundConnection::Callback { public: explicit Wget(Promise> promise, string url, std::vector> headers = {}, int32 timeout_in = 10, int32 ttl = 3, bool prefer_ipv6 = false, diff --git a/tdutils/td/utils/AesCtrByteFlow.h b/tdutils/td/utils/AesCtrByteFlow.h index f8143e10f..130a4284b 100644 --- a/tdutils/td/utils/AesCtrByteFlow.h +++ b/tdutils/td/utils/AesCtrByteFlow.h @@ -16,7 +16,7 @@ namespace td { #if TD_HAVE_OPENSSL -class AesCtrByteFlow : public ByteFlowInplaceBase { +class AesCtrByteFlow final : public ByteFlowInplaceBase { public: void init(const UInt256 &key, const UInt128 &iv) { state_.init(as_slice(key), as_slice(iv)); diff --git a/tdutils/td/utils/BufferedFd.h b/tdutils/td/utils/BufferedFd.h index cd092ea55..12fdbe1d1 100644 --- a/tdutils/td/utils/BufferedFd.h +++ b/tdutils/td/utils/BufferedFd.h @@ -54,7 +54,7 @@ class BufferedFdBase : public FdT { }; template -class BufferedFd : public BufferedFdBase { +class BufferedFd final : public BufferedFdBase { using Parent = BufferedFdBase; ChainBufferWriter input_writer_; ChainBufferReader input_reader_; diff --git a/tdutils/td/utils/BufferedUdp.h b/tdutils/td/utils/BufferedUdp.h index b99815baa..a4b13446e 100644 --- a/tdutils/td/utils/BufferedUdp.h +++ b/tdutils/td/utils/BufferedUdp.h @@ -108,7 +108,7 @@ class UdpReader { #endif -class BufferedUdp : public UdpSocketFd { +class BufferedUdp final : public UdpSocketFd { public: explicit BufferedUdp(UdpSocketFd fd) : UdpSocketFd(std::move(fd)) { } diff --git a/tdutils/td/utils/ByteFlow.h b/tdutils/td/utils/ByteFlow.h index fac133089..ec67f13d7 100644 --- a/tdutils/td/utils/ByteFlow.h +++ b/tdutils/td/utils/ByteFlow.h @@ -220,7 +220,7 @@ inline ByteFlowInterface &operator>>(ByteFlowInterface &from, ByteFlowInterface return to; } -class ByteFlowSource : public ByteFlowInterface { +class ByteFlowSource final : public ByteFlowInterface { public: ByteFlowSource() = default; explicit ByteFlowSource(ChainBufferReader *buffer) : buffer_(buffer) { @@ -279,7 +279,7 @@ class ByteFlowSource : public ByteFlowInterface { ByteFlowInterface *parent_ = nullptr; }; -class ByteFlowSink : public ByteFlowInterface { +class ByteFlowSink final : public ByteFlowInterface { public: void set_input(ChainBufferReader *input) final { CHECK(buffer_ == nullptr); @@ -329,7 +329,7 @@ class ByteFlowSink : public ByteFlowInterface { ChainBufferReader *buffer_ = nullptr; }; -class ByteFlowMoveSink : public ByteFlowInterface { +class ByteFlowMoveSink final : public ByteFlowInterface { public: ByteFlowMoveSink() = default; explicit ByteFlowMoveSink(ChainBufferWriter *output) { diff --git a/tdutils/td/utils/CombinedLog.h b/tdutils/td/utils/CombinedLog.h index d8ae953b4..fdb1c160e 100644 --- a/tdutils/td/utils/CombinedLog.h +++ b/tdutils/td/utils/CombinedLog.h @@ -13,7 +13,7 @@ namespace td { -class CombinedLog : public LogInterface { +class CombinedLog final : public LogInterface { public: void set_first(LogInterface *first) { first_ = first; diff --git a/tdutils/td/utils/Destructor.h b/tdutils/td/utils/Destructor.h index 81df89adf..50b655094 100644 --- a/tdutils/td/utils/Destructor.h +++ b/tdutils/td/utils/Destructor.h @@ -24,7 +24,7 @@ class Destructor { }; template -class LambdaDestructor : public Destructor { +class LambdaDestructor final : public Destructor { public: explicit LambdaDestructor(F &&f) : f_(std::move(f)) { } diff --git a/tdutils/td/utils/FileLog.h b/tdutils/td/utils/FileLog.h index b57434f0c..c93239990 100644 --- a/tdutils/td/utils/FileLog.h +++ b/tdutils/td/utils/FileLog.h @@ -16,7 +16,7 @@ namespace td { -class FileLog : public LogInterface { +class FileLog final : public LogInterface { static constexpr int64 DEFAULT_ROTATE_THRESHOLD = 10 * (1 << 20); public: diff --git a/tdutils/td/utils/JsonBuilder.h b/tdutils/td/utils/JsonBuilder.h index efd30c7f9..4c6d54c33 100644 --- a/tdutils/td/utils/JsonBuilder.h +++ b/tdutils/td/utils/JsonBuilder.h @@ -311,7 +311,7 @@ class JsonScope { } }; -class JsonValueScope : public JsonScope { +class JsonValueScope final : public JsonScope { public: using JsonScope::JsonScope; template @@ -336,7 +336,7 @@ class JsonValueScope : public JsonScope { bool was_ = false; }; -class JsonArrayScope : public JsonScope { +class JsonArrayScope final : public JsonScope { public: explicit JsonArrayScope(JsonBuilder *jb) : JsonScope(jb) { jb->inc_offset(); @@ -377,7 +377,7 @@ class JsonArrayScope : public JsonScope { bool is_first_ = false; }; -class JsonObjectScope : public JsonScope { +class JsonObjectScope final : public JsonScope { public: explicit JsonObjectScope(JsonBuilder *jb) : JsonScope(jb) { jb->inc_offset(); @@ -448,7 +448,7 @@ class JsonValue; using JsonObject = vector>; using JsonArray = vector; -class JsonValue : public Jsonable { +class JsonValue final : public Jsonable { public: enum class Type { Null, Number, Boolean, String, Array, Object }; @@ -696,7 +696,7 @@ class VirtuallyJsonable : public Jsonable { virtual ~VirtuallyJsonable() = default; }; -class VirtuallyJsonableInt : public VirtuallyJsonable { +class VirtuallyJsonableInt final : public VirtuallyJsonable { public: explicit VirtuallyJsonableInt(int32 value) : value_(value) { } @@ -708,7 +708,7 @@ class VirtuallyJsonableInt : public VirtuallyJsonable { int32 value_; }; -class VirtuallyJsonableLong : public VirtuallyJsonable { +class VirtuallyJsonableLong final : public VirtuallyJsonable { public: explicit VirtuallyJsonableLong(int64 value) : value_(value) { } @@ -720,7 +720,7 @@ class VirtuallyJsonableLong : public VirtuallyJsonable { int64 value_; }; -class VirtuallyJsonableString : public VirtuallyJsonable { +class VirtuallyJsonableString final : public VirtuallyJsonable { public: explicit VirtuallyJsonableString(Slice value) : value_(value) { } @@ -766,7 +766,7 @@ StrT json_encode(const ValT &val, bool pretty = false) { } template -class ToJsonImpl : public Jsonable { +class ToJsonImpl final : public Jsonable { public: explicit ToJsonImpl(const T &value) : value_(value) { } diff --git a/tdutils/td/utils/MemoryLog.h b/tdutils/td/utils/MemoryLog.h index 06bc2508c..a634a0955 100644 --- a/tdutils/td/utils/MemoryLog.h +++ b/tdutils/td/utils/MemoryLog.h @@ -17,7 +17,7 @@ namespace td { template -class MemoryLog : public LogInterface { +class MemoryLog final : public LogInterface { static constexpr size_t MAX_OUTPUT_SIZE = buffer_size / 16 < (8 << 10) ? buffer_size / 16 : (8 << 10); static_assert((buffer_size & (buffer_size - 1)) == 0, "Buffer size must be power of 2"); diff --git a/tdutils/td/utils/NullLog.h b/tdutils/td/utils/NullLog.h index 0752eceea..9f44a6f43 100644 --- a/tdutils/td/utils/NullLog.h +++ b/tdutils/td/utils/NullLog.h @@ -11,7 +11,7 @@ namespace td { -class NullLog : public LogInterface { +class NullLog final : public LogInterface { void do_append(int /*log_level*/, CSlice /*slice*/) final { } }; diff --git a/tdutils/td/utils/Observer.h b/tdutils/td/utils/Observer.h index 9366d9a80..46524900a 100644 --- a/tdutils/td/utils/Observer.h +++ b/tdutils/td/utils/Observer.h @@ -22,7 +22,7 @@ class ObserverBase { virtual void notify() = 0; }; -class Observer : ObserverBase { +class Observer final : private ObserverBase { public: Observer() = default; explicit Observer(unique_ptr &&ptr) : observer_ptr_(std::move(ptr)) { diff --git a/tdutils/td/utils/ScopeGuard.h b/tdutils/td/utils/ScopeGuard.h index 3e67c2713..59b808940 100644 --- a/tdutils/td/utils/ScopeGuard.h +++ b/tdutils/td/utils/ScopeGuard.h @@ -29,7 +29,7 @@ class Guard { }; template -class LambdaGuard : public Guard { +class LambdaGuard final : public Guard { public: explicit LambdaGuard(const FunctionT &func) : func_(func) { } diff --git a/tdutils/td/utils/Storer.h b/tdutils/td/utils/Storer.h index 47c53d15b..281bdece7 100644 --- a/tdutils/td/utils/Storer.h +++ b/tdutils/td/utils/Storer.h @@ -17,7 +17,7 @@ namespace td { -class SliceStorer : public Storer { +class SliceStorer final : public Storer { Slice slice; public: @@ -36,7 +36,7 @@ inline SliceStorer create_storer(Slice slice) { return SliceStorer(slice); } -class ConcatStorer : public Storer { +class ConcatStorer final : public Storer { const Storer &a_; const Storer &b_; @@ -61,7 +61,7 @@ inline ConcatStorer create_storer(const Storer &a, const Storer &b) { } template -class DefaultStorer : public Storer { +class DefaultStorer final : public Storer { public: explicit DefaultStorer(const T &object) : object_(object) { } diff --git a/tdutils/td/utils/TsFileLog.cpp b/tdutils/td/utils/TsFileLog.cpp index e904b5dd7..51ca4d54e 100644 --- a/tdutils/td/utils/TsFileLog.cpp +++ b/tdutils/td/utils/TsFileLog.cpp @@ -21,7 +21,7 @@ namespace td { namespace detail { -class TsFileLog : public LogInterface { +class TsFileLog final : public LogInterface { public: Status init(string path, int64 rotate_threshold, bool redirect_stderr) { path_ = std::move(path); diff --git a/tdutils/td/utils/TsList.h b/tdutils/td/utils/TsList.h index c5a24b026..0f4b8943a 100644 --- a/tdutils/td/utils/TsList.h +++ b/tdutils/td/utils/TsList.h @@ -159,7 +159,7 @@ class TsListNode : protected ListNode { }; template -class TsList : public TsListNode { +class TsList final : public TsListNode { public: TsList() { this->parent = this; diff --git a/tdutils/td/utils/TsLog.h b/tdutils/td/utils/TsLog.h index 4dfb3e44d..59e40b3a1 100644 --- a/tdutils/td/utils/TsLog.h +++ b/tdutils/td/utils/TsLog.h @@ -14,7 +14,7 @@ namespace td { -class TsLog : public LogInterface { +class TsLog final : public LogInterface { public: explicit TsLog(LogInterface *log) : log_(log) { } diff --git a/tdutils/td/utils/Variant.h b/tdutils/td/utils/Variant.h index 575c08dba..b964d488a 100644 --- a/tdutils/td/utils/Variant.h +++ b/tdutils/td/utils/Variant.h @@ -55,7 +55,7 @@ class IthTypeImpl : public IthTypeImpl {}; class Dummy {}; template -class IthType : public IthTypeImpl {}; +class IthType final : public IthTypeImpl {}; template class FindTypeOffsetImpl {}; @@ -69,7 +69,7 @@ template class FindTypeOffsetImpl : public FindTypeOffsetImpl::value, offset + 1, T, Types...> {}; template -class FindTypeOffset : public FindTypeOffsetImpl {}; +class FindTypeOffset final : public FindTypeOffsetImpl {}; template class ForEachTypeImpl {}; diff --git a/tdutils/td/utils/benchmark.h b/tdutils/td/utils/benchmark.h index 1daf0ab48..aa898ce88 100644 --- a/tdutils/td/utils/benchmark.h +++ b/tdutils/td/utils/benchmark.h @@ -15,14 +15,14 @@ #include #include -#define BENCH(name, desc) \ - class name##Bench : public ::td::Benchmark { \ - public: \ - std::string get_description() const final { \ - return (desc); \ - } \ - void run(int n) final; \ - }; \ +#define BENCH(name, desc) \ + class name##Bench final : public ::td::Benchmark { \ + public: \ + std::string get_description() const final { \ + return (desc); \ + } \ + void run(int n) final; \ + }; \ void name##Bench::run(int n) namespace td { diff --git a/tdutils/td/utils/invoke.h b/tdutils/td/utils/invoke.h index 185ace36d..f26a24378 100644 --- a/tdutils/td/utils/invoke.h +++ b/tdutils/td/utils/invoke.h @@ -203,8 +203,8 @@ auto call_n_arguments(F &&f, Args &&... args) { } template -struct is_callable : public std::false_type {}; +struct is_callable final : public std::false_type {}; template -struct is_callable()(std::declval()))> : public std::true_type {}; +struct is_callable()(std::declval()))> final : public std::true_type {}; } // namespace td diff --git a/tdutils/td/utils/logging.cpp b/tdutils/td/utils/logging.cpp index 692b6cfb9..956aab579 100644 --- a/tdutils/td/utils/logging.cpp +++ b/tdutils/td/utils/logging.cpp @@ -150,7 +150,7 @@ Logger::~Logger() { } } -class DefaultLog : public LogInterface { +class DefaultLog final : public LogInterface { void do_append(int log_level, CSlice slice) final { #if TD_ANDROID switch (log_level) { diff --git a/tdutils/td/utils/misc.h b/tdutils/td/utils/misc.h index 731ea0c69..ac5ea64b4 100644 --- a/tdutils/td/utils/misc.h +++ b/tdutils/td/utils/misc.h @@ -271,7 +271,7 @@ MutableSlice url_decode_inplace(MutableSlice str, bool decode_plus_sign_as_space namespace detail { template -struct is_same_signedness +struct is_same_signedness final : public std::integral_constant::value == std::is_signed::value> {}; template diff --git a/tdutils/td/utils/overloaded.h b/tdutils/td/utils/overloaded.h index 011cd51c6..ca3511e77 100644 --- a/tdutils/td/utils/overloaded.h +++ b/tdutils/td/utils/overloaded.h @@ -22,7 +22,7 @@ struct overload : public F { template struct overload : public overload - , overload { + , public overload { overload(F f, Fs... fs) : overload(f), overload(fs...) { } using overload::operator(); diff --git a/tdutils/td/utils/port/ServerSocketFd.cpp b/tdutils/td/utils/port/ServerSocketFd.cpp index ff908a8e9..d15874ec7 100644 --- a/tdutils/td/utils/port/ServerSocketFd.cpp +++ b/tdutils/td/utils/port/ServerSocketFd.cpp @@ -40,7 +40,7 @@ namespace td { namespace detail { #if TD_PORT_WINDOWS -class ServerSocketFdImpl : private Iocp::Callback { +class ServerSocketFdImpl final : private Iocp::Callback { public: ServerSocketFdImpl(NativeFd fd, int socket_family) : info_(std::move(fd)), socket_family_(socket_family) { VLOG(fd) << get_native_fd() << " create ServerSocketFd"; diff --git a/tdutils/td/utils/port/SocketFd.cpp b/tdutils/td/utils/port/SocketFd.cpp index ed00c1f4f..15e448a19 100644 --- a/tdutils/td/utils/port/SocketFd.cpp +++ b/tdutils/td/utils/port/SocketFd.cpp @@ -41,7 +41,7 @@ namespace td { namespace detail { #if TD_PORT_WINDOWS -class SocketFdImpl : private Iocp::Callback { +class SocketFdImpl final : private Iocp::Callback { public: explicit SocketFdImpl(NativeFd native_fd) : info(std::move(native_fd)) { VLOG(fd) << get_native_fd() << " create from native_fd"; diff --git a/tdutils/td/utils/port/StdStreams.cpp b/tdutils/td/utils/port/StdStreams.cpp index 09396fffa..a311e04df 100644 --- a/tdutils/td/utils/port/StdStreams.cpp +++ b/tdutils/td/utils/port/StdStreams.cpp @@ -69,7 +69,7 @@ FileFd &Stderr() { #if TD_PORT_WINDOWS namespace detail { -class BufferedStdinImpl : public Iocp::Callback { +class BufferedStdinImpl final : private Iocp::Callback { public: #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) BufferedStdinImpl() : info_(NativeFd(GetStdHandle(STD_INPUT_HANDLE), true)) { diff --git a/tdutils/td/utils/port/UdpSocketFd.cpp b/tdutils/td/utils/port/UdpSocketFd.cpp index aac3d504c..a8da87664 100644 --- a/tdutils/td/utils/port/UdpSocketFd.cpp +++ b/tdutils/td/utils/port/UdpSocketFd.cpp @@ -98,7 +98,7 @@ class UdpSocketSendHelper { WSABUF buf_; }; -class UdpSocketFdImpl : private Iocp::Callback { +class UdpSocketFdImpl final : private Iocp::Callback { public: explicit UdpSocketFdImpl(NativeFd fd) : info_(std::move(fd)) { get_poll_info().add_flags(PollFlags::Write()); diff --git a/tdutils/td/utils/port/detail/PollableFd.h b/tdutils/td/utils/port/detail/PollableFd.h index 69410c891..dd4e86a1a 100644 --- a/tdutils/td/utils/port/detail/PollableFd.h +++ b/tdutils/td/utils/port/detail/PollableFd.h @@ -60,7 +60,7 @@ inline PollableFd PollableFdRef::lock() { return PollableFd::from_list_node(list_node_); } -class PollableFdInfo : private ListNode { +class PollableFdInfo final : private ListNode { public: PollableFdInfo() = default; PollableFdInfo(const PollableFdInfo &) = delete; diff --git a/tdutils/td/utils/queue.h b/tdutils/td/utils/queue.h index cd0b6ca2c..15f200591 100644 --- a/tdutils/td/utils/queue.h +++ b/tdutils/td/utils/queue.h @@ -285,7 +285,7 @@ class SPSCChainQueue { }; template , class BackoffT = detail::Backoff> -class BackoffQueue : public QueueT { +class BackoffQueue final : public QueueT { public: using ValueType = T; @@ -312,7 +312,7 @@ template > using InfBackoffQueue = BackoffQueue; template > -class PollQueue : public QueueT { +class PollQueue final : public QueueT { public: using ValueType = T; using QueueType = QueueT; diff --git a/tdutils/td/utils/tests.cpp b/tdutils/td/utils/tests.cpp index 380e6d464..ecb14a968 100644 --- a/tdutils/td/utils/tests.cpp +++ b/tdutils/td/utils/tests.cpp @@ -58,7 +58,7 @@ StringBuilder &operator<<(StringBuilder &sb, const TestInfo &info) { return sb << info.name << " " << info.result_hash << "\n"; } -class RegressionTesterImpl : public RegressionTester { +class RegressionTesterImpl final : public RegressionTester { public: static void destroy(CSlice db_path) { unlink(db_path).ignore(); diff --git a/tdutils/td/utils/tests.h b/tdutils/td/utils/tests.h index 00137d4b6..ec8377db5 100644 --- a/tdutils/td/utils/tests.h +++ b/tdutils/td/utils/tests.h @@ -85,7 +85,7 @@ class TestContext : public Context { virtual Status verify(Slice data) = 0; }; -class TestsRunner : public TestContext { +class TestsRunner final : public TestContext { public: static TestsRunner &get_default(); @@ -170,7 +170,7 @@ void assert_true_impl(const T &got, const char *file, int line) { #define TEST(test_case_name, test_name) TEST_IMPL(TEST_NAME(test_case_name, test_name)) #define TEST_IMPL(test_name) \ - class test_name : public ::td::Test { \ + class test_name final : public ::td::Test { \ public: \ using Test::Test; \ void run() final; \ diff --git a/tdutils/test/ConcurrentHashMap.cpp b/tdutils/test/ConcurrentHashMap.cpp index aa9351d53..c9c9b42b1 100644 --- a/tdutils/test/ConcurrentHashMap.cpp +++ b/tdutils/test/ConcurrentHashMap.cpp @@ -177,7 +177,7 @@ class ConcurrentHashMapJunction { } // namespace td template -class HashMapBenchmark : public td::Benchmark { +class HashMapBenchmark final : public td::Benchmark { struct Query { int key; int value; diff --git a/tdutils/test/List.cpp b/tdutils/test/List.cpp index d3cf39f61..0d29b0e6c 100644 --- a/tdutils/test/List.cpp +++ b/tdutils/test/List.cpp @@ -26,7 +26,7 @@ struct ListData { } }; -struct Node : public td::ListNode { +struct Node final : public td::ListNode { Node() = default; explicit Node(ListData data) : data(std::move(data)) { } diff --git a/tdutils/test/MpscLinkQueue.cpp b/tdutils/test/MpscLinkQueue.cpp index 9570151f8..9c0e3886c 100644 --- a/tdutils/test/MpscLinkQueue.cpp +++ b/tdutils/test/MpscLinkQueue.cpp @@ -11,7 +11,7 @@ #include "td/utils/port/thread.h" #include "td/utils/tests.h" -class NodeX : public td::MpscLinkQueueImpl::Node { +class NodeX final : public td::MpscLinkQueueImpl::Node { public: explicit NodeX(int value) : value_(value) { } diff --git a/tdutils/test/crypto.cpp b/tdutils/test/crypto.cpp index cab285f4f..c7abbd61d 100644 --- a/tdutils/test/crypto.cpp +++ b/tdutils/test/crypto.cpp @@ -362,7 +362,7 @@ TEST(Crypto, crc32c) { } TEST(Crypto, crc32c_benchmark) { - class Crc32cExtendBenchmark : public td::Benchmark { + class Crc32cExtendBenchmark final : public td::Benchmark { public: explicit Crc32cExtendBenchmark(size_t chunk_size) : chunk_size_(chunk_size) { } diff --git a/tdutils/test/heap.cpp b/tdutils/test/heap.cpp index 633e884ae..6c2c9ad3c 100644 --- a/tdutils/test/heap.cpp +++ b/tdutils/test/heap.cpp @@ -135,7 +135,7 @@ class CheckedHeap { } private: - struct Node : public td::HeapNode { + struct Node final : public td::HeapNode { Node() = default; Node(int key, int value) : key(key), value(value) { } diff --git a/tdutils/test/log.cpp b/tdutils/test/log.cpp index 349f63db7..571235d43 100644 --- a/tdutils/test/log.cpp +++ b/tdutils/test/log.cpp @@ -26,7 +26,7 @@ char disable_linker_warning_about_empty_file_tdutils_test_log_cpp TD_UNUSED; #if !TD_THREAD_UNSUPPORTED template -class LogBenchmark : public td::Benchmark { +class LogBenchmark final : public td::Benchmark { public: LogBenchmark(std::string name, int threads_n, bool test_full_logging, std::function()> creator) : name_(std::move(name)) @@ -116,7 +116,7 @@ TEST(Log, Bench) { [] { return td::TsFileLog::create("tmplog", std::numeric_limits::max(), false).move_as_ok(); }); bench_log("FileLog + TsLog", [] { - class FileLog : public td::LogInterface { + class FileLog final : public td::LogInterface { public: FileLog() { file_log_.init("tmplog", std::numeric_limits::max(), false).ensure(); @@ -137,7 +137,7 @@ TEST(Log, Bench) { }); bench_log("FileLog", [] { - class FileLog : public td::LogInterface { + class FileLog final : public td::LogInterface { public: FileLog() { file_log_.init("tmplog", std::numeric_limits::max(), false).ensure(); diff --git a/test/db.cpp b/test/db.cpp index 063c8c7b7..2badeeda4 100644 --- a/test/db.cpp +++ b/test/db.cpp @@ -554,7 +554,7 @@ TEST(DB, persistent_key_value) { } std::vector> res(threads_n); - class Worker : public Actor { + class Worker final : public Actor { public: Worker(ActorShared<> parent, std::shared_ptr> kv, const std::vector *queries, std::vector *res) @@ -574,7 +574,7 @@ TEST(DB, persistent_key_value) { const std::vector *queries_; std::vector *res_; }; - class Main : public Actor { + class Main final : public Actor { public: Main(int threads_n, const std::vector> *queries, std::vector> *res) : threads_n_(threads_n), queries_(queries), res_(res), ref_cnt_(threads_n) { diff --git a/test/mtproto.cpp b/test/mtproto.cpp index 5c10e760e..1e6e5e6b9 100644 --- a/test/mtproto.cpp +++ b/test/mtproto.cpp @@ -196,7 +196,7 @@ TEST(Mtproto, encrypted_config) { auto config = decode_config(data).move_as_ok(); } -class TestPingActor : public Actor { +class TestPingActor final : public Actor { public: TestPingActor(IPAddress ip_address, Status *result) : ip_address_(ip_address), result_(result) { } @@ -264,7 +264,7 @@ static int32 get_default_dc_id() { return 10002; } -class Mtproto_ping : public Test { +class Mtproto_ping final : public Test { public: using Test::Test; bool step() final { @@ -293,7 +293,7 @@ class Mtproto_ping : public Test { }; RegisterTest mtproto_ping("Mtproto_ping"); -class HandshakeContext : public mtproto::AuthKeyHandshakeContext { +class HandshakeContext final : public mtproto::AuthKeyHandshakeContext { public: DhCallback *get_dh_callback() final { return nullptr; @@ -306,7 +306,7 @@ class HandshakeContext : public mtproto::AuthKeyHandshakeContext { PublicRsaKeyShared public_rsa_key{DcId::empty(), false}; }; -class HandshakeTestActor : public Actor { +class HandshakeTestActor final : public Actor { public: HandshakeTestActor(int32 dc_id, Status *result) : dc_id_(dc_id), result_(result) { } @@ -404,7 +404,7 @@ class HandshakeTestActor : public Actor { } }; -class Mtproto_handshake : public Test { +class Mtproto_handshake final : public Test { public: using Test::Test; bool step() final { @@ -433,14 +433,14 @@ class Mtproto_handshake : public Test { }; RegisterTest mtproto_handshake("Mtproto_handshake"); -class Socks5TestActor : public Actor { +class Socks5TestActor final : public Actor { public: void start_up() final { auto promise = PromiseCreator::lambda([actor_id = actor_id(this)](Result res) { send_closure(actor_id, &Socks5TestActor::on_result, std::move(res), false); }); - class Callback : public TransparentProxy::Callback { + class Callback final : public TransparentProxy::Callback { public: explicit Callback(Promise promise) : promise_(std::move(promise)) { } @@ -521,7 +521,7 @@ TEST(Mtproto, notifications) { } } -class FastPingTestActor : public Actor { +class FastPingTestActor final : public Actor { public: explicit FastPingTestActor(Status *result) : result_(result) { } @@ -623,7 +623,7 @@ class FastPingTestActor : public Actor { } }; -class Mtproto_FastPing : public Test { +class Mtproto_FastPing final : public Test { public: using Test::Test; bool step() final { @@ -670,9 +670,9 @@ TEST(Mtproto, TlsTransport) { sched.init(threads_n); { auto guard = sched.get_main_guard(); - class RunTest : public Actor { + class RunTest final : public Actor { void start_up() final { - class Callback : public TransparentProxy::Callback { + class Callback final : public TransparentProxy::Callback { public: void set_result(Result result) final { if (result.is_ok()) { diff --git a/test/secret.cpp b/test/secret.cpp index 24f07ed2c..a223935d2 100644 --- a/test/secret.cpp +++ b/test/secret.cpp @@ -334,7 +334,7 @@ static string prime_base64 = "WC2xF40WnGvEZbDW_5yjko_vW5rk5Bj8Feg-vqD4f6n_Xu1wBQ3tKEn0e_lZ2VaFDOkphR8NgRX2NbEF7i5OFdBLJFS_b0-t8DSxBAMRnNjjuS_MW" "w"; -class FakeDhCallback : public DhCallback { +class FakeDhCallback final : public DhCallback { public: int is_good_prime(Slice prime_str) const final { auto it = cache.find(prime_str.str()); @@ -352,7 +352,7 @@ class FakeDhCallback : public DhCallback { mutable std::map cache; }; -class FakeBinlog +class FakeBinlog final : public BinlogInterface , public Actor { public: @@ -479,7 +479,7 @@ class FakeBinlog using FakeKeyValue = BinlogKeyValue; class Master; -class FakeSecretChatContext : public SecretChatActor::Context { +class FakeSecretChatContext final : public SecretChatActor::Context { public: FakeSecretChatContext(std::shared_ptr binlog, std::shared_ptr key_value, std::shared_ptr close_flag, ActorShared master) @@ -565,11 +565,11 @@ class FakeSecretChatContext : public SecretChatActor::Context { }; NetQueryCreator FakeSecretChatContext::net_query_creator_; -class Master : public Actor { +class Master final : public Actor { public: explicit Master(Status *status) : status_(status) { } - class SecretChatProxy : public Actor { + class SecretChatProxy final : public Actor { public: SecretChatProxy(string name, ActorShared parent) : name_(std::move(name)) { binlog_ = std::make_shared(); diff --git a/test/tdclient.cpp b/test/tdclient.cpp index dffe30c8c..eaba531d7 100644 --- a/test/tdclient.cpp +++ b/test/tdclient.cpp @@ -46,7 +46,7 @@ static void check_td_error(T &result) { LOG_CHECK(result->get_id() != td::td_api::error::ID) << to_string(result); } -class TestClient : public td::Actor { +class TestClient final : public td::Actor { public: explicit TestClient(td::string name) : name_(std::move(name)) { } @@ -76,7 +76,7 @@ class TestClient : public td::Actor { } td::unique_ptr make_td_callback() { - class TdCallbackImpl : public td::TdCallback { + class TdCallbackImpl final : public td::TdCallback { public: explicit TdCallbackImpl(td::ActorId client) : client_(client) { } @@ -197,7 +197,7 @@ class TestClinetTask : public TestClient::Listener { } }; -class DoAuthentication : public TestClinetTask { +class DoAuthentication final : public TestClinetTask { public: DoAuthentication(td::string name, td::string phone, td::string code, td::Promise<> promise) : name_(std::move(name)), phone_(std::move(phone)), code_(std::move(code)), promise_(std::move(promise)) { @@ -273,7 +273,7 @@ class DoAuthentication : public TestClinetTask { } }; -class SetUsername : public TestClinetTask { +class SetUsername final : public TestClinetTask { public: SetUsername(td::string username, td::Promise<> promise) : username_(std::move(username)), promise_(std::move(promise)) { @@ -338,7 +338,7 @@ class SetUsername : public TestClinetTask { } }; -class CheckTestA : public TestClinetTask { +class CheckTestA final : public TestClinetTask { public: CheckTestA(td::string tag, td::Promise<> promise) : tag_(std::move(tag)), promise_(std::move(promise)) { } @@ -370,7 +370,7 @@ class CheckTestA : public TestClinetTask { } }; -class TestA : public TestClinetTask { +class TestA final : public TestClinetTask { public: TestA(td::string tag, td::string username) : tag_(std::move(tag)), username_(std::move(username)) { } @@ -396,7 +396,7 @@ class TestA : public TestClinetTask { td::string username_; }; -class TestSecretChat : public TestClinetTask { +class TestSecretChat final : public TestClinetTask { public: TestSecretChat(td::string tag, td::string username) : tag_(std::move(tag)), username_(std::move(username)) { } @@ -447,7 +447,7 @@ class TestSecretChat : public TestClinetTask { td::int64 chat_id_ = 0; }; -class TestFileGenerated : public TestClinetTask { +class TestFileGenerated final : public TestClinetTask { public: TestFileGenerated(td::string tag, td::string username) : tag_(std::move(tag)), username_(std::move(username)) { } @@ -511,7 +511,7 @@ class TestFileGenerated : public TestClinetTask { [](auto res) { check_td_error(res); }); } - class GenerateFile : public td::Actor { + class GenerateFile final : public td::Actor { public: GenerateFile(TestClinetTask *parent, td::int64 id, td::string original_path, td::string destination_path, td::string conversion) @@ -588,7 +588,7 @@ class TestFileGenerated : public TestClinetTask { td::int64 chat_id_ = 0; }; -class CheckTestC : public TestClinetTask { +class CheckTestC final : public TestClinetTask { public: CheckTestC(td::string username, td::string tag, td::Promise<> promise) : username_(std::move(username)), tag_(std::move(tag)), promise_(std::move(promise)) { @@ -658,7 +658,7 @@ class CheckTestC : public TestClinetTask { td::int32 file_id_to_check_ = 0; }; -class LoginTestActor : public td::Actor { +class LoginTestActor final : public td::Actor { public: explicit LoginTestActor(td::Status *status) : status_(status) { *status_ = td::Status::OK(); @@ -705,7 +705,7 @@ class LoginTestActor : public td::Actor { init(); } else if (start_up_fence_ == 1) { return init(); - class WaitActor : public td::Actor { + class WaitActor final : public td::Actor { public: WaitActor(double timeout, td::Promise<> promise) : timeout_(timeout), promise_(std::move(promise)) { } @@ -822,7 +822,7 @@ class LoginTestActor : public td::Actor { } }; -class Tdclient_login : public td::Test { +class Tdclient_login final : public td::Test { public: using Test::Test; bool step() final {