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

Classes

struct  Cache
 

Public Member Functions

 BookStep (StrandContext const &ctx, Issue const &in, Issue const &out)
 
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_ = nullptr
 
const bool ownerPaysTransferFee_
 
bool inactive_ = false
 
const beast::Journal j_
 
boost::optional< Cachecache_
 

Private Member Functions

bool equal (Step const &rhs) const override
 
template<class Callback >
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
 

Friends

bool operator== (BookStep const &lhs, BookStep const &rhs)
 
bool operator!= (BookStep const &lhs, BookStep const &rhs)
 

Detailed Description

template<class TIn, class TOut, class TDerived>
class ripple::BookStep< TIn, TOut, TDerived >

Definition at line 43 of file BookStep.cpp.

Constructor & Destructor Documentation

◆ BookStep()

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

Definition at line 78 of file BookStep.cpp.

Member Function Documentation

◆ getMaxOffersToConsume()

template<class TIn , class TOut , class TDerived >
static uint32_t ripple::BookStep< TIn, TOut, TDerived >::getMaxOffersToConsume ( StrandContext const &  ctx)
staticprotected

Definition at line 70 of file BookStep.cpp.

◆ book()

template<class TIn , class TOut , class TDerived >
Book const& ripple::BookStep< TIn, TOut, TDerived >::book ( ) const

Definition at line 90 of file BookStep.cpp.

◆ cachedIn()

template<class TIn , class TOut , class TDerived >
boost::optional<EitherAmount> ripple::BookStep< TIn, TOut, TDerived >::cachedIn ( ) const
override

Definition at line 96 of file BookStep.cpp.

◆ cachedOut()

template<class TIn , class TOut , class TDerived >
boost::optional<EitherAmount> ripple::BookStep< TIn, TOut, TDerived >::cachedOut ( ) const
override

Definition at line 104 of file BookStep.cpp.

◆ debtDirection()

template<class TIn , class TOut , class TDerived >
DebtDirection ripple::BookStep< TIn, TOut, TDerived >::debtDirection ( ReadView const &  sb,
StrandDirection  dir 
) const
override

Definition at line 112 of file BookStep.cpp.

◆ bookStepBook()

template<class TIn , class TOut , class TDerived >
boost::optional<Book> ripple::BookStep< TIn, TOut, TDerived >::bookStepBook ( ) const
override

Definition at line 119 of file BookStep.cpp.

◆ qualityUpperBound()

template<class TIn , class TOut , class TDerived >
std::pair< boost::optional< Quality >, DebtDirection > ripple::BookStep< TIn, TOut, TDerived >::qualityUpperBound ( ReadView const &  v,
DebtDirection  prevStepDir 
) const
override

Definition at line 466 of file BookStep.cpp.

◆ revImp()

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

Definition at line 703 of file BookStep.cpp.

◆ fwdImp()

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

Definition at line 823 of file BookStep.cpp.

◆ validFwd()

template<class TIn , class TOut , class TDerived >
std::pair< bool, EitherAmount > ripple::BookStep< TIn, TOut, TDerived >::validFwd ( PaymentSandbox sb,
ApplyView afView,
EitherAmount const &  in 
)
override

Definition at line 992 of file BookStep.cpp.

◆ check()

template<class TIn , class TOut , class TDerived >
TER ripple::BookStep< TIn, TOut, TDerived >::check ( StrandContext const &  ctx) const

Definition at line 1030 of file BookStep.cpp.

◆ inactive()

template<class TIn , class TOut , class TDerived >
bool ripple::BookStep< TIn, TOut, TDerived >::inactive ( ) const
override

Definition at line 151 of file BookStep.cpp.

◆ logStringImpl()

template<class TIn , class TOut , class TDerived >
std::string ripple::BookStep< TIn, TOut, TDerived >::logStringImpl ( char const *  name) const
protected

Definition at line 158 of file BookStep.cpp.

◆ equal()

template<class TIn , class TOut , class TDerived >
bool ripple::BookStep< TIn, TOut, TDerived >::equal ( Step const &  rhs) const
overrideprivate

Definition at line 457 of file BookStep.cpp.

◆ forEachOffer()

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

Definition at line 533 of file BookStep.cpp.

◆ consumeOffer()

template<class TIn , class TOut , class TDerived >
void ripple::BookStep< TIn, TOut, TDerived >::consumeOffer ( PaymentSandbox sb,
TOffer< TIn, TOut > &  offer,
TAmounts< TIn, TOut > const &  ofrAmt,
TAmounts< TIn, TOut > const &  stepAmt,
TOut const &  ownerGives 
) const
private

Definition at line 655 of file BookStep.cpp.

Friends And Related Function Documentation

◆ operator==

template<class TIn , class TOut , class TDerived >
bool operator== ( BookStep< TIn, TOut, TDerived > const &  lhs,
BookStep< TIn, TOut, TDerived > const &  rhs 
)
friend

Definition at line 171 of file BookStep.cpp.

◆ operator!=

template<class TIn , class TOut , class TDerived >
bool operator!= ( BookStep< TIn, TOut, TDerived > const &  lhs,
BookStep< TIn, TOut, TDerived > const &  rhs 
)
friend

Definition at line 177 of file BookStep.cpp.

Member Data Documentation

◆ maxOffersToConsume_

template<class TIn , class TOut , class TDerived >
const uint32_t ripple::BookStep< TIn, TOut, TDerived >::maxOffersToConsume_
protected

Definition at line 46 of file BookStep.cpp.

◆ book_

template<class TIn , class TOut , class TDerived >
Book ripple::BookStep< TIn, TOut, TDerived >::book_
protected

Definition at line 47 of file BookStep.cpp.

◆ strandSrc_

template<class TIn , class TOut , class TDerived >
AccountID ripple::BookStep< TIn, TOut, TDerived >::strandSrc_
protected

Definition at line 48 of file BookStep.cpp.

◆ strandDst_

template<class TIn , class TOut , class TDerived >
AccountID ripple::BookStep< TIn, TOut, TDerived >::strandDst_
protected

Definition at line 49 of file BookStep.cpp.

◆ prevStep_

template<class TIn , class TOut , class TDerived >
Step const* const ripple::BookStep< TIn, TOut, TDerived >::prevStep_ = nullptr
protected

Definition at line 51 of file BookStep.cpp.

◆ ownerPaysTransferFee_

template<class TIn , class TOut , class TDerived >
const bool ripple::BookStep< TIn, TOut, TDerived >::ownerPaysTransferFee_
protected

Definition at line 52 of file BookStep.cpp.

◆ inactive_

template<class TIn , class TOut , class TDerived >
bool ripple::BookStep< TIn, TOut, TDerived >::inactive_ = false
protected

Definition at line 54 of file BookStep.cpp.

◆ j_

template<class TIn , class TOut , class TDerived >
const beast::Journal ripple::BookStep< TIn, TOut, TDerived >::j_
protected

Definition at line 55 of file BookStep.cpp.

◆ cache_

template<class TIn , class TOut , class TDerived >
boost::optional<Cache> ripple::BookStep< TIn, TOut, TDerived >::cache_
protected

Definition at line 67 of file BookStep.cpp.