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

Represents a ledger in RCLConsensus. More...

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

Public Types

using ID = LedgerHash
 Unique identifier of a ledger. More...
 
using Seq = LedgerIndex
 Sequence number of a ledger. More...
 

Public Member Functions

 RCLCxLedger ()=default
 Default constructor. More...
 
 RCLCxLedger (std::shared_ptr< Ledger const > const &l)
 Constructor. More...
 
Seq const & seq () const
 Sequence number of the ledger. More...
 
ID const & id () const
 Unique identifier (hash) of this ledger. More...
 
ID const & parentID () const
 Unique identifier (hash) of this ledger's parent. More...
 
NetClock::duration closeTimeResolution () const
 Resolution used when calculating this ledger's close time. More...
 
bool closeAgree () const
 Whether consensus process agreed on close time of the ledger. More...
 
NetClock::time_point closeTime () const
 The close time of this ledger. More...
 
NetClock::time_point parentCloseTime () const
 The close time of this ledger's parent. More...
 
Json::Value getJson () const
 JSON representation of this ledger. More...
 

Public Attributes

std::shared_ptr< Ledger const > ledger_
 The ledger instance. More...
 

Detailed Description

Represents a ledger in RCLConsensus.

RCLCxLedger is a thin wrapper over std::shared_ptr<Ledger const>.

Definition at line 35 of file RCLCxLedger.h.

Member Typedef Documentation

◆ ID

Unique identifier of a ledger.

Definition at line 39 of file RCLCxLedger.h.

◆ Seq

Sequence number of a ledger.

Definition at line 41 of file RCLCxLedger.h.

Constructor & Destructor Documentation

◆ RCLCxLedger() [1/2]

ripple::RCLCxLedger::RCLCxLedger ( )
default

Default constructor.

TODO: This may not be needed if we ensure RCLConsensus is handed a valid ledger in its constructor. Its bad now because other members are not checking whether the ledger is valid.

◆ RCLCxLedger() [2/2]

ripple::RCLCxLedger::RCLCxLedger ( std::shared_ptr< Ledger const > const &  l)

Constructor.

Parameters
lThe ledger to wrap.

Definition at line 55 of file RCLCxLedger.h.

Member Function Documentation

◆ seq()

Seq const& ripple::RCLCxLedger::seq ( ) const

Sequence number of the ledger.

Definition at line 61 of file RCLCxLedger.h.

◆ id()

ID const& ripple::RCLCxLedger::id ( ) const

Unique identifier (hash) of this ledger.

Definition at line 68 of file RCLCxLedger.h.

◆ parentID()

ID const& ripple::RCLCxLedger::parentID ( ) const

Unique identifier (hash) of this ledger's parent.

Definition at line 75 of file RCLCxLedger.h.

◆ closeTimeResolution()

NetClock::duration ripple::RCLCxLedger::closeTimeResolution ( ) const

Resolution used when calculating this ledger's close time.

Definition at line 82 of file RCLCxLedger.h.

◆ closeAgree()

bool ripple::RCLCxLedger::closeAgree ( ) const

Whether consensus process agreed on close time of the ledger.

Definition at line 89 of file RCLCxLedger.h.

◆ closeTime()

NetClock::time_point ripple::RCLCxLedger::closeTime ( ) const

The close time of this ledger.

Definition at line 96 of file RCLCxLedger.h.

◆ parentCloseTime()

NetClock::time_point ripple::RCLCxLedger::parentCloseTime ( ) const

The close time of this ledger's parent.

Definition at line 103 of file RCLCxLedger.h.

◆ getJson()

Json::Value ripple::RCLCxLedger::getJson ( ) const

JSON representation of this ledger.

Definition at line 110 of file RCLCxLedger.h.

Member Data Documentation

◆ ledger_

std::shared_ptr<Ledger const> ripple::RCLCxLedger::ledger_

The ledger instance.

TODO: Make this shared_ptr<ReadView const> .. requires ability to create a new ledger from a readView?

Definition at line 120 of file RCLCxLedger.h.