Fix some td/actor/ includes.

GitOrigin-RevId: f9cf960b96018c4eb6169d2ec6cb5d3fbc16c0ec
This commit is contained in:
levlam 2018-07-03 22:29:04 +03:00
parent b28ec40407
commit deecdb66bc
76 changed files with 105 additions and 40 deletions

View File

@ -9,6 +9,9 @@
#include "td/telegram/MessagesDb.h"
#include "td/telegram/UserId.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/benchmark.h"
#include "td/utils/buffer.h"
#include "td/utils/common.h"

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/mtproto/PacketStorer.h"
#include "td/utils/Random.h"

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/mtproto/IStreamTransport.h"
#include "td/utils/buffer.h"

View File

@ -10,8 +10,6 @@
#include "td/mtproto/RawConnection.h"
#include "td/mtproto/utils.h"
#include "td/actor/actor.h"
#include "td/utils/buffer.h"
#include "td/utils/format.h"
#include "td/utils/Named.h"
@ -47,6 +45,7 @@ class msg_new_detailed_info;
} // namespace mtproto_api
namespace mtproto {
class AuthData;
struct PacketInfo;
@ -249,5 +248,6 @@ class SessionConnection
Status on_raw_packet(const td::mtproto::PacketInfo &info, BufferSlice packet) override;
Status on_quick_ack(uint64 quick_ack_token) override;
};
} // namespace mtproto
} // namespace td

View File

@ -10,6 +10,7 @@
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/files/FileId.h"
#include "td/telegram/Photo.h"

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/AnimationsManager.h"
#include "td/telegram/files/FileId.hpp"

View File

@ -6,8 +6,6 @@
//
#include "td/telegram/AudiosManager.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/Global.h"

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/AudiosManager.h"
#include "td/telegram/files/FileId.hpp"

View File

@ -13,6 +13,8 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/utils/common.h"
#include "td/utils/Slice.h"
#include "td/utils/Status.h"

View File

@ -4,6 +4,8 @@
// 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
#include "td/telegram/AuthManager.h"
#include "td/telegram/Version.h"

View File

@ -9,6 +9,7 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/AccessRights.h"

View File

@ -13,6 +13,8 @@
#include "td/telegram/MessageId.h"
#include "td/telegram/UserId.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/buffer.h"
#include "td/utils/common.h"

View File

@ -8,6 +8,8 @@
#include "td/telegram/Td.h"
#include "td/actor/actor.h"
#include "td/utils/crypto.h"
#include "td/utils/logging.h"
#include "td/utils/MpscPollableQueue.h"

View File

@ -13,6 +13,7 @@
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/port/IPAddress.h"
#include "td/utils/Slice.h"

View File

@ -8,6 +8,9 @@
#include "td/telegram/Version.h"
#include "td/actor/actor.h"
#include "td/actor/SchedulerLocalStorage.h"
#include "td/db/SqliteDb.h"
#include "td/db/SqliteKeyValue.h"
#include "td/db/SqliteStatement.h"

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileId.hpp"

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/Game.h"
#include "td/telegram/AnimationsManager.hpp"

View File

@ -13,7 +13,6 @@
#include "td/telegram/net/TempAuthKeyWatchdog.h"
#include "td/telegram/TdDb.h"
#include "td/actor/MultiPromise.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/format.h"

View File

@ -11,6 +11,7 @@
#include "td/actor/actor.h"
#include "td/actor/MultiPromise.h"
#include "td/actor/PromiseFuture.h"
#include "td/actor/Timeout.h"
#include "td/telegram/DialogId.h"

View File

@ -11,6 +11,7 @@
#include "td/telegram/net/NetQueryDispatcher.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"

View File

@ -15,6 +15,7 @@
#include "td/actor/PromiseFuture.h"
#include "td/utils/Container.h"
#include "td/utils/Status.h"
namespace td {

View File

@ -12,7 +12,9 @@
#include "td/db/SqliteDb.h"
#include "td/db/SqliteStatement.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/actor/SchedulerLocalStorage.h"
#include "td/utils/format.h"
#include "td/utils/logging.h"

View File

@ -10,6 +10,7 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/MultiPromise.h"
#include "td/actor/PromiseFuture.h"
#include "td/actor/SignalSlot.h"

View File

@ -9,6 +9,9 @@
#include "td/telegram/net/NetQuery.h"
#include "td/telegram/SecureStorage.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/Container.h"
#include "td/utils/logging.h"
#include "td/utils/optional.h"

View File

@ -9,6 +9,7 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/net/NetQuery.h"

View File

@ -6,16 +6,16 @@
//
#pragma once
#include "td/telegram/SecretChatActor.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/logevent/SecretChatEvent.h"
#include "td/telegram/PtsManager.h"
#include "td/telegram/SecretChatActor.h"
#include "td/telegram/SecretChatId.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/db/binlog/BinlogEvent.h"

View File

@ -6,8 +6,6 @@
//
#pragma once
#include "td/actor/actor.h"
#include "td/telegram/net/NetQuery.h"
#include "td/telegram/SecureValue.h"
#include "td/telegram/UserId.h"
@ -15,6 +13,9 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/Container.h"
#include "td/utils/Status.h"

View File

@ -13,8 +13,6 @@
#include "td/utils/Slice.h"
#include "td/utils/Status.h"
#include "td/actor/actor.h"
namespace td {
// Types
// Password

View File

@ -9,6 +9,8 @@
#include "td/telegram/Global.h"
#include "td/telegram/net/NetQueryDispatcher.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/format.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"

View File

@ -8,6 +8,8 @@
#include "td/telegram/net/NetQuery.h"
#include "td/actor/actor.h"
#include "td/utils/common.h"
#include "td/utils/Random.h"

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/StickersManager.h"
#include "td/telegram/files/FileId.hpp"

View File

@ -13,7 +13,6 @@
#include "td/telegram/TdParameters.h"
#include "td/telegram/Version.h"
#include "td/actor/actor.h"
#include "td/actor/MultiPromise.h"
#include "td/db/BinlogKeyValue.h"

View File

@ -6,6 +6,8 @@
//
#pragma once
#include "td/actor/PromiseFuture.h"
#include "td/db/binlog/Binlog.h"
#include "td/db/binlog/BinlogEvent.h"
#include "td/db/binlog/ConcurrentBinlog.h"

View File

@ -12,8 +12,10 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/actor/Timeout.h"
#include "td/utils/common.h"
#include <map>

View File

@ -10,8 +10,6 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/SecretChatActor.h"

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/VideoNotesManager.h"
#include "td/telegram/files/FileId.hpp"

View File

@ -10,8 +10,6 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/AuthManager.h"
#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h"

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/VideosManager.h"
#include "td/telegram/files/FileId.hpp"

View File

@ -10,8 +10,6 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/Global.h"

View File

@ -8,9 +8,6 @@
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/files/FileLoader.h"
#include "td/telegram/files/FileLocation.h"
#include "td/telegram/net/DcId.h"

View File

@ -10,6 +10,8 @@
#include "td/telegram/files/FileLocation.h"
#include "td/telegram/files/ResourceManager.h"
#include "td/actor/actor.h"
#include "td/utils/BufferedFd.h"
#include "td/utils/crypto.h"
#include "td/utils/port/FileFd.h"

View File

@ -7,7 +7,6 @@
#pragma once
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/files/FileLoaderActor.h"
#include "td/telegram/files/FileLocation.h"

View File

@ -9,6 +9,8 @@
#include "td/telegram/files/ResourceState.h"
#include "td/telegram/net/NetQuery.h"
#include "td/actor/actor.h"
namespace td {
class LocalFileLocation;

View File

@ -17,6 +17,9 @@
#include "td/telegram/files/FileLocation.h"
#include "td/telegram/files/FileStats.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/buffer.h"
#include "td/utils/common.h"
#include "td/utils/Container.h"

View File

@ -6,9 +6,6 @@
//
#pragma once
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/files/FileLoader.h"
#include "td/telegram/files/FileLocation.h"

View File

@ -7,7 +7,6 @@
#pragma once
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/files/FileLoaderActor.h"
#include "td/telegram/files/ResourceState.h"

View File

@ -8,6 +8,8 @@
#include "td/telegram/logevent/LogEvent.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/buffer.h"
#include "td/utils/format.h"
#include "td/utils/logging.h"

View File

@ -12,6 +12,8 @@
#include "td/telegram/net/NetQueryDispatcher.h"
#include "td/telegram/net/Session.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/logging.h"
#include "td/utils/Slice.h"

View File

@ -7,6 +7,7 @@
#pragma once
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/logging.h"

View File

@ -19,6 +19,7 @@
#include <utility>
namespace td {
inline Actor::Actor(Actor &&other) {
CHECK(info_.empty());
info_ = std::move(other.info_);

View File

@ -12,8 +12,10 @@
#include <type_traits>
namespace td {
class ActorInfo;
class Actor;
class ActorInfo;
template <class ActorType = Actor>
class ActorId {
public:
@ -166,4 +168,5 @@ class ActorRef {
ActorId<> actor_id_;
uint64 token_ = 0;
};
} // namespace td

View File

@ -13,7 +13,6 @@
#include "td/utils/Slice.h"
namespace td {
/*** ActorId ***/
// If actor is on our scheduler(thread) result will be valid
// If actor is on another scheduler we will see it in migrate_dest_flags
@ -44,7 +43,6 @@ Slice ActorId<ActorType>::get_name() const {
return ptr_->get_name();
}
// ActorOwn
template <class ActorType>
ActorOwn<ActorType>::ActorOwn(ActorId<ActorType> id) : id_(std::move(id)) {
}
@ -108,7 +106,6 @@ const ActorId<ActorType> *ActorOwn<ActorType>::operator->() const {
return &id_;
}
// ActorShared
template <class ActorType>
template <class OtherActorType>
ActorShared<ActorType>::ActorShared(ActorId<OtherActorType> id, uint64 token) : id_(std::move(id)), token_(token) {
@ -180,7 +177,6 @@ const ActorId<ActorType> *ActorShared<ActorType>::operator->() const {
return &id_;
}
/*** ActorRef ***/
template <class T>
ActorRef::ActorRef(const ActorId<T> &actor_id) : actor_id_(actor_id) {
}

View File

@ -116,4 +116,5 @@ class ActorInfo
};
StringBuilder &operator<<(StringBuilder &sb, const ActorInfo &info);
} // namespace td

View File

@ -24,12 +24,13 @@
#include <utility>
namespace td {
/*** ActorInfo ***/
inline StringBuilder &operator<<(StringBuilder &sb, const ActorInfo &info) {
sb << info.get_name() << ":" << const_cast<void *>(static_cast<const void *>(&info)) << ":"
<< const_cast<void *>(static_cast<const void *>(info.get_context()));
return sb;
}
inline void ActorInfo::init(int32 sched_id, Slice name, ObjectPool<ActorInfo>::OwnerPtr &&this_ptr, Actor *actor_ptr,
Deleter deleter, bool is_lite) {
CHECK(!is_running());
@ -198,4 +199,5 @@ inline const ListNode *ActorInfo::get_list_node() const {
inline ActorInfo *ActorInfo::from_list_node(ListNode *node) {
return static_cast<ActorInfo *>(node);
}
} // namespace td

View File

@ -241,7 +241,9 @@ class Event {
}
}
};
inline StringBuilder &operator<<(StringBuilder &sb, const Event &e) {
return sb << tag("Event", static_cast<int32>(e.type));
}
} // namespace td

View File

@ -30,7 +30,9 @@
#include <utility>
namespace td {
class ActorInfo;
struct Send {
using Flags = uint32;
static const Flags immediate = 0x001;

View File

@ -6,6 +6,7 @@
//
#include "td/utils/tests.h"
#include "td/actor/actor.h"
#include "td/actor/Timeout.h"
using namespace td;

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/utils/common.h"
#include "td/utils/Slice.h"

View File

@ -6,6 +6,8 @@
//
#include "td/db/SqliteKeyValueAsync.h"
#include "td/actor/actor.h"
#include "td/utils/optional.h"
#include "td/utils/Time.h"

View File

@ -9,6 +9,8 @@
#include "td/db/SqliteConnectionSafe.h"
#include "td/db/SqliteKeyValue.h"
#include "td/actor/SchedulerLocalStorage.h"
#include <memory>
namespace td {

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/db/binlog/BinlogEvent.h"
#include "td/utils/common.h"

View File

@ -5,9 +5,11 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/db/binlog/BinlogEvent.h"
#include "td/utils/common.h"
#include "td/utils/logging.h"
namespace td {
namespace detail {

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"

View File

@ -6,8 +6,6 @@
//
#include "td/net/HttpConnectionBase.h"
#include "td/actor/actor.h"
#include "td/net/HttpHeaderCreator.h"
#include "td/utils/logging.h"
@ -149,5 +147,6 @@ void HttpConnectionBase::loop() {
return stop();
}
}
} // namespace detail
} // namespace td

View File

@ -7,7 +7,6 @@
#pragma once
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/BufferedFd.h"
#include "td/utils/common.h"

View File

@ -10,6 +10,7 @@
#include "td/net/HttpQuery.h"
#include "td/net/SslFd.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/common.h"

View File

@ -54,7 +54,7 @@
// If delay is needed, just std::forward data to temporary storage, and std::move them when call is executed.
//
//
// create_immediate_closure(&Actor::func, arg1, arg2, ..., argn).run(actor)
// create_immediate_closure(&ActorT::func, arg1, arg2, ..., argn).run(actor)
// to_delayed_closure(std::move(immediate)).run(actor)
namespace td {

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/utils/StorerBase.h"
#include "td/utils/common.h"

View File

@ -1,3 +1,4 @@
#pragma once
#cmakedefine01 TD_HAVE_OPENSSL
#cmakedefine01 TD_HAVE_ZLIB

View File

@ -125,8 +125,8 @@ void invoke_tuple_impl(std::tuple<Args...> &&tuple, IntSeq<S...>) {
invoke(std::forward<Args>(std::get<S>(tuple))...);
}
template <class Actor, class F, class... Args, std::size_t... S>
void mem_call_tuple_impl(Actor *actor, F &func, std::tuple<Args...> &&tuple, IntSeq<S...>) {
template <class ActorT, class F, class... Args, std::size_t... S>
void mem_call_tuple_impl(ActorT *actor, F &func, std::tuple<Args...> &&tuple, IntSeq<S...>) {
(actor->*func)(std::forward<Args>(std::get<S>(tuple))...);
}
@ -160,8 +160,8 @@ void invoke_tuple(std::tuple<Args...> &&tuple) {
detail::invoke_tuple_impl(std::move(tuple), detail::IntRange<sizeof...(Args)>());
}
template <class Actor, class F, class... Args>
void mem_call_tuple(Actor *actor, F &func, std::tuple<Args...> &&tuple) {
template <class ActorT, class F, class... Args>
void mem_call_tuple(ActorT *actor, F &func, std::tuple<Args...> &&tuple) {
detail::mem_call_tuple_impl(actor, func, std::move(tuple), detail::IntRange<sizeof...(Args)>());
}

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/utils/port/config.h"
#ifdef TD_THREAD_PTHREAD

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/utils/port/config.h"
#ifdef TD_THREAD_STL

View File

@ -5,11 +5,15 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/utils/common.h"
namespace td {
extern const char *thumbnail;
extern const size_t thumbnail_size;
extern const char *gzip_bomb;
extern const size_t gzip_bomb_size;
} // namespace td

View File

@ -11,6 +11,8 @@
#include "td/db/SqliteKeyValueSafe.h"
#include "td/db/TsSeqKeyValue.h"
#include "td/actor/actor.h"
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/port/FileFd.h"

View File

@ -4,6 +4,7 @@
// 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)
//
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/db/binlog/detail/BinlogEventsProcessor.h"

View File

@ -6,6 +6,7 @@
//
#include "data.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/ClientActor.h"