20#ifndef RIPPLE_PROTOCOL_STISSUE_H_INCLUDED
21#define RIPPLE_PROTOCOL_STISSUE_H_INCLUDED
23#include <xrpl/basics/CountedObject.h>
24#include <xrpl/protocol/Asset.h>
25#include <xrpl/protocol/SField.h>
26#include <xrpl/protocol/STBase.h>
27#include <xrpl/protocol/Serializer.h>
43 template <AssetType A>
48 template <Val
idIssueType TIss>
52 template <Val
idIssueType TIss>
57 value() const noexcept;
82 friend constexpr
std::weak_ordering
88 friend constexpr
std::weak_ordering
93 copy(
std::
size_t n,
void* buf) const override;
95 move(
std::
size_t n,
void* buf) override;
105 Throw<std::runtime_error>(
106 "Invalid asset: currency and account native mismatch");
112template <Val
idIssueType TIss>
119template <Val
idIssueType TIss>
124 Throw<std::runtime_error>(
"Asset doesn't hold the requested issue");
125 return std::get<TIss>(
asset_);
138 Throw<std::runtime_error>(
139 "Invalid asset: currency and account native mismatch");
165 return lhs.
asset_ <=> rhs;
constexpr TIss const & get() const
constexpr bool holds() const
Tracks the number of instances of an object.
A currency issued by an account.
A type which can be exported to a well known binary format.
void add(Serializer &s) const override
friend constexpr bool operator==(STIssue const &lhs, STIssue const &rhs)
friend constexpr std::weak_ordering operator<=>(STIssue const &lhs, STIssue const &rhs)
value_type const & value() const noexcept
friend class detail::STVar
STBase * copy(std::size_t n, void *buf) const override
Json::Value getJson(JsonOptions) const override
bool isDefault() const override
bool isEquivalent(const STBase &t) const override
void setIssue(Asset const &issue)
STBase * move(std::size_t n, void *buf) override
SerializedTypeID getSType() const override
std::string getText() const override
JSON (JavaScript Object Notation).
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
bool isConsistent(Book const &book)
Issue issueFromJson(Json::Value const &v)
Note, should be treated as flags that can be | and &.