xrpld
Loading...
Searching...
No Matches
xrpl::test::jtx::IOU Class Reference

Converts to IOU Issue or STAmount. More...

#include <amount.h>

Collaboration diagram for xrpl::test::jtx::IOU:

Public Member Functions

 IOU (Account account, xrpl::Currency const &currency)
Issue issue () const
Asset asset () const
bool integral () const
 operator Issue () const
 Implicit conversion to Issue or Asset.
 operator Asset () const
 operator PrettyAsset () const
template<class T>
requires (sizeof(T) >= sizeof(int) && std::is_arithmetic_v<T>)
PrettyAmount operator() (T v) const
PrettyAmount operator() (EpsilonT) const
PrettyAmount operator() (detail::EpsilonMultiple) const
None operator() (NoneT) const
 Returns None-of-Issue.

Public Attributes

Account account
xrpl::Currency currency

Friends

BookSpec operator~ (IOU const &iou)

Detailed Description

Converts to IOU Issue or STAmount.

Examples: IOU Converts to the underlying Issue IOU(10) Returns STAmount of 10 of the underlying Issue.

Definition at line 403 of file src/test/jtx/amount.h.

Constructor & Destructor Documentation

◆ IOU()

xrpl::test::jtx::IOU::IOU ( Account account,
xrpl::Currency const & currency )

Definition at line 409 of file src/test/jtx/amount.h.

Member Function Documentation

◆ issue()

Issue xrpl::test::jtx::IOU::issue ( ) const
nodiscard

Definition at line 415 of file src/test/jtx/amount.h.

◆ asset()

Asset xrpl::test::jtx::IOU::asset ( ) const
nodiscard

Definition at line 420 of file src/test/jtx/amount.h.

◆ integral()

bool xrpl::test::jtx::IOU::integral ( ) const
nodiscard

Definition at line 425 of file src/test/jtx/amount.h.

◆ operator Issue()

xrpl::test::jtx::IOU::operator Issue ( ) const

Implicit conversion to Issue or Asset.

This allows passing an IOU value where an Issue or Asset is expected.

Definition at line 436 of file src/test/jtx/amount.h.

◆ operator Asset()

xrpl::test::jtx::IOU::operator Asset ( ) const

Definition at line 440 of file src/test/jtx/amount.h.

◆ operator PrettyAsset()

xrpl::test::jtx::IOU::operator PrettyAsset ( ) const

Definition at line 444 of file src/test/jtx/amount.h.

◆ operator()() [1/4]

template<class T>
requires (sizeof(T) >= sizeof(int) && std::is_arithmetic_v<T>)
PrettyAmount xrpl::test::jtx::IOU::operator() ( T v) const

Definition at line 451 of file src/test/jtx/amount.h.

◆ operator()() [2/4]

PrettyAmount xrpl::test::jtx::IOU::operator() ( EpsilonT ) const

Definition at line 95 of file amount.cpp.

◆ operator()() [3/4]

PrettyAmount xrpl::test::jtx::IOU::operator() ( detail::EpsilonMultiple m) const

Definition at line 101 of file amount.cpp.

◆ operator()() [4/4]

None xrpl::test::jtx::IOU::operator() ( NoneT ) const

Returns None-of-Issue.

Definition at line 471 of file src/test/jtx/amount.h.

◆ operator~

BookSpec operator~ ( IOU const & iou)
friend

Definition at line 477 of file src/test/jtx/amount.h.

Member Data Documentation

◆ account

Account xrpl::test::jtx::IOU::account

Definition at line 406 of file src/test/jtx/amount.h.

◆ currency

xrpl::Currency xrpl::test::jtx::IOU::currency

Definition at line 407 of file src/test/jtx/amount.h.