OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::sentinel::async_interface Class Referenceabstract

Interface for an asynchronous sentinel. More...

#include <async_interface.hpp>

Inheritance diagram for cbdc::sentinel::async_interface:

Public Types

using result_callback_type = std::function<void(std::optional<cbdc::sentinel::response>)>
 Callback function for a sentinel response.
 
using execute_result_callback_type
 Callback function for transaction execution result.
 
using validate_result = std::optional<cbdc::sentinel::validate_response>
 Result of a validation operation.
 
using validate_result_callback_type = std::function<void(validate_result)>
 Callback function for providing a transaction validation result.
 

Public Member Functions

virtual ~async_interface ()=default
 
 async_interface ()=default
 
 async_interface (const async_interface &)=delete
 
auto operator= (const async_interface &) -> async_interface &=delete
 
 async_interface (async_interface &&)=delete
 
auto operator= (async_interface &&) -> async_interface &=delete
 
virtual auto execute_transaction (transaction::full_tx tx, execute_result_callback_type result_callback) -> bool=0
 Validate transaction on the sentinel, forward it to the coordinator network, and return the execution result using a callback function.
 
virtual auto validate_transaction (transaction::full_tx tx, validate_result_callback_type result_callback) -> bool=0
 Statically validate the given transaction and generate a sentinel attestation if the transaction is valid.
 

Detailed Description

Interface for an asynchronous sentinel.

Definition at line 18 of file async_interface.hpp.

Member Typedef Documentation

◆ execute_result_callback_type

Initial value:
std::function<void(
std::optional<cbdc::sentinel::execute_response>)>

Callback function for transaction execution result.

Definition at line 32 of file async_interface.hpp.

◆ result_callback_type

Callback function for a sentinel response.

Definition at line 29 of file async_interface.hpp.

◆ validate_result

Result of a validation operation.

Sentinel attestation for the given transaction or std::nullopt if the transaction was invalid.

Definition at line 49 of file async_interface.hpp.

◆ validate_result_callback_type

Callback function for providing a transaction validation result.

Definition at line 51 of file async_interface.hpp.

Constructor & Destructor Documentation

◆ ~async_interface()

virtual cbdc::sentinel::async_interface::~async_interface ( )
virtualdefault

◆ async_interface() [1/3]

cbdc::sentinel::async_interface::async_interface ( )
default

◆ async_interface() [2/3]

cbdc::sentinel::async_interface::async_interface ( const async_interface & )
delete

◆ async_interface() [3/3]

cbdc::sentinel::async_interface::async_interface ( async_interface && )
delete

Member Function Documentation

◆ execute_transaction()

virtual auto cbdc::sentinel::async_interface::execute_transaction ( transaction::full_tx tx,
execute_result_callback_type result_callback ) -> bool
pure virtual

Validate transaction on the sentinel, forward it to the coordinator network, and return the execution result using a callback function.

Parameters
txtransaction to execute.
result_callbackfunction to call with execution result.
Returns
false if the implementation could not start processing the transaction.

Implemented in cbdc::sentinel::rpc::client, and cbdc::sentinel_2pc::controller.

Referenced by cbdc::sentinel::rpc::async_server::async_server().

◆ operator=() [1/2]

auto cbdc::sentinel::async_interface::operator= ( async_interface && ) -> async_interface &=delete
delete

◆ operator=() [2/2]

auto cbdc::sentinel::async_interface::operator= ( const async_interface & ) -> async_interface &=delete
delete

◆ validate_transaction()

virtual auto cbdc::sentinel::async_interface::validate_transaction ( transaction::full_tx tx,
validate_result_callback_type result_callback ) -> bool
pure virtual

Statically validate the given transaction and generate a sentinel attestation if the transaction is valid.

Parameters
txtransaction to validate and attest to.
result_callbackfunction to call with the validation result.
Returns
false if the implementation could not start validating the transaction.

Implemented in cbdc::sentinel_2pc::controller.

Referenced by cbdc::sentinel::rpc::async_server::async_server().


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