aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/storage.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/messagebus/storage.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/messagebus/storage.h')
-rw-r--r--library/cpp/messagebus/storage.h114
1 files changed, 57 insertions, 57 deletions
diff --git a/library/cpp/messagebus/storage.h b/library/cpp/messagebus/storage.h
index 7d168844ed..694ea2fcfe 100644
--- a/library/cpp/messagebus/storage.h
+++ b/library/cpp/messagebus/storage.h
@@ -10,85 +10,85 @@
#include <util/generic/noncopyable.h>
#include <util/generic/utility.h>
-namespace NBus {
- namespace NPrivate {
- typedef TVector<TBusMessage*> TMessagesPtrs;
+namespace NBus {
+ namespace NPrivate {
+ typedef TVector<TBusMessage*> TMessagesPtrs;
- class TTimedMessages {
- public:
- TTimedMessages();
- ~TTimedMessages();
+ class TTimedMessages {
+ public:
+ TTimedMessages();
+ ~TTimedMessages();
- struct TItem {
- THolder<TBusMessage> Message;
+ struct TItem {
+ THolder<TBusMessage> Message;
- void Swap(TItem& that) {
- DoSwap(Message, that.Message);
- }
- };
+ void Swap(TItem& that) {
+ DoSwap(Message, that.Message);
+ }
+ };
- typedef TDeque<TMoved<TItem>> TItems;
+ typedef TDeque<TMoved<TItem>> TItems;
- void PushBack(TNonDestroyingAutoPtr<TBusMessage> m);
- TNonDestroyingAutoPtr<TBusMessage> PopFront();
- bool Empty() const;
- size_t Size() const;
+ void PushBack(TNonDestroyingAutoPtr<TBusMessage> m);
+ TNonDestroyingAutoPtr<TBusMessage> PopFront();
+ bool Empty() const;
+ size_t Size() const;
- void Timeout(TInstant before, TMessagesPtrs* r);
- void Clear(TMessagesPtrs* r);
+ void Timeout(TInstant before, TMessagesPtrs* r);
+ void Clear(TMessagesPtrs* r);
- private:
- TItems Items;
- };
+ private:
+ TItems Items;
+ };
- class TSyncAckMessages : TNonCopyable {
- public:
- TSyncAckMessages();
- ~TSyncAckMessages();
+ class TSyncAckMessages : TNonCopyable {
+ public:
+ TSyncAckMessages();
+ ~TSyncAckMessages();
- void Push(TBusMessagePtrAndHeader& m);
- TBusMessage* Pop(TBusKey id);
+ void Push(TBusMessagePtrAndHeader& m);
+ TBusMessage* Pop(TBusKey id);
- void Timeout(TInstant before, TMessagesPtrs* r);
+ void Timeout(TInstant before, TMessagesPtrs* r);
- void Clear(TMessagesPtrs* r);
+ void Clear(TMessagesPtrs* r);
- size_t Size() const {
- return KeyToMessage.size();
- }
+ size_t Size() const {
+ return KeyToMessage.size();
+ }
- void RemoveAll(const TMessagesPtrs&);
+ void RemoveAll(const TMessagesPtrs&);
- void Gc();
+ void Gc();
- void DumpState();
+ void DumpState();
- private:
- struct TTimedItem {
- TBusKey Key;
- TBusInstant SendTime;
- };
+ private:
+ struct TTimedItem {
+ TBusKey Key;
+ TBusInstant SendTime;
+ };
- typedef TDeque<TTimedItem> TTimedItems;
- typedef TDeque<TTimedItem>::iterator TTimedIterator;
+ typedef TDeque<TTimedItem> TTimedItems;
+ typedef TDeque<TTimedItem>::iterator TTimedIterator;
- TTimedItems TimedItems;
+ TTimedItems TimedItems;
- struct TValue {
- TBusMessage* Message;
- };
+ struct TValue {
+ TBusMessage* Message;
+ };
- // keys are already random, no need to hash them further
- struct TIdHash {
- size_t operator()(TBusKey value) const {
- return value;
- }
- };
+ // keys are already random, no need to hash them further
+ struct TIdHash {
+ size_t operator()(TBusKey value) const {
+ return value;
+ }
+ };
typedef google::dense_hash_map<TBusKey, TValue, TIdHash> TKeyToMessage;
- TKeyToMessage KeyToMessage;
+ TKeyToMessage KeyToMessage;
};
- }
-}
+ }
+}