CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
uuid.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_UTIL_UUID_H_
6 #define CVMFS_UTIL_UUID_H_
7 
8 #include <inttypes.h>
9 #include <uuid/uuid.h>
10 
11 #include <string>
12 
13 #include "util/export.h"
14 
15 namespace cvmfs {
16 
26  public:
27  static Uuid *Create(const std::string &store_path);
28  static std::string CreateOneTime();
29  std::string uuid() const { return uuid_; }
30  const unsigned char *data() const {
31  return reinterpret_cast<const unsigned char *>(&uuid_presentation_.uuid);
32  }
33  unsigned size() const { return sizeof(uuid_presentation_.uuid); }
34 
35  private:
36  void MkUuid();
37  Uuid();
38 
39  std::string uuid_;
40  union {
41  uuid_t uuid;
42  struct __attribute__((__packed__)) {
43  uint32_t a;
44  uint16_t b;
45  uint16_t c;
46  uint16_t d;
47  uint32_t e1;
48  uint16_t e2;
49  } split;
50  } uuid_presentation_;
51 };
52 
53 } // namespace cvmfs
54 
55 #endif // CVMFS_UTIL_UUID_H_
static Publisher * Create(const SettingsPublisher &settings)
#define CVMFS_EXPORT
Definition: export.h:11
struct cvmcache_object_info __attribute__
Definition: atomic.h:24
unsigned size() const
Definition: uuid.h:33
std::string uuid() const
Definition: uuid.h:29
uuid_t uuid
Definition: uuid.h:41
std::string uuid_
Definition: uuid.h:39
const unsigned char * data() const
Definition: uuid.h:30