#pragma once #include "event.h" #include "scheduler_cookie.h" #include "event_load.h" #include namespace NActors { template class TEventLocal: public TEventBase { public: TString ToStringHeader() const override { return TypeName(); } bool SerializeToArcadiaStream(TChunkSerializer* /*serializer*/) const override { Y_ABORT("Serialization of local event %s type %" PRIu32, TypeName().data(), TEventType); } bool IsSerializable() const override { return false; } static IEventBase* Load(TEventSerializedData*) { Y_ABORT("Loading of local event %s type %" PRIu32, TypeName().data(), TEventType); } }; template class TEventScheduler: public TEventLocal { public: TSchedulerCookieHolder Cookie; TEventScheduler(ISchedulerCookie* cookie) : Cookie(cookie) { } }; template class TEventSchedulerEv: public TEventScheduler, TEventType> { public: TEventSchedulerEv(ISchedulerCookie* cookie) : TEventScheduler, TEventType>(cookie) { } }; template class TEventSimple: public TEventBase { public: TString ToStringHeader() const override { static TString header(TypeName()); return header; } bool SerializeToArcadiaStream(TChunkSerializer* /*serializer*/) const override { static_assert(sizeof(TEv) == sizeof(TEventSimple), "Descendant should be an empty class"); return true; } bool IsSerializable() const override { return true; } static IEventBase* Load(NActors::TEventSerializedData*) { return new TEv(); } static IEventBase* Load(const TString&) { return new TEv(); } }; }