22
22
#define SERVUS_UINT128_H
23
23
24
24
#include < servus/api.h>
25
+ #include < servus/serializable.h>
25
26
#include < servus/types.h>
26
27
27
28
#include < sstream>
@@ -45,14 +46,15 @@ std::ostream& operator<<(std::ostream& os, const uint128_t& id);
45
46
*
46
47
* Example: @include tests/uint128_t.cpp
47
48
*/
48
- class uint128_t
49
+ class uint128_t : public Serializable
49
50
{
50
51
public:
51
52
/* *
52
53
* Construct a new 128 bit integer with a default value.
53
54
*/
54
55
explicit uint128_t (const unsigned long long low_ = 0 )
55
- : _high(0 )
56
+ : Serializable()
57
+ , _high(0 )
56
58
, _low(low_)
57
59
{
58
60
}
@@ -61,7 +63,8 @@ class uint128_t
61
63
* Construct a new 128 bit integer with a default value.
62
64
*/
63
65
explicit uint128_t (const unsigned long low_)
64
- : _high(0 )
66
+ : Serializable()
67
+ , _high(0 )
65
68
, _low(low_)
66
69
{
67
70
}
@@ -70,7 +73,8 @@ class uint128_t
70
73
* Construct a new 128 bit integer with a default value.
71
74
*/
72
75
explicit uint128_t (const int low_)
73
- : _high(0 )
76
+ : Serializable()
77
+ , _high(0 )
74
78
, _low(low_)
75
79
{
76
80
}
@@ -79,7 +83,8 @@ class uint128_t
79
83
* Construct a new 128 bit integer with default values.
80
84
*/
81
85
uint128_t (const servus::uint128_t & rhs)
82
- : _high(rhs._high)
86
+ : Serializable()
87
+ , _high(rhs._high)
83
88
, _low(rhs._low)
84
89
{
85
90
}
@@ -283,6 +288,8 @@ class uint128_t
283
288
ar& high ();
284
289
}
285
290
291
+ virtual std::string getTypeName () const { return " servus::uint128_t" ; }
292
+
286
293
private:
287
294
uint64_t _high;
288
295
uint64_t _low;
@@ -376,7 +383,7 @@ inline uint128_t make_uint128(const std::string& string)
376
383
* identifier.
377
384
*/
378
385
SERVUS_API uint128_t make_UUID ();
379
- }
386
+ } // namespace servus
380
387
381
388
namespace std
382
389
{
@@ -396,6 +403,6 @@ inline string to_string(const servus::uint128_t& value)
396
403
{
397
404
return value.getString ();
398
405
}
399
- }
406
+ } // namespace std
400
407
401
408
#endif // SERVUS_UINT128_H
0 commit comments