CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
uuid.h
Go to the documentation of this file.
1// -*- C++ -*-
12#ifndef __cxz_uuid_h__
13#define __cxz_uuid_h__
14
15#include <stdint.h>
16#include <functional>
17
18namespace CNORXZ
19{
23 struct Uuid
24 {
27 };
28
30 Uuid mkUuid();
31
36 inline bool operator==(const Uuid& a, const Uuid& b)
37 {
38 return a.i1 == b.i1 and a.i2 == b.i2;
39 }
40
45 inline bool operator!=(const Uuid& a, const Uuid& b)
46 {
47 return a.i1 != b.i1 or a.i2 != b.i2;
48 }
49
54 inline bool operator<(const Uuid& a, const Uuid& b)
55 {
56 return (a.i1 == b.i1) ? a.i2 < b.i2 : a.i1 < b.i1;
57 }
58
63 inline bool operator>(const Uuid& a, const Uuid& b)
64 {
65 return (a.i1 == b.i1) ? a.i2 > b.i2 : a.i1 > b.i1;
66 }
67
72 inline bool operator<=(const Uuid& a, const Uuid& b)
73 {
74 return not( (a.i1 == b.i1) ? a.i2 > b.i2 : a.i1 > b.i1 );
75 }
76
81 inline bool operator>=(const Uuid& a, const Uuid& b)
82 {
83 return not( (a.i1 == b.i1) ? a.i2 < b.i2 : a.i1 < b.i1 );
84 }
85}
86
87#endif
bool operator<(const Uuid &a, const Uuid &b)
Definition uuid.h:54
bool operator!=(const Uuid &a, const Uuid &b)
Definition uuid.h:45
bool operator>=(const Uuid &a, const Uuid &b)
Definition uuid.h:81
Sptr< Range > rangeCast(const RangePtr r)
bool operator>(const Uuid &a, const Uuid &b)
Definition uuid.h:63
bool operator<=(const Uuid &a, const Uuid &b)
Definition uuid.h:72
bool operator==(const Uuid &a, const Uuid &b)
Definition uuid.h:36
Uuid mkUuid()
Definition uuid.cc:38
uint64_t i2
Definition uuid.h:26
uint64_t i1
Definition uuid.h:25