Payloads index that stores mapping "payload id -> set of containing blocks" from all NON-FINALIZED blocks.
More...
template<typename IndexT>
struct altintegration::PayloadsIndex< IndexT >
- Note
- KV in this index should be removed BEFORE block is finalized.
Definition at line 63 of file payloads_index.hpp.
#include <payloads_index.hpp>
|
void | addBlock (const index_t &block) |
|
void | removeBlock (const index_t &block) |
|
void | add (const payload_id &id, const hash_t &block) |
|
void | remove (const payload_id &id, const hash_t &block) |
|
const std::set< hash_t > & | find (const payload_id &id) const |
|
const std::unordered_map< payload_id, std::set< hash_t > > & | getAll () const |
|
◆ hash_t
template<typename IndexT >
◆ index_t
template<typename IndexT >
◆ payload_id
template<typename IndexT >
◆ add()
template<typename IndexT >
◆ addBlock()
template<typename IndexT >
Definition at line 68 of file payloads_index.hpp.
68 {
69
70 VBK_ASSERT_MSG(!block.finalized, block.toPrettyString());
71 detail::PLIAddBlock(*this, block);
72 }
◆ find()
template<typename IndexT >
Definition at line 102 of file payloads_index.hpp.
102 {
103 static std::set<hash_t> empty;
104 auto it = map_.find(id);
105 if (it == map_.end()) {
106 return empty;
107 }
108
109 return it->second;
110 }
◆ getAll()
template<typename IndexT >
◆ remove()
template<typename IndexT >
Definition at line 85 of file payloads_index.hpp.
85 {
86 auto it = map_.find(id);
87 if (it == map_.end()) {
88
89 return;
90 }
91
92 auto& set = it->second;
93 size_t erased = set.erase(block);
94
95 if (set.empty()) {
96
97 erased = map_.erase(id);
98 VBK_ASSERT(erased == 1);
99 }
100 }
◆ removeBlock()
template<typename IndexT >
Definition at line 74 of file payloads_index.hpp.
74 {
75
76
77
78 detail::PLIRemoveBlock(*this, block);
79 }
The documentation for this struct was generated from the following file: