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

Public Member Functions

 BookPaymentStep ()=default
 
template<template< typename, typename > typename Offer>
bool limitSelfCrossQuality (AccountID const &, AccountID const &, Offer< TIn, TOut > const &offer, std::optional< Quality > &, FlowOfferStream< TIn, TOut > &, bool) const
 
bool checkQualityThreshold (Quality const &quality) const
 
std::optional< Quality > qualityThreshold (Quality const &lobQuality) const
 
std::uint32_t getOfrInRate (Step const *, AccountID const &, std::uint32_t trIn) const
 
std::uint32_t getOfrOutRate (Step const *, AccountID const &, AccountID const &, std::uint32_t trOut) const
 
Quality adjustQualityWithFees (ReadView const &v, Quality const &ofrQ, DebtDirection prevStepDir, WaiveTransferFee waiveFee, OfferType, Rules const &) 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
 

Detailed Description

template<class TIn, class TOut>
class xrpl::BookPaymentStep< TIn, TOut >

Definition at line 226 of file BookStep.cpp.

Member Enumeration Documentation

◆ OfferType

enum xrpl::BookStep::OfferType
strongprotectedinherited

Definition at line 29 of file BookStep.cpp.

Constructor & Destructor Documentation

◆ BookPaymentStep()

template<class TIn , class TOut >
xrpl::BookPaymentStep< TIn, TOut >::BookPaymentStep ( )
explicitdefault

Member Function Documentation

◆ limitSelfCrossQuality()

template<class TIn , class TOut >
template<template< typename, typename > typename Offer>
bool xrpl::BookPaymentStep< TIn, TOut >::limitSelfCrossQuality ( AccountID const &  ,
AccountID const &  ,
Offer< TIn, TOut > const &  offer,
std::optional< Quality > &  ,
FlowOfferStream< TIn, TOut > &  ,
bool   
) const

Definition at line 238 of file BookStep.cpp.

◆ checkQualityThreshold()

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

Definition at line 251 of file BookStep.cpp.

◆ qualityThreshold()

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

Definition at line 259 of file BookStep.cpp.

◆ getOfrInRate()

template<class TIn , class TOut >
std::uint32_t xrpl::BookPaymentStep< TIn, TOut >::getOfrInRate ( Step const *  ,
AccountID const &  ,
std::uint32_t  trIn 
) const

Definition at line 266 of file BookStep.cpp.

◆ getOfrOutRate()

template<class TIn , class TOut >
std::uint32_t xrpl::BookPaymentStep< TIn, TOut >::getOfrOutRate ( Step const *  ,
AccountID const &  ,
AccountID const &  ,
std::uint32_t  trOut 
) const

Definition at line 273 of file BookStep.cpp.

◆ adjustQualityWithFees()

template<class TIn , class TOut >
Quality xrpl::BookPaymentStep< TIn, TOut >::adjustQualityWithFees ( ReadView const &  v,
Quality const &  ofrQ,
DebtDirection  prevStepDir,
WaiveTransferFee  waiveFee,
OfferType  ,
Rules const &   
) const

Definition at line 279 of file BookStep.cpp.

◆ logString()

template<class TIn , class TOut >
std::string xrpl::BookPaymentStep< TIn, TOut >::logString ( ) const
override

Definition at line 310 of file BookStep.cpp.

◆ book()

Book const & xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::book ( ) const
inherited

Definition at line 88 of file BookStep.cpp.

◆ cachedIn()

std::optional< EitherAmount > xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::cachedIn ( ) const
overrideinherited

Definition at line 94 of file BookStep.cpp.

◆ cachedOut()

std::optional< EitherAmount > xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::cachedOut ( ) const
overrideinherited

Definition at line 102 of file BookStep.cpp.

◆ debtDirection()

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

Definition at line 110 of file BookStep.cpp.

◆ bookStepBook()

std::optional< Book > xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::bookStepBook ( ) const
overrideinherited

Definition at line 116 of file BookStep.cpp.

◆ qualityUpperBound()

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

Definition at line 122 of file BookStep.cpp.

◆ getQualityFunc()

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

Definition at line 125 of file BookStep.cpp.

◆ offersUsed()

std::uint32_t xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::offersUsed ( ) const
overrideinherited

Definition at line 128 of file BookStep.cpp.

◆ revImp()

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

Definition at line 131 of file BookStep.cpp.

◆ fwdImp()

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

Definition at line 134 of file BookStep.cpp.

◆ validFwd()

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

Definition at line 137 of file BookStep.cpp.

◆ check()

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

Definition at line 141 of file BookStep.cpp.

◆ inactive()

bool xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::inactive ( ) const
overrideinherited

Definition at line 144 of file BookStep.cpp.

◆ logStringImpl()

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

Definition at line 151 of file BookStep.cpp.

◆ equal()

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

Definition at line 174 of file BookStep.cpp.

◆ forEachOffer()

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

Definition at line 183 of file BookStep.cpp.

◆ consumeOffer()

void xrpl::BookStep< TIn, TOut, BookPaymentStep< 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 188 of file BookStep.cpp.

◆ getAMMOffer()

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

Definition at line 199 of file BookStep.cpp.

◆ tip()

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

Definition at line 204 of file BookStep.cpp.

◆ tipOfferQuality()

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

Definition at line 209 of file BookStep.cpp.

◆ tipOfferQualityF()

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

Definition at line 213 of file BookStep.cpp.

Member Data Documentation

◆ MaxOffersToConsume

constexpr uint32_t xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::MaxOffersToConsume
staticconstexprprotectedinherited

Definition at line 31 of file BookStep.cpp.

◆ book_

Book xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::book_
protectedinherited

Definition at line 32 of file BookStep.cpp.

◆ strandSrc_

AccountID xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::strandSrc_
protectedinherited

Definition at line 33 of file BookStep.cpp.

◆ strandDst_

AccountID xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::strandDst_
protectedinherited

Definition at line 34 of file BookStep.cpp.

◆ prevStep_

Step const* const xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::prevStep_
protectedinherited

Definition at line 36 of file BookStep.cpp.

◆ ownerPaysTransferFee_

bool const xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::ownerPaysTransferFee_
protectedinherited

Definition at line 37 of file BookStep.cpp.

◆ inactive_

bool xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::inactive_
protectedinherited

Definition at line 39 of file BookStep.cpp.

◆ offersUsed_

std::uint32_t xrpl::BookStep< TIn, TOut, BookPaymentStep< 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> > xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::ammLiquidity_
protectedinherited

Definition at line 51 of file BookStep.cpp.

◆ j_

beast::Journal const xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::j_
protectedinherited

Definition at line 52 of file BookStep.cpp.

◆ cache_

std::optional<Cache> xrpl::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::cache_
protectedinherited

Definition at line 64 of file BookStep.cpp.