xrpld
Loading...
Searching...
No Matches
xrpl::TAmounts< In, Out > Struct Template Reference

Represents a pair of input and output currencies. More...

#include <Quality.h>

Public Member Functions

 TAmounts ()=default
 TAmounts (beast::Zero, beast::Zero)
 TAmounts (In in, Out out)
bool empty () const noexcept
 Returns true if either quantity is not positive.
TAmountsoperator+= (TAmounts const &rhs)
TAmountsoperator-= (TAmounts const &rhs)

Public Attributes

In in {}
Out out {}

Detailed Description

template<class In, class Out>
struct xrpl::TAmounts< In, Out >

Represents a pair of input and output currencies.

The input currency can be converted to the output currency by multiplying by the rate, represented by Quality.

For offers, "in" is always TakerPays and "out" is always TakerGets.

Definition at line 28 of file Quality.h.

Constructor & Destructor Documentation

◆ TAmounts() [1/3]

template<class In, class Out>
xrpl::TAmounts< In, Out >::TAmounts ( )
default

◆ TAmounts() [2/3]

template<class In, class Out>
xrpl::TAmounts< In, Out >::TAmounts ( beast::Zero ,
beast::Zero  )

Definition at line 32 of file Quality.h.

◆ TAmounts() [3/3]

template<class In, class Out>
xrpl::TAmounts< In, Out >::TAmounts ( In in,
Out out )

Definition at line 36 of file Quality.h.

Member Function Documentation

◆ empty()

template<class In, class Out>
bool xrpl::TAmounts< In, Out >::empty ( ) const
nodiscardnoexcept

Returns true if either quantity is not positive.

Definition at line 44 of file Quality.h.

◆ operator+=()

template<class In, class Out>
TAmounts & xrpl::TAmounts< In, Out >::operator+= ( TAmounts< In, Out > const & rhs)

Definition at line 50 of file Quality.h.

◆ operator-=()

template<class In, class Out>
TAmounts & xrpl::TAmounts< In, Out >::operator-= ( TAmounts< In, Out > const & rhs)

Definition at line 58 of file Quality.h.

Member Data Documentation

◆ in

template<class In, class Out>
In xrpl::TAmounts< In, Out >::in {}

Definition at line 65 of file Quality.h.

◆ out

template<class In, class Out>
Out xrpl::TAmounts< In, Out >::out {}

Definition at line 66 of file Quality.h.