Stores a mapping "payload id -> containing block" hash of payloads that are stored in finalized blocks.
More...
template<typename ContainerIndex>
struct altintegration::FinalizedPayloadsIndex< ContainerIndex >
- Invariant
- KV are never removed from this index.
Definition at line 17 of file payloads_index.hpp.
#include <payloads_index.hpp>
|
using | index_t = ContainerIndex |
|
using | hash_t = typename ContainerIndex::hash_t |
|
using | payload_id = std::vector< uint8_t > |
|
|
const hash_t * | find (const payload_id &pid) const |
|
bool | empty () const |
|
size_t | size () const |
|
void | add (const payload_id &pid, const hash_t &hash) |
|
void | remove (const payload_id &pid) |
|
void | addBlock (const index_t &block) |
|
const std::unordered_map< payload_id, hash_t > & | getAll () const |
|
◆ hash_t
template<typename ContainerIndex >
◆ index_t
template<typename ContainerIndex >
◆ payload_id
template<typename ContainerIndex >
◆ add()
template<typename ContainerIndex >
Definition at line 35 of file payloads_index.hpp.
35 {
36 auto it = map_.find(pid);
37 VBK_ASSERT(it == map_.end());
38 map_.insert(std::make_pair(pid, hash));
39 }
◆ addBlock()
template<typename ContainerIndex >
Definition at line 47 of file payloads_index.hpp.
47 {
48
49 VBK_ASSERT_MSG(block.finalized, block.toPrettyString());
50 detail::PLIAddBlock(*this, block);
51 }
◆ empty()
template<typename ContainerIndex >
◆ find()
template<typename ContainerIndex >
Definition at line 22 of file payloads_index.hpp.
22 {
23 auto it = map_.find(pid);
24 if (it == map_.end()) {
25 return nullptr;
26 }
27
28 return &it->second;
29 }
◆ getAll()
template<typename ContainerIndex >
◆ remove()
template<typename ContainerIndex >
Definition at line 41 of file payloads_index.hpp.
41 {
42 auto it = map_.find(pid);
43 VBK_ASSERT(it != map_.end());
44 map_.erase(pid);
45 }
◆ size()
template<typename ContainerIndex >
The documentation for this struct was generated from the following file: