6namespace sysio {
namespace chain {
57 return std::tie(
a.get_symbol(),
a.amount) == std::tie(b.
get_symbol(), b.amount);
61 SYS_ASSERT(
a.get_symbol() == b.
get_symbol(), asset_type_exception,
"logical operation between two different asset is not allowed");
62 return std::tie(
a.amount,
a.get_symbol()) < std::tie(b.amount,b.
get_symbol());
70 SYS_ASSERT(
a.get_symbol() == b.
get_symbol(), asset_type_exception,
"subtraction between two different asset is not allowed");
71 return asset(
a.amount - b.amount,
a.get_symbol());
75 SYS_ASSERT(
a.get_symbol() == b.
get_symbol(), asset_type_exception,
"addition between two different asset is not allowed");
76 return asset(
a.amount + b.amount,
a.get_symbol());
79 friend std::ostream&
operator << (std::ostream& out,
const asset&
a) {
return out <<
a.to_string(); }
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
variant_object & get_object()
const string & get_string() const
void from_variant(const fc::variant &v, sysio::chain::chain_id_type &cid)
void to_variant(const sysio::chain::shared_public_key &var, fc::variant &vo)
bool operator<(const permission_level &lhs, const permission_level &rhs)
bool operator<=(const permission_level &lhs, const permission_level &rhs)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
defines visit functions for T Unless this is specialized, visit() will not be defined for T.
bool is_amount_within_range() const
string symbol_name() const
asset & operator-=(const asset &o)
friend bool operator<(const asset &a, const asset &b)
int64_t precision() const
friend asset operator+(const asset &a, const asset &b)
asset & operator+=(const asset &o)
const symbol & get_symbol() const
friend bool operator>(const asset &a, const asset &b)
friend bool operator==(const asset &a, const asset &b)
friend bool operator<=(const asset &a, const asset &b)
static constexpr int64_t max_amount
friend bool operator>=(const asset &a, const asset &b)
static asset from_string(const string &from)
friend std::ostream & operator<<(std::ostream &out, const asset &a)
void reflector_init() const
share_type get_amount() const
friend bool operator!=(const asset &a, const asset &b)
asset(share_type a=0, symbol id=symbol(CORE_SYMBOL))
extended_asset(asset a, name n)
Immutable except for fc::from_variant.