rippled
Public Member Functions | Protected Member Functions | Static Protected Member Functions | 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)
 
bool limitSelfCrossQuality (AccountID const &strandSrc, AccountID const &strandDst, TOffer< TIn, TOut > const &offer, boost::optional< Quality > &ofrQ, FlowOfferStream< TIn, TOut > &offers, bool const offerAttempted) const
 
bool checkQualityThreshold (TOffer< TIn, TOut > const &offer) const
 
std::uint32_t getOfrInRate (Step const *prevStep, TOffer< TIn, TOut > const &offer, std::uint32_t trIn) const
 
std::uint32_t getOfrOutRate (Step const *prevStep, TOffer< TIn, TOut > const &offer, AccountID const &strandDst, 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
 
boost::optional< EitherAmountcachedIn () const override
 
boost::optional< EitherAmountcachedOut () const override
 
DebtDirection debtDirection (ReadView const &sb, StrandDirection dir) const override
 
boost::optional< BookbookStepBook () const override
 
std::pair< boost::optional< Quality >, DebtDirectionqualityUpperBound (ReadView const &v, DebtDirection prevStepDir) 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_
 
const beast::Journal j_
 
boost::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
 

Static Private Member Functions

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

Private Attributes

const bool defaultPath_
 
const Quality qualityThreshold_
 

Detailed Description

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

Definition at line 285 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 302 of file BookStep.cpp.

Member Function Documentation

◆ getQuality()

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

Definition at line 292 of file BookStep.cpp.

◆ limitSelfCrossQuality()

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

Definition at line 310 of file BookStep.cpp.

◆ checkQualityThreshold()

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

Definition at line 363 of file BookStep.cpp.

◆ getOfrInRate()

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

Definition at line 370 of file BookStep.cpp.

◆ getOfrOutRate()

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

Definition at line 384 of file BookStep.cpp.

◆ adjustQualityWithFees()

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

Definition at line 395 of file BookStep.cpp.

◆ logString()

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

Definition at line 408 of file BookStep.cpp.

◆ getMaxOffersToConsume()

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

Definition at line 71 of file BookStep.cpp.

◆ book()

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

Definition at line 92 of file BookStep.cpp.

◆ cachedIn()

boost::optional<EitherAmount> ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::cachedIn
overrideinherited

Definition at line 98 of file BookStep.cpp.

◆ cachedOut()

boost::optional<EitherAmount> ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::cachedOut
overrideinherited

Definition at line 106 of file BookStep.cpp.

◆ debtDirection()

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

Definition at line 114 of file BookStep.cpp.

◆ bookStepBook()

boost::optional<Book> ripple::BookStep< TIn, TOut, BookOfferCrossingStep< TIn, TOut > >::bookStepBook
overrideinherited

Definition at line 121 of file BookStep.cpp.

◆ qualityUpperBound()

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

Definition at line 430 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 661 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 779 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 941 of file BookStep.cpp.

◆ check()

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

Definition at line 980 of file BookStep.cpp.

◆ inactive()

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

Definition at line 152 of file BookStep.cpp.

◆ logStringImpl()

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

Definition at line 157 of file BookStep.cpp.

◆ equal()

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

Definition at line 421 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 495 of file BookStep.cpp.

◆ consumeOffer()

void ripple::BookStep< TIn, TOut, BookOfferCrossingStep< 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 621 of file BookStep.cpp.

Member Data Documentation

◆ defaultPath_

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

Definition at line 414 of file BookStep.cpp.

◆ qualityThreshold_

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

Definition at line 415 of file BookStep.cpp.

◆ maxOffersToConsume_

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

Definition at line 46 of file BookStep.cpp.

◆ book_

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

Definition at line 47 of file BookStep.cpp.

◆ strandSrc_

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

Definition at line 48 of file BookStep.cpp.

◆ strandDst_

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

Definition at line 49 of file BookStep.cpp.

◆ prevStep_

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

Definition at line 51 of file BookStep.cpp.

◆ ownerPaysTransferFee_

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

Definition at line 52 of file BookStep.cpp.

◆ inactive_

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

Definition at line 54 of file BookStep.cpp.

◆ j_

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

Definition at line 55 of file BookStep.cpp.

◆ cache_

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

Definition at line 68 of file BookStep.cpp.