Kagome
Polkadot Runtime Engine in C++17
storage_changes_tracker_impl.hpp
Go to the documentation of this file.
1 #ifndef KAGOME_STORAGE_CHANGES_TRIE_STORAGE_CHANGES_TRACKER_IMPL
2 #define KAGOME_STORAGE_CHANGES_TRIE_STORAGE_CHANGES_TRACKER_IMPL
3 
5 
6 #include "log/logger.hpp"
8 
10 
12  public:
14  storage_subscription_engine,
16  chain_subscription_engine);
17 
18  ~StorageChangesTrackerImpl() override = default;
19 
20  void onBlockExecutionStart(primitives::BlockHash new_parent_hash) override;
21 
22  void onPut(const common::BufferView &key,
23  const common::BufferView &value,
24  bool new_entry) override;
25  void onBlockAdded(const primitives::BlockHash &hash) override;
26  void onRemove(const common::BufferView &key) override;
27 
28  private:
29  std::set<common::Buffer, std::less<>>
30  new_entries_; // entries that do not yet exist in
31  // the underlying storage
32  std::map<common::Buffer, std::optional<common::Buffer>, std::less<>>
34 
40  };
41 
42 } // namespace kagome::storage::changes_trie
43 
44 #endif // KAGOME_STORAGE_CHANGES_TRIE_STORAGE_CHANGES_TRACKER_IMPL
void onPut(const common::BufferView &key, const common::BufferView &value, bool new_entry) override
primitives::events::ChainSubscriptionEnginePtr chain_subscription_engine_
std::shared_ptr< StorageSubscriptionEngine > StorageSubscriptionEnginePtr
void onBlockAdded(const primitives::BlockHash &hash) override
std::map< common::Buffer, std::optional< common::Buffer >, std::less<> > actual_val_
std::shared_ptr< ChainSubscriptionEngine > ChainSubscriptionEnginePtr
std::shared_ptr< soralog::Logger > Logger
Definition: logger.hpp:23
primitives::events::StorageSubscriptionEnginePtr storage_subscription_engine_
void onBlockExecutionStart(primitives::BlockHash new_parent_hash) override
StorageChangesTrackerImpl(primitives::events::StorageSubscriptionEnginePtr storage_subscription_engine, primitives::events::ChainSubscriptionEnginePtr chain_subscription_engine)