20 #ifndef CO_OBJECTVERSION_H
21 #define CO_OBJECTVERSION_H
25 #include <lunchbox/bitOperation.h>
26 #include <lunchbox/stdExt.h>
32 static const uint128_t VERSION_NONE( 0, 0 );
33 static const uint128_t VERSION_FIRST( 0, 1 );
34 static const uint128_t VERSION_NEWEST( 0, 0xfffffffffffffffbull );
35 static const uint128_t VERSION_OLDEST( 0, 0xfffffffffffffffcull );
36 static const uint128_t VERSION_NEXT( 0, 0xfffffffffffffffdull );
37 static const uint128_t VERSION_INVALID( 0, 0xfffffffffffffffeull );
38 static const uint128_t VERSION_HEAD( 0, 0xffffffffffffffffull );
60 { *
this =
object.get(); }
81 return identifier < rhs.identifier ||
82 ( identifier == rhs.identifier && version < rhs.version );
87 return identifier > rhs.identifier ||
88 ( identifier == rhs.identifier && version > rhs.version );
95 inline std::ostream& operator << (std::ostream& os,
const ObjectVersion& ov)
104 lunchbox::byteswap( value.
version );
108 LB_STDEXT_NAMESPACE_OPEN
109 #ifdef LB_STDEXT_MSVC
112 inline size_t hash_compare< co::ObjectVersion >::operator()
115 const size_t hashVersion = hash_value( key.version );
116 const size_t hashID = hash_value( key.identifier );
118 return hash_value( hashVersion ^ hashID );
122 template<>
struct hash< co::ObjectVersion >
124 template<
typename P >
size_t operator()(
const P& key )
const
126 return hash< uint64_t >()( hash_value( key.version ) ^
127 hash_value( key.identifier ));
131 LB_STDEXT_NAMESPACE_CLOSE
133 #endif // CO_OBJECT_H
Defines export visibility macros for 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
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
<