20 #ifndef CO_OBJECTVERSION_H 21 #define CO_OBJECTVERSION_H 26 #include <lunchbox/bitOperation.h> 32 static const uint128_t VERSION_FIRST(0, 1);
33 static const uint128_t VERSION_NEWEST(0, 0xfffffffffffffffbull);
34 static const uint128_t VERSION_OLDEST(0, 0xfffffffffffffffcull);
35 static const uint128_t VERSION_NEXT(0, 0xfffffffffffffffdull);
36 static const uint128_t VERSION_INVALID(0, 0xfffffffffffffffeull);
37 static const uint128_t VERSION_HEAD(0, 0xffffffffffffffffull);
84 return identifier < rhs.identifier ||
85 (identifier == rhs.identifier && version < rhs.version);
90 return identifier > rhs.identifier ||
91 (identifier == rhs.identifier && version > rhs.version);
95 explicit operator bool()
const 110 inline std::ostream& operator<<(std::ostream& os,
const ObjectVersion& ov)
122 template <
typename P>
123 size_t operator()(
const P& key)
const 125 return hash<uint64_t>()(hash_value(key.version) ^
126 hash_value(key.identifier));
130 #endif // CO_OBJECT_H Defines export visibility macros for library Collage.
bool operator!=(const ObjectVersion &value) const
CO_API ObjectVersion()
Construct a new, zero-initialized object version.
A helper struct bundling an object identifier and version.
CO_API ObjectVersion & operator=(const Object *object)
Assign a new identifier and version.
uint128_t identifier
the object identifier
Object-oriented network library.
bool operator==(const ObjectVersion &value) const
ObjectVersion(lunchbox::RefPtr< R > object)
Construct a new object version.
uint128_t version
the object version
bool operator<(const ObjectVersion &rhs) const
<
bool operator>(const ObjectVersion &rhs) const
<
static const uint128_t VERSION_NONE(0, 0)
Special object version values.