rippled
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
ripple::RCLTxSet Class Reference

Represents a set of transactions in RCLConsensus. More...

Collaboration diagram for ripple::RCLTxSet:
Collaboration graph
[legend]

Classes

class  MutableTxSet
 

Public Types

using ID = uint256
 Unique identifier/hash of the set of transactions. More...
 
using Tx = RCLCxTx
 The type that corresponds to a single transaction. More...
 

Public Member Functions

 RCLTxSet (std::shared_ptr< SHAMap > m)
 Constructor. More...
 
 RCLTxSet (MutableTxSet const &m)
 Constructor from a previously created MutableTxSet. More...
 
bool exists (Tx::ID const &entry) const
 Test if a transaction is in the set. More...
 
boost::intrusive_ptr< SHAMapItem const > const & find (Tx::ID const &entry) const
 Lookup a transaction. More...
 
ID id () const
 The unique ID/hash of the transaction set. More...
 
std::map< Tx::ID, bool > compare (RCLTxSet const &j) const
 Find transactions not in common between this and another transaction set. More...
 

Public Attributes

std::shared_ptr< SHAMapmap_
 The SHAMap representing the transactions. More...
 

Detailed Description

Represents a set of transactions in RCLConsensus.

RCLTxSet is a thin wrapper over a SHAMap that stores the set of transactions.

Definition at line 65 of file RCLCxTx.h.

Member Typedef Documentation

◆ ID

Unique identifier/hash of the set of transactions.

Definition at line 69 of file RCLCxTx.h.

◆ Tx

The type that corresponds to a single transaction.

Definition at line 71 of file RCLCxTx.h.

Constructor & Destructor Documentation

◆ RCLTxSet() [1/2]

ripple::RCLTxSet::RCLTxSet ( std::shared_ptr< SHAMap m)

Constructor.

Parameters
mSHAMap to wrap

Definition at line 112 of file RCLCxTx.h.

◆ RCLTxSet() [2/2]

ripple::RCLTxSet::RCLTxSet ( MutableTxSet const &  m)

Constructor from a previously created MutableTxSet.

Parameters
mMutableTxSet that will become fixed

Definition at line 121 of file RCLCxTx.h.

Member Function Documentation

◆ exists()

bool ripple::RCLTxSet::exists ( Tx::ID const &  entry) const

Test if a transaction is in the set.

Parameters
entryThe ID of transaction to test.
Returns
Whether the transaction is in the set.

Definition at line 131 of file RCLCxTx.h.

◆ find()

boost::intrusive_ptr<SHAMapItem const> const& ripple::RCLTxSet::find ( Tx::ID const &  entry) const

Lookup a transaction.

Parameters
entryThe ID of the transaction to find.
Returns
A shared pointer to the SHAMapItem.
Note
Since find may not succeed, this returns a std::shared_ptr<const SHAMapItem> rather than a Tx, which cannot refer to a missing transaction. The generic consensus code uses the shared_ptr semantics to know whether the find was successful and properly creates a Tx as needed.

Definition at line 148 of file RCLCxTx.h.

◆ id()

ID ripple::RCLTxSet::id ( ) const

The unique ID/hash of the transaction set.

Definition at line 155 of file RCLCxTx.h.

◆ compare()

std::map<Tx::ID, bool> ripple::RCLTxSet::compare ( RCLTxSet const &  j) const

Find transactions not in common between this and another transaction set.

Parameters
jThe set to compare with
Returns
Map of transactions in this set and j but not both. The key is the transaction ID and the value is a bool of the transaction exists in this set.

Definition at line 169 of file RCLCxTx.h.

Member Data Documentation

◆ map_

std::shared_ptr<SHAMap> ripple::RCLTxSet::map_

The SHAMap representing the transactions.

Definition at line 188 of file RCLCxTx.h.