hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
amount.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_AMOUNT_HPP
7 #define IROHA_SHARED_MODEL_AMOUNT_HPP
8 
10 
11 #include <string_view>
12 
14 
15 namespace shared_model {
16  namespace interface {
17 
21  class Amount final : public ModelPrimitive<Amount> {
22  public:
23  explicit Amount(std::string_view amount);
24 
26 
27  Amount(Amount const &other);
28 
29  Amount(Amount &&other) noexcept;
30 
31  Amount &operator=(Amount const &other);
32 
33  Amount &operator=(Amount &&other) noexcept;
34 
35  ~Amount() override;
36 
41  int sign() const;
42 
48 
53  std::string const &toStringRepr() const;
54 
55  Amount &operator+=(Amount const &other);
56 
57  Amount &operator-=(Amount const &other);
58 
64  bool operator==(const ModelType &rhs) const override;
65 
70  std::string toString() const override;
71 
72  private:
73  struct Impl;
74  std::unique_ptr<Impl> impl_;
75  };
76  } // namespace interface
77 } // namespace shared_model
78 #endif // IROHA_SHARED_MODEL_AMOUNT_HPP
Amount & operator=(Amount const &other)
Definition: amount.cpp:119
Amount & operator-=(Amount const &other)
Definition: amount.cpp:170
Amount ModelType
Definition: model_primitive.hpp:27
Definition: amount.hpp:21
std::string const & toStringRepr() const
Definition: amount.cpp:138
Definition: amount.cpp:18
int sign() const
Definition: amount.cpp:130
Amount & operator+=(Amount const &other)
Definition: amount.cpp:142
std::string toString() const override
Definition: amount.cpp:217
types::PrecisionType precision() const
Definition: amount.cpp:134
Amount(std::string_view amount)
Definition: amount.cpp:107
bool operator==(const ModelType &rhs) const override
Definition: amount.cpp:198
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:46
Definition: model_primitive.hpp:22
Definition: command_executor.hpp:13