rippled
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
ripple::BookPaymentStep< TIn, TOut > Class Template Reference
Inheritance diagram for ripple::BookPaymentStep< TIn, TOut >:
Inheritance graph
[legend]
Collaboration diagram for ripple::BookPaymentStep< TIn, TOut >:
Collaboration graph
[legend]

Public Member Functions

 BookPaymentStep ()=default
 
bool limitSelfCrossQuality (AccountID const &, AccountID const &, TOffer< TIn, TOut > const &offer, std::optional< Quality > &, FlowOfferStream< TIn, TOut > &, bool) const
 
bool checkQualityThreshold (TOffer< TIn, TOut > const &offer) const
 
std::uint32_t getOfrInRate (Step const *, TOffer< TIn, TOut > const &, std::uint32_t trIn) const
 
std::uint32_t getOfrOutRate (Step const *, TOffer< TIn, TOut > const &, AccountID const &, std::uint32_t trOut) const
 
Quality adjustQualityWithFees (ReadView const &v, Quality const &ofrQ, DebtDirection prevStepDir) 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::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 Member Functions

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

Static Protected Member Functions

static uint32_t getMaxOffersToConsume (StrandContext const &ctx)
 

Protected Attributes

const uint32_t maxOffersToConsume_
 
Book book_
 
AccountID strandSrc_
 
AccountID strandDst_
 
Step const *const prevStep_
 
const bool 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. More...
 
const beast::Journal j_
 
std::optional< Cache > cache_
 

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, TOffer< TIn, TOut > &offer, TAmounts< TIn, TOut > const &ofrAmt, TAmounts< TIn, TOut > const &stepAmt, TOut const &ownerGives) const
 

Detailed Description

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

Definition at line 227 of file BookStep.cpp.

Constructor & Destructor Documentation

◆ BookPaymentStep()

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

Member Function Documentation

◆ limitSelfCrossQuality()

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

Definition at line 237 of file BookStep.cpp.

◆ checkQualityThreshold()

template<class TIn , class TOut >
bool ripple::BookPaymentStep< TIn, TOut >::checkQualityThreshold ( TOffer< TIn, TOut > const &  offer) const

Definition at line 250 of file BookStep.cpp.

◆ getOfrInRate()

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

Definition at line 257 of file BookStep.cpp.

◆ getOfrOutRate()

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

Definition at line 265 of file BookStep.cpp.

◆ adjustQualityWithFees()

template<class TIn , class TOut >
Quality ripple::BookPaymentStep< TIn, TOut >::adjustQualityWithFees ( ReadView const &  v,
Quality const &  ofrQ,
DebtDirection  prevStepDir 
) const

Definition at line 275 of file BookStep.cpp.

◆ logString()

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

Definition at line 303 of file BookStep.cpp.

◆ getMaxOffersToConsume()

static uint32_t ripple::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::getMaxOffersToConsume ( StrandContext const &  ctx)
staticprotectedinherited

Definition at line 77 of file BookStep.cpp.

◆ book()

Book const& ripple::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::book
inherited

Definition at line 97 of file BookStep.cpp.

◆ cachedIn()

std::optional<EitherAmount> ripple::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::cachedIn
overrideinherited

Definition at line 103 of file BookStep.cpp.

◆ cachedOut()

std::optional<EitherAmount> ripple::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::cachedOut
overrideinherited

Definition at line 111 of file BookStep.cpp.

◆ debtDirection()

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

Definition at line 119 of file BookStep.cpp.

◆ bookStepBook()

std::optional<Book> ripple::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::bookStepBook
overrideinherited

Definition at line 126 of file BookStep.cpp.

◆ qualityUpperBound()

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

Definition at line 476 of file BookStep.cpp.

◆ offersUsed()

std::uint32_t ripple::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::offersUsed
overrideinherited

Definition at line 495 of file BookStep.cpp.

◆ revImp()

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

Definition at line 720 of file BookStep.cpp.

◆ fwdImp()

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

Definition at line 841 of file BookStep.cpp.

◆ validFwd()

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

Definition at line 1011 of file BookStep.cpp.

◆ check()

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

Definition at line 1049 of file BookStep.cpp.

◆ inactive()

bool ripple::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::inactive
overrideinherited

Definition at line 161 of file BookStep.cpp.

◆ logStringImpl()

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

Definition at line 168 of file BookStep.cpp.

◆ equal()

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

Definition at line 467 of file BookStep.cpp.

◆ forEachOffer()

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

Definition at line 550 of file BookStep.cpp.

◆ consumeOffer()

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

Definition at line 672 of file BookStep.cpp.

Member Data Documentation

◆ maxOffersToConsume_

const uint32_t ripple::BookStep< TIn, TOut, BookPaymentStep< TIn, TOut > >::maxOffersToConsume_
protectedinherited

Definition at line 45 of file BookStep.cpp.

◆ book_

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

Definition at line 46 of file BookStep.cpp.

◆ strandSrc_

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

Definition at line 47 of file BookStep.cpp.

◆ strandDst_

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

Definition at line 48 of file BookStep.cpp.

◆ prevStep_

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

Definition at line 50 of file BookStep.cpp.

◆ ownerPaysTransferFee_

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

Definition at line 51 of file BookStep.cpp.

◆ inactive_

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

Definition at line 53 of file BookStep.cpp.

◆ offersUsed_

std::uint32_t ripple::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 61 of file BookStep.cpp.

◆ j_

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

Definition at line 62 of file BookStep.cpp.

◆ cache_

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

Definition at line 74 of file BookStep.cpp.