rippled
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
ripple::FlowOfferStream< TIn, TOut > Class Template Reference

Presents and consumes the offers in an order book. More...

Inheritance diagram for ripple::FlowOfferStream< TIn, TOut >:
Inheritance graph
[legend]
Collaboration diagram for ripple::FlowOfferStream< TIn, TOut >:
Collaboration graph
[legend]

Public Member Functions

void permRmOffer (uint256 const &offerIndex) override
 
boost::container::flat_set< uint256 > const & permToRemove () const
 
TOffer< TIn, TOut > & tip () const
 Returns the offer at the tip of the order book. More...
 
bool step ()
 Advance to the next valid offer. More...
 
TOut ownerFunds () const
 

Protected Member Functions

void erase (ApplyView &view)
 
template<class TTakerPays , class TTakerGets >
bool shouldRmSmallIncreasedQOffer () const
 

Protected Attributes

const beast::Journal j_
 
ApplyViewview_
 
ApplyViewcancelView_
 
Book book_
 
bool validBook_
 
const NetClock::time_point expire_
 
BookTip tip_
 
TOffer< TIn, TOut > offer_
 
std::optional< TOut > ownerFunds_
 
StepCountercounter_
 

Private Attributes

boost::container::flat_set< uint256permToRemove_
 

Detailed Description

template<class TIn, class TOut>
class ripple::FlowOfferStream< TIn, TOut >

Presents and consumes the offers in an order book.

The ‘view_’ ApplyViewaccumulates changes to the ledger. ThecancelView_` is used to determine if an offer is found unfunded or became unfunded. The permToRemove collection identifies offers that should be removed even if the strand associated with this OfferStream is not applied.

Certain invalid offers are added to the permToRemove collection:

Definition at line 175 of file OfferStream.h.

Member Function Documentation

◆ permRmOffer()

template<class TIn , class TOut >
void ripple::FlowOfferStream< TIn, TOut >::permRmOffer ( uint256 const &  offerIndex)
overridevirtual

Implements ripple::TOfferStreamBase< TIn, TOut >.

Definition at line 372 of file OfferStream.cpp.

◆ permToRemove()

template<class TIn , class TOut >
boost::container::flat_set<uint256> const& ripple::FlowOfferStream< TIn, TOut >::permToRemove ( ) const

Definition at line 191 of file OfferStream.h.

◆ erase()

template<class TIn , class TOut >
void ripple::TOfferStreamBase< TIn, TOut >::erase ( ApplyView view)
protectedinherited

Definition at line 61 of file OfferStream.cpp.

◆ shouldRmSmallIncreasedQOffer()

template<class TIn , class TOut >
template<class TTakerPays , class TTakerGets >
bool ripple::TOfferStreamBase< TIn, TOut >::shouldRmSmallIncreasedQOffer
protectedinherited

Definition at line 139 of file OfferStream.cpp.

◆ tip()

template<class TIn , class TOut >
TOffer<TIn, TOut>& ripple::TOfferStreamBase< TIn, TOut >::tip ( ) const
inherited

Returns the offer at the tip of the order book.

Offers are always presented in decreasing quality. Only valid if step() returned true.

Definition at line 108 of file OfferStream.h.

◆ step()

template<class TIn , class TOut >
bool ripple::TOfferStreamBase< TIn, TOut >::step
inherited

Advance to the next valid offer.

This automatically removes:

  • Offers with missing ledger entries
  • Offers found unfunded
  • expired offers
    Returns
    true if there is a valid offer.

Definition at line 205 of file OfferStream.cpp.

◆ ownerFunds()

template<class TIn , class TOut >
TOut ripple::TOfferStreamBase< TIn, TOut >::ownerFunds ( ) const
inherited

Definition at line 124 of file OfferStream.h.

Member Data Documentation

◆ permToRemove_

template<class TIn , class TOut >
boost::container::flat_set<uint256> ripple::FlowOfferStream< TIn, TOut >::permToRemove_
private

Definition at line 178 of file OfferStream.h.

◆ j_

template<class TIn , class TOut >
const beast::Journal ripple::TOfferStreamBase< TIn, TOut >::j_
protectedinherited

Definition at line 71 of file OfferStream.h.

◆ view_

template<class TIn , class TOut >
ApplyView& ripple::TOfferStreamBase< TIn, TOut >::view_
protectedinherited

Definition at line 72 of file OfferStream.h.

◆ cancelView_

template<class TIn , class TOut >
ApplyView& ripple::TOfferStreamBase< TIn, TOut >::cancelView_
protectedinherited

Definition at line 73 of file OfferStream.h.

◆ book_

template<class TIn , class TOut >
Book ripple::TOfferStreamBase< TIn, TOut >::book_
protectedinherited

Definition at line 74 of file OfferStream.h.

◆ validBook_

template<class TIn , class TOut >
bool ripple::TOfferStreamBase< TIn, TOut >::validBook_
protectedinherited

Definition at line 75 of file OfferStream.h.

◆ expire_

template<class TIn , class TOut >
const NetClock::time_point ripple::TOfferStreamBase< TIn, TOut >::expire_
protectedinherited

Definition at line 76 of file OfferStream.h.

◆ tip_

template<class TIn , class TOut >
BookTip ripple::TOfferStreamBase< TIn, TOut >::tip_
protectedinherited

Definition at line 77 of file OfferStream.h.

◆ offer_

template<class TIn , class TOut >
TOffer<TIn, TOut> ripple::TOfferStreamBase< TIn, TOut >::offer_
protectedinherited

Definition at line 78 of file OfferStream.h.

◆ ownerFunds_

template<class TIn , class TOut >
std::optional<TOut> ripple::TOfferStreamBase< TIn, TOut >::ownerFunds_
protectedinherited

Definition at line 79 of file OfferStream.h.

◆ counter_

template<class TIn , class TOut >
StepCounter& ripple::TOfferStreamBase< TIn, TOut >::counter_
protectedinherited

Definition at line 80 of file OfferStream.h.