rippled
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ripple::BookOfferCrossingStep< TIn, TOut > Class Template Reference
Inheritance diagram for ripple::BookOfferCrossingStep< TIn, TOut >:
Inheritance graph
[legend]
Collaboration diagram for ripple::BookOfferCrossingStep< TIn, TOut >:
Collaboration graph
[legend]

Public Member Functions

 BookOfferCrossingStep (StrandContext const &ctx, Issue const &in, Issue const &out)
 
template<template< typename, typename > typename Offer>
bool limitSelfCrossQuality (AccountID const &strandSrc, AccountID const &strandDst, Offer< TIn, TOut > const &offer, std::optional< Quality > &ofrQ, FlowOfferStream< TIn, TOut > &offers, bool const offerAttempted) const
 
bool checkQualityThreshold (Quality const &quality) const
 
std::optional< Quality > qualityThreshold (Quality const &lobQuality) const
 
std::uint32_t getOfrInRate (Step const *prevStep, AccountID const &owner, std::uint32_t trIn) const
 
std::uint32_t getOfrOutRate (Step const *prevStep, AccountID const &owner, AccountID const &strandDst, std::uint32_t trOut) const
 
Quality adjustQualityWithFees (ReadView const &v, Quality const &ofrQ, DebtDirection prevStepDir, WaiveTransferFee waiveFee, OfferType offerType, Rules const &rules) const
 
std::string logString () const override
 
Book const & book () const
 
std::optional< EitherAmountcachedIn () const override
 
std::optional< EitherAmountcachedOut () const override
 
DebtDirection debtDirection (ReadView const &sb, StrandDirection dir) const override
 
std::optional< BookbookStepBook () const override
 
std::pair< std::optional< Quality >, DebtDirectionqualityUpperBound (ReadView const &v, DebtDirection prevStepDir) const override
 
std::pair< std::optional< QualityFunction >, DebtDirectiongetQualityFunc (ReadView const &v, DebtDirection prevStepDir) const override
 
std::uint32_t offersUsed () const override
 
std::pair< TIn, TOut > revImp (PaymentSandbox &sb, ApplyView &afView, boost::container::flat_set< uint256 > &ofrsToRm, TOut const &out)
 
std::pair< TIn, TOut > fwdImp (PaymentSandbox &sb, ApplyView &afView, boost::container::flat_set< uint256 > &ofrsToRm, TIn const &in)
 
std::pair< bool, EitherAmountvalidFwd (PaymentSandbox &sb, ApplyView &afView, EitherAmount const &in) override
 
TER check (StrandContext const &ctx) const
 
bool inactive () const override
 

Protected Types

enum  OfferType
 

Protected Member Functions

std::string logStringImpl (char const *name) const
 

Protected Attributes

Book book_
 
AccountID strandSrc_
 
AccountID strandDst_
 
Step const *const prevStep_
 
bool const ownerPaysTransferFee_
 
bool inactive_
 
std::uint32_t offersUsed_
 Number of offers consumed or partially consumed the last time the step ran, including expired and unfunded offers.
 
std::optional< AMMLiquidity< TIn, TOut > > ammLiquidity_
 
beast::Journal const j_
 
std::optional< Cache > cache_
 

Static Protected Attributes

static constexpr uint32_t MaxOffersToConsume
 

Private Member Functions

bool equal (Step const &rhs) const override
 
std::pair< boost::container::flat_set< uint256 >, std::uint32_tforEachOffer (PaymentSandbox &sb, ApplyView &afView, DebtDirection prevStepDebtDir, Callback &callback) const
 
void consumeOffer (PaymentSandbox &sb, Offer< TIn, TOut > &offer, TAmounts< TIn, TOut > const &ofrAmt, TAmounts< TIn, TOut > const &stepAmt, TOut const &ownerGives) const
 
std::optional< AMMOffer< TIn, TOut > > getAMMOffer (ReadView const &view, std::optional< Quality > const &clobQuality) const
 
std::optional< std::variant< Quality, AMMOffer< TIn, TOut > > > tip (ReadView const &view) const
 
std::optional< std::pair< Quality, OfferType > > tipOfferQuality (ReadView const &view) const
 
std::optional< QualityFunctiontipOfferQualityF (ReadView const &view) const
 

Static Private Member Functions

static Quality getQuality (std::optional< Quality > const &limitQuality)
 

Private Attributes

bool const defaultPath_
 
Quality const qualityThreshold_
 

Detailed Description

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

Definition at line 342 of file BookStep.cpp.

Member Enumeration Documentation

◆ OfferType

enum ripple::BookStep::OfferType
strongprotectedinherited

Definition at line 29 of file BookStep.cpp.

Constructor & Destructor Documentation

◆ BookOfferCrossingStep()

template<class TIn , class TOut >
ripple::BookOfferCrossingStep< TIn, TOut >::BookOfferCrossingStep ( StrandContext const &  ctx,
Issue const &  in,
Issue const &  out 
)

Definition at line 366 of file BookStep.cpp.

Member Function Documentation

◆ getQuality()

template<class TIn , class TOut >
static Quality ripple::BookOfferCrossingStep< TIn, TOut >::getQuality ( std::optional< Quality > const &  limitQuality)
staticprivate

Definition at line 354 of file BookStep.cpp.

◆ limitSelfCrossQuality()

template<class TIn , class TOut >
template<template< typename, typename > typename Offer>
bool ripple::BookOfferCrossingStep< TIn, TOut >::limitSelfCrossQuality ( AccountID const &  strandSrc,
AccountID const &  strandDst,
Offer< TIn, TOut > const &  offer,
std::optional< Quality > &  ofrQ,
FlowOfferStream< TIn, TOut > &  offers,
bool const  offerAttempted 
) const

Definition at line 378 of file BookStep.cpp.

◆ checkQualityThreshold()

template<class TIn , class TOut >
bool ripple::BookOfferCrossingStep< TIn, TOut >::checkQualityThreshold ( Quality const &  quality) const

Definition at line 436 of file BookStep.cpp.

◆ qualityThreshold()

template<class TIn , class TOut >
std::optional< Quality > ripple::BookOfferCrossingStep< TIn, TOut >::qualityThreshold ( Quality const &  lobQuality) const

Definition at line 452 of file BookStep.cpp.

◆ getOfrInRate()

template<class TIn , class TOut >
std::uint32_t ripple::BookOfferCrossingStep< TIn, TOut >::getOfrInRate ( Step const *  prevStep,
AccountID const &  owner,
std::uint32_t  trIn 
) const

Definition at line 463 of file BookStep.cpp.

◆ getOfrOutRate()

template<class TIn , class TOut >
std::uint32_t ripple::BookOfferCrossingStep< TIn, TOut >::getOfrOutRate ( Step const *  prevStep,
AccountID const &  owner,
AccountID const &  strandDst,
std::uint32_t  trOut 
) const

Definition at line 478 of file BookStep.cpp.

◆ adjustQualityWithFees()

template<class TIn , class TOut >
Quality ripple::BookOfferCrossingStep< TIn, TOut >::adjustQualityWithFees ( ReadView const &  v,
Quality const &  ofrQ,
DebtDirection  prevStepDir,
WaiveTransferFee  waiveFee,
OfferType  offerType,
Rules const &  rules 
) const

Definition at line 492 of file BookStep.cpp.

◆ logString()

template<class TIn , class TOut >
std::string ripple::BookOfferCrossingStep< TIn, TOut >::logString ( ) const
override

Definition at line 533 of file BookStep.cpp.

◆ book()

Book const & ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::book ( ) const
inherited

Definition at line 88 of file BookStep.cpp.

◆ cachedIn()

std::optional< EitherAmount > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::cachedIn ( ) const
overrideinherited

Definition at line 94 of file BookStep.cpp.

◆ cachedOut()

std::optional< EitherAmount > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::cachedOut ( ) const
overrideinherited

Definition at line 102 of file BookStep.cpp.

◆ debtDirection()

DebtDirection ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::debtDirection ( ReadView const &  sb,
StrandDirection  dir 
) const
overrideinherited

Definition at line 110 of file BookStep.cpp.

◆ bookStepBook()

std::optional< Book > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::bookStepBook ( ) const
overrideinherited

Definition at line 117 of file BookStep.cpp.

◆ qualityUpperBound()

std::pair< std::optional< Quality >, DebtDirection > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::qualityUpperBound ( ReadView const &  v,
DebtDirection  prevStepDir 
) const
overrideinherited

Definition at line 123 of file BookStep.cpp.

◆ getQualityFunc()

std::pair< std::optional< QualityFunction >, DebtDirection > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::getQualityFunc ( ReadView const &  v,
DebtDirection  prevStepDir 
) const
overrideinherited

Definition at line 127 of file BookStep.cpp.

◆ offersUsed()

std::uint32_t ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::offersUsed ( ) const
overrideinherited

Definition at line 130 of file BookStep.cpp.

◆ revImp()

std::pair< TIn, TOut > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::revImp ( PaymentSandbox sb,
ApplyView afView,
boost::container::flat_set< uint256 > &  ofrsToRm,
TOut const &  out 
)
inherited

Definition at line 133 of file BookStep.cpp.

◆ fwdImp()

std::pair< TIn, TOut > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::fwdImp ( PaymentSandbox sb,
ApplyView afView,
boost::container::flat_set< uint256 > &  ofrsToRm,
TIn const &  in 
)
inherited

Definition at line 140 of file BookStep.cpp.

◆ validFwd()

std::pair< bool, EitherAmount > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::validFwd ( PaymentSandbox sb,
ApplyView afView,
EitherAmount const &  in 
)
overrideinherited

Definition at line 147 of file BookStep.cpp.

◆ check()

TER ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::check ( StrandContext const &  ctx) const
inherited

Definition at line 152 of file BookStep.cpp.

◆ inactive()

bool ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::inactive ( ) const
overrideinherited

Definition at line 155 of file BookStep.cpp.

◆ logStringImpl()

std::string ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::logStringImpl ( char const *  name) const
protectedinherited

Definition at line 162 of file BookStep.cpp.

◆ equal()

bool ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::equal ( Step const &  rhs) const
overrideprivateinherited

Definition at line 187 of file BookStep.cpp.

◆ forEachOffer()

std::pair< boost::container::flat_set< uint256 >, std::uint32_t > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::forEachOffer ( PaymentSandbox sb,
ApplyView afView,
DebtDirection  prevStepDebtDir,
Callback &  callback 
) const
privateinherited

Definition at line 196 of file BookStep.cpp.

◆ consumeOffer()

void ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::consumeOffer ( PaymentSandbox sb,
Offer< TIn, TOut > &  offer,
TAmounts< TIn, TOut > const &  ofrAmt,
TAmounts< TIn, TOut > const &  stepAmt,
TOut const &  ownerGives 
) const
privateinherited

Definition at line 205 of file BookStep.cpp.

◆ getAMMOffer()

std::optional< AMMOffer< TIn, TOut > > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::getAMMOffer ( ReadView const &  view,
std::optional< Quality > const &  clobQuality 
) const
privateinherited

Definition at line 216 of file BookStep.cpp.

◆ tip()

std::optional< std::variant< Quality, AMMOffer< TIn, TOut > > > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::tip ( ReadView const &  view) const
privateinherited

Definition at line 222 of file BookStep.cpp.

◆ tipOfferQuality()

auto ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::tipOfferQuality ( ReadView const &  view) const
privateinherited

Definition at line 227 of file BookStep.cpp.

◆ tipOfferQualityF()

std::optional< QualityFunction > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::tipOfferQualityF ( ReadView const &  view) const
privateinherited

Definition at line 231 of file BookStep.cpp.

Member Data Documentation

◆ defaultPath_

template<class TIn , class TOut >
bool const ripple::BookOfferCrossingStep< TIn, TOut >::defaultPath_
private

Definition at line 539 of file BookStep.cpp.

◆ qualityThreshold_

template<class TIn , class TOut >
Quality const ripple::BookOfferCrossingStep< TIn, TOut >::qualityThreshold_
private

Definition at line 540 of file BookStep.cpp.

◆ MaxOffersToConsume

constexpr uint32_t ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::MaxOffersToConsume
staticconstexprprotectedinherited

Definition at line 31 of file BookStep.cpp.

◆ book_

Book ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::book_
protectedinherited

Definition at line 32 of file BookStep.cpp.

◆ strandSrc_

AccountID ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::strandSrc_
protectedinherited

Definition at line 33 of file BookStep.cpp.

◆ strandDst_

AccountID ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::strandDst_
protectedinherited

Definition at line 34 of file BookStep.cpp.

◆ prevStep_

Step const* const ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::prevStep_
protectedinherited

Definition at line 36 of file BookStep.cpp.

◆ ownerPaysTransferFee_

bool const ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::ownerPaysTransferFee_
protectedinherited

Definition at line 37 of file BookStep.cpp.

◆ inactive_

bool ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::inactive_
protectedinherited

Definition at line 39 of file BookStep.cpp.

◆ offersUsed_

std::uint32_t ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::offersUsed_
protectedinherited

Number of offers consumed or partially consumed the last time the step ran, including expired and unfunded offers.

N.B. This this not the total number offers consumed by this step for the entire payment, it is only the number the last time it ran. Offers may be partially consumed multiple times during a payment.

Definition at line 47 of file BookStep.cpp.

◆ ammLiquidity_

std::optional<AMMLiquidity<TIn, TOut> > ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::ammLiquidity_
protectedinherited

Definition at line 51 of file BookStep.cpp.

◆ j_

beast::Journal const ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::j_
protectedinherited

Definition at line 52 of file BookStep.cpp.

◆ cache_

std::optional<Cache> ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::cache_
protectedinherited

Definition at line 64 of file BookStep.cpp.