2021-09-12 18:04:22 +02:00
|
|
|
//
|
2022-01-01 01:35:39 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
|
2021-09-12 18:04:22 +02:00
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
//
|
|
|
|
#pragma once
|
|
|
|
|
2021-09-18 23:47:05 +02:00
|
|
|
#include "td/utils/common.h"
|
2021-11-01 17:21:24 +01:00
|
|
|
#include "td/utils/TlStorerToString.h"
|
2021-09-18 23:47:05 +02:00
|
|
|
|
2021-09-12 18:04:22 +02:00
|
|
|
namespace td {
|
|
|
|
|
|
|
|
template <class T>
|
|
|
|
class TlDowncastHelper final : public T {
|
|
|
|
public:
|
|
|
|
explicit TlDowncastHelper(int32 constructor) : constructor_(constructor) {
|
|
|
|
}
|
|
|
|
int32 get_id() const final {
|
|
|
|
return constructor_;
|
|
|
|
}
|
|
|
|
void store(TlStorerToString &s, const char *field_name) const final {
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
int32 constructor_{0};
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace td
|