OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::locking_shard::status_interface Class Referenceabstract

Interface for querying the read-only state of a locking shard. More...

#include <status_interface.hpp>

Inheritance diagram for cbdc::locking_shard::status_interface:

Public Member Functions

 status_interface ()=default
 
virtual ~status_interface ()=default
 
 status_interface (const status_interface &)=default
 
auto operator= (const status_interface &) -> status_interface &=default
 
 status_interface (status_interface &&)=default
 
auto operator= (status_interface &&) -> status_interface &=default
 
virtual auto check_unspent (const hash_t &uhs_id) -> std::optional< bool >=0
 Queries whether the shard's UHS contains the given UHS ID.
 
virtual auto check_tx_id (const hash_t &tx_id) -> std::optional< bool >=0
 Queries whether the given TX ID is confirmed in the cache of recently confirmed TX IDs.
 

Detailed Description

Interface for querying the read-only state of a locking shard.

Returns whether a given UHS ID is currently unspent or a TX ID has been confirmed.

Definition at line 18 of file status_interface.hpp.

Constructor & Destructor Documentation

◆ status_interface() [1/3]

cbdc::locking_shard::status_interface::status_interface ( )
default

◆ ~status_interface()

virtual cbdc::locking_shard::status_interface::~status_interface ( )
virtualdefault

◆ status_interface() [2/3]

cbdc::locking_shard::status_interface::status_interface ( const status_interface & )
default

◆ status_interface() [3/3]

cbdc::locking_shard::status_interface::status_interface ( status_interface && )
default

Member Function Documentation

◆ check_tx_id()

virtual auto cbdc::locking_shard::status_interface::check_tx_id ( const hash_t & tx_id) -> std::optional< bool >
nodiscardpure virtual

Queries whether the given TX ID is confirmed in the cache of recently confirmed TX IDs.

Parameters
tx_idTX ID to query.
Returns
true if the TX ID is present in the cache, or std::nullopt if the query failed.

Implemented in cbdc::locking_shard::locking_shard, and cbdc::locking_shard::rpc::status_client.

◆ check_unspent()

virtual auto cbdc::locking_shard::status_interface::check_unspent ( const hash_t & uhs_id) -> std::optional< bool >
nodiscardpure virtual

Queries whether the shard's UHS contains the given UHS ID.

Parameters
uhs_idUHS ID to query.
Returns
true if the UHS ID is unspent, or std::nullopt if the query failed.

Implemented in cbdc::locking_shard::locking_shard, and cbdc::locking_shard::rpc::status_client.

◆ operator=() [1/2]

auto cbdc::locking_shard::status_interface::operator= ( const status_interface & ) -> status_interface &=default
default

◆ operator=() [2/2]

auto cbdc::locking_shard::status_interface::operator= ( status_interface && ) -> status_interface &=default
default

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