aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/actors/helpers/activeactors.h
diff options
context:
space:
mode:
authorAndrey Fomichev <andrey.fomichev@gmail.com>2022-02-10 16:49:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:15 +0300
commit1c61afbf3db63940d05e6fefa3104b03457788a1 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/actors/helpers/activeactors.h
parente542cc14db4240643a06bb0dde87ecf361f101ab (diff)
downloadydb-1c61afbf3db63940d05e6fefa3104b03457788a1.tar.gz
Restoring authorship annotation for Andrey Fomichev <andrey.fomichev@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/actors/helpers/activeactors.h')
-rw-r--r--library/cpp/actors/helpers/activeactors.h64
1 files changed, 32 insertions, 32 deletions
diff --git a/library/cpp/actors/helpers/activeactors.h b/library/cpp/actors/helpers/activeactors.h
index 43ad640dd6..0fdb0fab10 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
-
+