veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altintegration::VbkCommandGroupStore Struct Reference

A wrapper for the payload store that constructs command objects. More...

Detailed Description

Definition at line 23 of file vbk_command_group_store.hpp.

#include <vbk_command_group_store.hpp>

+ Collaboration diagram for altintegration::VbkCommandGroupStore:

Public Types

using command_groups_t = std::vector< std::unique_ptr< CommandGroup > >
 

Public Member Functions

 VbkCommandGroupStore (VbkBlockTree &tree, PayloadsStorage &payloadStore)
 
std::unique_ptr< CommandGroup > getCommand (const BlockIndex< VbkBlock > &block, const VTB::id_t &id, ValidationState &state)
 Get the command group for the given payload in the given block. More...
 
std::unique_ptr< command_groups_t > getCommands (const BlockIndex< VbkBlock > &block, ValidationState &state)
 Get command groups for a particular block. More...
 

Member Typedef Documentation

◆ command_groups_t

using altintegration::VbkCommandGroupStore::command_groups_t = std::vector<std::unique_ptr<CommandGroup> >

Definition at line 24 of file vbk_command_group_store.hpp.

Constructor & Destructor Documentation

◆ VbkCommandGroupStore()

altintegration::VbkCommandGroupStore::VbkCommandGroupStore ( VbkBlockTree tree,
PayloadsStorage payloadStore 
)
inline

Definition at line 26 of file vbk_command_group_store.hpp.

27 : _tree(tree), _payloadStore(payloadStore) {}

Member Function Documentation

◆ getCommand()

std::unique_ptr< CommandGroup > altintegration::VbkCommandGroupStore::getCommand ( const BlockIndex< VbkBlock > &  block,
const VTB::id_t id,
ValidationState state 
)
Parameters
[in]blockload from this block
[in]idthe id of the payload
[out]statewill be set to Error if the payload fails to validate
Returns
a reference to the requested command group that is valid until the next getCommand(s) call or null if the payload fails to validate

◆ getCommands()

std::unique_ptr< command_groups_t > altintegration::VbkCommandGroupStore::getCommands ( const BlockIndex< VbkBlock > &  block,
ValidationState state 
)
Parameters
[in]blockload from this block
[out]statewill be set to Error if one of the payloads fails to validate
Returns
a vector of references to commands that are valid until the next getCommand(s) call or null if one or more payloads fails to validate

The documentation for this struct was generated from the following file: