8 // A more useful uuid type than the one from libuuid.
9 // It uses two uint64 for representation (allowing fast
10 // comparisons and copying), and provide the necessary
11 // operator overloads to use them transparently.
12 struct FLCORE_EXPORT uuid
22 bool operator==( const uuid
& other
) const
24 return hi
== other
.hi
&& lo
== other
.lo
;
27 bool operator!=( const uuid
& other
) const
29 return hi
!= other
.hi
|| lo
!= other
.lo
;
32 // define operator < so it can be used as a key in a map or a set
33 bool operator<( const uuid
& other
) const
44 friend std::ostream
& operator<<( std::ostream
& out
, const uuid
& uuid_
)
51 uuid_union
.fail_uuid
= uuid_
;
53 char tmp
[128]; // Hrmpf... C APIs.
54 uuid_unparse( uuid_union
.uuidlib_uuid
, tmp
);
60 static inline uuid
Generate()
68 uuid_generate( result
.uuidlib_uuid
);
69 return result
.fail_uuid
;