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

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

Detailed Description

Definition at line 23 of file alt_command_group_store.hpp.

#include <alt_command_group_store.hpp>

+ Collaboration diagram for altintegration::AltCommandGroupStore:

Public Types

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

Public Member Functions

 AltCommandGroupStore (AltBlockTree &tree, PayloadsStorage &payloadStore)
 
template<typename Payload >
std::unique_ptr< CommandGroup > getCommand (const BlockIndex< AltBlock > &block, const typename Payload::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< AltBlock > &block, ValidationState &state)
 Get command groups for a particular block. More...
 

Member Typedef Documentation

◆ command_groups_t

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

Definition at line 24 of file alt_command_group_store.hpp.

Constructor & Destructor Documentation

◆ AltCommandGroupStore()

altintegration::AltCommandGroupStore::AltCommandGroupStore ( AltBlockTree tree,
PayloadsStorage payloadStore 
)
inline

Definition at line 26 of file alt_command_group_store.hpp.

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

Member Function Documentation

◆ getCommand()

template<typename Payload >
std::unique_ptr< CommandGroup > altintegration::AltCommandGroupStore::getCommand ( const BlockIndex< AltBlock > &  block,
const typename Payload::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::AltCommandGroupStore::getCommands ( const BlockIndex< AltBlock > &  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: