Choreonoid  1.8
Uuid.h
Go to the documentation of this file.
1 #ifndef CNOID_UTIL_UUID_H
2 #define CNOID_UTIL_UUID_H
3 
4 #include <string>
5 #include "exportdecl.h"
6 
7 namespace cnoid {
8 
9 class Mapping;
10 
11 class CNOID_EXPORT Uuid
12 {
13 public:
14  Uuid();
15  Uuid(const Uuid& org);
16  Uuid(const std::string& str);
17 
18  bool isNull() const;
19 
20  bool operator==(const Uuid& rhs) const;
21  bool operator!=(const Uuid& rhs) const;
22  bool operator<(const Uuid& rhs) const;
23  bool operator>(const Uuid& rhs) const;
24  bool operator<=(const Uuid& rhs) const;
25  bool operator>=(const Uuid& rhs) const;
26 
27  std::string toString() const;
28 
29  bool read(const Mapping* archive, const char* key);
30  bool read(const Mapping* archive);
31  bool read(const Mapping& archive, const char* key) { return read(&archive, key); }
32  bool read(const Mapping& archive) { return read(&archive); }
33 
34  size_t hash() const;
35 
36 private:
37  unsigned char data[16];
38 };
39 
40 }
41 
42 namespace std {
43 
44 template<> struct hash<cnoid::Uuid>
45 {
46  std::size_t operator()(const cnoid::Uuid& u) const {
47  return u.hash();
48  }
49 };
50 
51 }
52 
53 #endif
cnoid::Mapping
Definition: ValueTree.h:253
cnoid::Uuid::hash
size_t hash() const
Definition: Uuid.cpp:179
cnoid::str
std::string str(const Vector3 &v)
Definition: EigenUtil.cpp:206
cnoid::Uuid::read
bool read(const Mapping &archive)
Definition: Uuid.h:32
cnoid::Uuid::read
bool read(const Mapping &archive, const char *key)
Definition: Uuid.h:31
cnoid::read
bool read(const Mapping *mapping, const std::string &key, Eigen::MatrixBase< Derived > &x)
Definition: EigenArchive.h:43
cnoid::Uuid
Definition: Uuid.h:11
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::operator==
bool operator==(ref_ptr< T > const &a, ref_ptr< U > const &b)
Definition: Referenced.h:211
cnoid::operator!=
bool operator!=(ref_ptr< T > const &a, ref_ptr< U > const &b)
Definition: Referenced.h:216
cnoid::operator<
bool operator<(ref_ptr< T > const &a, ref_ptr< T > const &b)
Definition: Referenced.h:241