ed
include
ed
uuid.h
Go to the documentation of this file.
1
#ifndef ED_UUID_H_
2
#define ED_UUID_H_
3
4
#include "
ed/types.h
"
5
#include <
string
>
6
7
namespace
ed
8
{
9
10
class
UUID
11
{
12
13
public
:
14
15
UUID
() :
idx
(
INVALID_IDX
) {}
16
UUID
(
const
char
* s) :
id_
(s),
idx
(
INVALID_IDX
) {}
17
UUID
(
const
std::string
& s) :
id_
(s),
idx
(
INVALID_IDX
) {}
18
19
inline
bool
operator<
(
const
UUID
& rhs)
const
{
return
id_
< rhs.
id_
; }
20
21
inline
bool
operator==
(
const
UUID
& rhs)
const
{
return
id_
== rhs.
id_
; }
22
23
inline
bool
operator!=
(
const
UUID
& rhs)
const
{
return
id_
!= rhs.
id_
; }
24
25
inline
const
char
*
c_str
()
const
{
return
id_
.
c_str
(); }
26
27
inline
const
std::string
&
str
()
const
{
return
id_
; }
28
29
friend
std::ostream
&
operator<<
(
std::ostream
& out,
const
UUID
& d)
30
{
31
out << d.
id_
;
32
return
out;
33
}
34
35
private
:
36
37
std::string
id_
;
38
39
public
:
40
41
mutable
Idx
idx
;
42
43
};
44
45
}
// end namespace ed
46
47
#endif
ed::UUID::c_str
const char * c_str() const
Definition:
uuid.h:25
std::string
ed::UUID::idx
Idx idx
Definition:
uuid.h:41
types.h
ed::UUID::id_
std::string id_
Definition:
uuid.h:37
ed::UUID::UUID
UUID()
Definition:
uuid.h:15
ed::UUID::UUID
UUID(const char *s)
Definition:
uuid.h:16
ed::UUID::operator!=
bool operator!=(const UUID &rhs) const
Definition:
uuid.h:23
std::ostream
ed::UUID::operator<<
friend std::ostream & operator<<(std::ostream &out, const UUID &d)
Definition:
uuid.h:29
std::string::c_str
T c_str(T... args)
ed::INVALID_IDX
static const Idx INVALID_IDX
Definition:
types.h:22
ed::UUID
Definition:
uuid.h:10
ed::UUID::operator<
bool operator<(const UUID &rhs) const
Definition:
uuid.h:19
ed::UUID::UUID
UUID(const std::string &s)
Definition:
uuid.h:17
ed
Definition:
convex_hull.h:8
ed::UUID::operator==
bool operator==(const UUID &rhs) const
Definition:
uuid.h:21
ed::Idx
uint64_t Idx
Definition:
types.h:21
ed::UUID::str
const std::string & str() const
Definition:
uuid.h:27
string
Generated on Sun Feb 23 2025 04:34:40 for ed by
1.8.17