diff options
author | Andrey Fomichev <andrey.fomichev@gmail.com> | 2022-02-10 16:49:12 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:12 +0300 |
commit | e542cc14db4240643a06bb0dde87ecf361f101ab (patch) | |
tree | 3b03a4b94acd11a4eca042532035806e5fa08ad1 /library/cpp/actors/helpers/activeactors.h | |
parent | e2ac73225f30f7fcf7df3cb225cba257f56144c1 (diff) | |
download | ydb-e542cc14db4240643a06bb0dde87ecf361f101ab.tar.gz |
Restoring authorship annotation for Andrey Fomichev <andrey.fomichev@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/actors/helpers/activeactors.h')
-rw-r--r-- | library/cpp/actors/helpers/activeactors.h | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/library/cpp/actors/helpers/activeactors.h b/library/cpp/actors/helpers/activeactors.h index 0fdb0fab10..43ad640dd6 100644 --- a/library/cpp/actors/helpers/activeactors.h +++ b/library/cpp/actors/helpers/activeactors.h @@ -2,41 +2,41 @@ #include <library/cpp/actors/core/actor.h> #include <library/cpp/actors/core/events.h> -#include <util/generic/hash_set.h> +#include <util/generic/hash_set.h> -namespace NActors { +namespace NActors { - //////////////////////////////////////////////////////////////////////////// - // TActiveActors - // This class helps manage created actors and kill them all on PoisonPill. - //////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////// + // TActiveActors + // This class helps manage created actors and kill them all on PoisonPill. + //////////////////////////////////////////////////////////////////////////// class TActiveActors : public THashSet<TActorId> { - public: + public: void Insert(const TActorId &aid) { - bool inserted = insert(aid).second; - Y_VERIFY(inserted); - } - - void Insert(const TActiveActors &moreActors) { - for (const auto &aid : moreActors) { - Insert(aid); - } - } - + bool inserted = insert(aid).second; + Y_VERIFY(inserted); + } + + void Insert(const TActiveActors &moreActors) { + for (const auto &aid : moreActors) { + Insert(aid); + } + } + void Erase(const TActorId &aid) { - auto num = erase(aid); - Y_VERIFY(num == 1); - } - - size_t KillAndClear(const TActorContext &ctx) { - size_t s = size(); // number of actors managed - for (const auto &x: *this) { - ctx.Send(x, new TEvents::TEvPoisonPill()); - } - clear(); - return s; // how many actors we killed - } - }; - + auto num = erase(aid); + Y_VERIFY(num == 1); + } + + size_t KillAndClear(const TActorContext &ctx) { + size_t s = size(); // number of actors managed + for (const auto &x: *this) { + ctx.Send(x, new TEvents::TEvPoisonPill()); + } + clear(); + return s; // how many actors we killed + } + }; + } // NKikimr - + |