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 <boost/multiprecision/cpp_int.hpp>
13 
14 namespace shared_model {
15  namespace interface {
16 
20  class Amount final : public ModelPrimitive<Amount> {
21  public:
22  explicit Amount(const std::string &amount);
23  explicit Amount(std::string &&amount);
24 
25  Amount(const Amount &o);
26  Amount(Amount &&o) noexcept;
27 
32  const boost::multiprecision::uint256_t &intValue() const;
33 
39 
44  std::string toStringRepr() const;
45 
51  bool operator==(const ModelType &rhs) const override;
52 
57  std::string toString() const override;
58 
59  Amount *clone() const override;
60 
61  private:
62  const std::string amount_;
63 
65  const boost::multiprecision::uint256_t multiprecision_repr_;
66  };
67  } // namespace interface
68 } // namespace shared_model
69 #endif // IROHA_SHARED_MODEL_AMOUNT_HPP
Amount(const std::string &amount)
Definition: amount.cpp:14
std::string toStringRepr() const
Definition: amount.cpp:54
Definition: amount.hpp:20
string(REPLACE".""/"CMAKE_SWIG_OUTDIR ${SWIG_JAVA_PKG}) else() set(CMAKE_SWIG_FLAGS"") endif() myswig_add_library(irohajava LANGUAGE java SOURCES bindings.i) unset(CMAKE_SWIG_FLAGS) swig_link_libraries(irohajava $
Definition: CMakeLists.txt:54
std::string toString() const override
Definition: amount.cpp:62
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:39
const boost::multiprecision::uint256_t & intValue() const
Definition: amount.cpp:46
Definition: model_primitive.hpp:23
Definition: command_executor.hpp:12
types::PrecisionType precision() const
Definition: amount.cpp:50
bool operator==(const ModelType &rhs) const override
Definition: amount.cpp:58
Amount * clone() const override
Definition: amount.cpp:69