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

Public Member Functions

 TOffer ()=default
 
 TOffer (SLE::pointer const &entry, Quality quality)
 
const Quality quality () const noexcept
 Returns the quality of the offer. More...
 
AccountID const & owner () const
 Returns the account id of the offer's owner. More...
 
TAmounts< TIn, TOut > const & amount () const
 Returns the in and out amounts. More...
 
bool fully_consumed () const
 Returns true if no more funds can flow through this offer. More...
 
void consume (ApplyView &view, TAmounts< TIn, TOut > const &consumed)
 Adjusts the offer to indicate that we consumed some (or all) of it. More...
 
std::string id () const
 
uint256 key () const
 
Issue issueIn () const
 
Issue issueOut () const
 
 TOffer (SLE::pointer const &entry, Quality quality)
 
Issue issueIn () const
 
Issue issueOut () const
 

Private Member Functions

void setFieldAmounts ()
 
void setFieldAmounts ()
 
void setFieldAmounts ()
 
void setFieldAmounts ()
 
void setFieldAmounts ()
 

Private Attributes

SLE::pointer m_entry
 
Quality m_quality
 
AccountID m_account
 
TAmounts< TIn, TOut > m_amounts
 

Detailed Description

template<class TIn = STAmount, class TOut = STAmount>
class ripple::TOffer< TIn, TOut >

Definition at line 49 of file Offer.h.

Constructor & Destructor Documentation

◆ TOffer() [1/3]

template<class TIn = STAmount, class TOut = STAmount>
ripple::TOffer< TIn, TOut >::TOffer ( )
default

◆ TOffer() [2/3]

template<class TIn , class TOut >
ripple::TOffer< TIn, TOut >::TOffer ( SLE::pointer const &  entry,
Quality  quality 
)

Definition at line 143 of file Offer.h.

◆ TOffer() [3/3]

ripple::TOffer< STAmount, STAmount >::TOffer ( SLE::pointer const &  entry,
Quality  quality 
)

Definition at line 157 of file Offer.h.

Member Function Documentation

◆ setFieldAmounts() [1/5]

template<class TIn , class TOut >
void ripple::TOffer< TIn, TOut >::setFieldAmounts
private

Definition at line 171 of file Offer.h.

◆ quality()

template<class TIn = STAmount, class TOut = STAmount>
const Quality ripple::TOffer< TIn, TOut >::quality ( ) const
noexcept

Returns the quality of the offer.

Conceptually, the quality is the ratio of output to input currency. The implementation calculates it as the ratio of input to output currency (so it sorts ascending). The quality is computed at the time the offer is placed, and never changes for the lifetime of the offer. This is an important business rule that maintains accuracy when an offer is partially filled; Subsequent partial fills will use the original quality.

Definition at line 75 of file Offer.h.

◆ owner()

template<class TIn = STAmount, class TOut = STAmount>
AccountID const& ripple::TOffer< TIn, TOut >::owner ( ) const

Returns the account id of the offer's owner.

Definition at line 82 of file Offer.h.

◆ amount()

template<class TIn = STAmount, class TOut = STAmount>
TAmounts<TIn, TOut> const& ripple::TOffer< TIn, TOut >::amount ( ) const

Returns the in and out amounts.

Some or all of the out amount may be unfunded.

Definition at line 91 of file Offer.h.

◆ fully_consumed()

template<class TIn = STAmount, class TOut = STAmount>
bool ripple::TOffer< TIn, TOut >::fully_consumed ( ) const

Returns true if no more funds can flow through this offer.

Definition at line 98 of file Offer.h.

◆ consume()

template<class TIn = STAmount, class TOut = STAmount>
void ripple::TOffer< TIn, TOut >::consume ( ApplyView view,
TAmounts< TIn, TOut > const &  consumed 
)

Adjusts the offer to indicate that we consumed some (or all) of it.

Definition at line 109 of file Offer.h.

◆ id()

template<class TIn = STAmount, class TOut = STAmount>
std::string ripple::TOffer< TIn, TOut >::id ( ) const

Definition at line 123 of file Offer.h.

◆ key()

template<class TIn = STAmount, class TOut = STAmount>
uint256 ripple::TOffer< TIn, TOut >::key ( ) const

Definition at line 129 of file Offer.h.

◆ issueIn() [1/2]

template<class TIn , class TOut >
Issue ripple::TOffer< TIn, TOut >::issueIn

Definition at line 214 of file Offer.h.

◆ issueOut() [1/2]

template<class TIn , class TOut >
Issue ripple::TOffer< TIn, TOut >::issueOut

Definition at line 228 of file Offer.h.

◆ setFieldAmounts() [2/5]

void ripple::TOffer< STAmount, STAmount >::setFieldAmounts ( )
private

Definition at line 182 of file Offer.h.

◆ setFieldAmounts() [3/5]

void ripple::TOffer< IOUAmount, IOUAmount >::setFieldAmounts ( )
private

Definition at line 190 of file Offer.h.

◆ setFieldAmounts() [4/5]

void ripple::TOffer< IOUAmount, XRPAmount >::setFieldAmounts ( )
private

Definition at line 198 of file Offer.h.

◆ setFieldAmounts() [5/5]

void ripple::TOffer< XRPAmount, IOUAmount >::setFieldAmounts ( )
private

Definition at line 206 of file Offer.h.

◆ issueIn() [2/2]

Issue ripple::TOffer< STAmount, STAmount >::issueIn ( ) const

Definition at line 221 of file Offer.h.

◆ issueOut() [2/2]

Issue ripple::TOffer< STAmount, STAmount >::issueOut ( ) const

Definition at line 235 of file Offer.h.

Member Data Documentation

◆ m_entry

template<class TIn = STAmount, class TOut = STAmount>
SLE::pointer ripple::TOffer< TIn, TOut >::m_entry
private

Definition at line 52 of file Offer.h.

◆ m_quality

template<class TIn = STAmount, class TOut = STAmount>
Quality ripple::TOffer< TIn, TOut >::m_quality
private

Definition at line 53 of file Offer.h.

◆ m_account

template<class TIn = STAmount, class TOut = STAmount>
AccountID ripple::TOffer< TIn, TOut >::m_account
private

Definition at line 54 of file Offer.h.

◆ m_amounts

template<class TIn = STAmount, class TOut = STAmount>
TAmounts<TIn, TOut> ripple::TOffer< TIn, TOut >::m_amounts
private

Definition at line 56 of file Offer.h.