number.hxx 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #ifndef NUMBER_HXX
  2. #define NUMBER_HXX
  3. #include "variable.hxx"
  4. namespace binom {
  5. class Number :
  6. public arithmetic::ArithmeticTypeBase<Number>,
  7. arithmetic::EnableCopyableArithmetic,
  8. public arithmetic::CastableArithmeticTypeBase<Number>,
  9. public Variable {
  10. USE_ARITHMETIC
  11. USE_ARITHMETIC_CAST
  12. operator BitArray& () = delete;
  13. operator BufferArray& () = delete;
  14. operator Array& () = delete;
  15. operator List& () = delete;
  16. operator Map& () = delete;
  17. operator MultiMap& () = delete;
  18. operator Table& () = delete;
  19. Number& toNumber() = delete;
  20. BitArray& toBitArray() = delete;
  21. BufferArray& toBufferArray() = delete;
  22. Array& toArray() = delete;
  23. List& toList() = delete;
  24. Map& toMap() = delete;
  25. MultiMap& toMultiMap() = delete;
  26. Table& toTable() = delete;
  27. operator const BitArray& () const = delete;
  28. operator const BufferArray& () const = delete;
  29. operator const Array& () const = delete;
  30. operator const List& () const = delete;
  31. operator const Map& () const = delete;
  32. operator const MultiMap& () const = delete;
  33. operator const Table& () const = delete;
  34. const Number& toNumber() const = delete;
  35. const BitArray& toBitArray() const = delete;
  36. const BufferArray& toBufferArray() const = delete;
  37. const Array& toArray() const = delete;
  38. const List& toList() const = delete;
  39. const Map& toMap() const = delete;
  40. const MultiMap& toMultiMap() const = delete;
  41. const Table& toTable() const = delete;
  42. Variable& operator=(const Variable& other) = delete;
  43. Variable& operator=(Variable&& other) = delete;
  44. Variable& changeLink(const Variable& other) = delete;
  45. Variable& changeLink(Variable&& other) = delete;
  46. arithmetic::ArithmeticData& getArithmeticDataImpl() const;
  47. ValType getValTypeImpl() const;
  48. static bool checkLock(const OptionalSharedRecursiveLock& lock) noexcept;
  49. void setTypeImpl(ValType new_type) noexcept;
  50. Number(priv::Link&& link) noexcept;
  51. friend class Variable;
  52. friend class KeyValue;
  53. public:
  54. using Variable::getLock;
  55. using Variable::getValType;
  56. using Variable::getBitWidth;
  57. using Variable::getNumberType;
  58. Number() noexcept;
  59. Number(bool value) noexcept;
  60. Number(ui8 value) noexcept;
  61. Number(i8 value) noexcept;
  62. Number(ui16 value) noexcept;
  63. Number(i16 value) noexcept;
  64. Number(ui32 value) noexcept;
  65. Number(i32 value) noexcept;
  66. Number(f32 value) noexcept;
  67. Number(ui64 value) noexcept;
  68. Number(i64 value) noexcept;
  69. Number(f64 value) noexcept;
  70. Number(const Number& other) noexcept;
  71. Number(const Number&& other) noexcept;
  72. Number(const GenericValue& value) noexcept;
  73. Number(const GenericValue&& value) noexcept;
  74. Number move() noexcept;
  75. const Number move() const noexcept;
  76. using arithmetic::ArithmeticTypeBase<Number>::operator=;
  77. using binom::Variable::operator=;
  78. Number& changeLink(const Number& other);
  79. Number& changeLink(Number&& other);
  80. };
  81. }
  82. #endif // NUMBER_HXX