17 #include <boost/serialization/split_member.hpp> 18 #include <boost/serialization/nvp.hpp> 19 #include <boost/multiprecision/cpp_int.hpp> 20 #include <duds/BuildConfig.h> 46 namespace duds {
namespace data {
62 std::istream &
operator >> (std::istream &is, int128_t &b);
63 std::ostream &
operator << (std::ostream &os, int128_t
const &b);
84 template <
class I,
class M>
120 return value == b.
value;
123 return value != b.
value;
126 return value > b.
value;
129 return value < b.
value;
132 return value >= b.
value;
135 return value <= b.
value;
138 return value + b.
value;
141 return value - b.
value;
144 return value * b.
value;
147 return value / b.
value;
150 return value % b.
value;
153 return value += b.
value;
156 return value -= b.
value;
159 return value *= b.
value;
162 return value /= b.
value;
165 return value %= b.
value;
168 return is >> b.
value;
171 return os << b.
value;
184 void save(A &a,
const unsigned int)
const {
185 std::ostringstream os;
186 os << std::hex << *
this;
187 std::string s(os.str());
188 a << boost::serialization::make_nvp(
"value", s);
191 void load(A &a,
const unsigned int) {
193 a >> boost::serialization::make_nvp(
"value", s);
194 std::istringstream is(s);
195 is >> std::hex >> *
this;
LargeIntWrapper & operator*=(LargeIntWrapper const &b)
LargeIntWrapper operator/(LargeIntWrapper const &b) const
friend std::ostream & operator<<(std::ostream &os, LargeIntWrapper const &b)
bool operator<(LargeIntWrapper const &b) const
Wraps an integer to allow the Boost multiprecision library to provide insertion and extraction operat...
LargeIntWrapper< int128_t, boost::multiprecision::int128_t > int128_w
A 128-bit integer wrapped by LargeIntWrapper to make the Boost serialized result interchangable betwe...
LargeIntWrapper & operator=(LargeIntWrapper const &b)
bool operator>=(LargeIntWrapper const &b) const
boost::multiprecision::int128_t int128_t
The type used for 128-bit integers.
void save(A &a, const unsigned int) const
Serialize the unit data.
LargeIntWrapper operator*(LargeIntWrapper const &b) const
LargeIntWrapper & operator%=(LargeIntWrapper const &b)
LargeIntWrapper & operator/=(LargeIntWrapper const &b)
void load(A &a, const unsigned int)
LargeIntWrapper operator%(LargeIntWrapper const &b) const
bool operator>(LargeIntWrapper const &b) const
LargeIntWrapper operator-(LargeIntWrapper const &b) const
ConversationExtractor & operator>>(ConversationExtractor &ce, Int &i)
Extraction operator to read an integer from a Conversation through a ConversationExtractor object...
LargeIntWrapper operator+(LargeIntWrapper const &b) const
constexpr LargeIntWrapper(const I &v)
bool operator<=(LargeIntWrapper const &b) const
LargeIntWrapper & operator+=(LargeIntWrapper const &b)
friend std::istream & operator>>(std::istream &is, LargeIntWrapper &b)
ConversationVector & operator<<(ConversationVector &cv, const Int &i)
Insertion operator to add an integer to a ConversationVector object.
bool operator==(LargeIntWrapper const &b) const
LargeIntWrapper & operator-=(LargeIntWrapper const &b)
BOOST_SERIALIZATION_SPLIT_MEMBER()
bool operator!=(LargeIntWrapper const &b) const
friend class boost::serialization::access
Serialization support.
LargeIntWrapper()=default