Ocular Engine
UUID.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_CORE_UUID__H__
19 #define __H__OCULAR_CORE_UUID__H__
20 
21 #include "Utilities/Types.hpp"
22 
23 #include <cstdint>
24 #include <string>
25 
26 //------------------------------------------------------------------------------------------
27 
32 namespace Ocular
33 {
38  namespace Core
39  {
40  struct UUID_Internal;
41 
45  class UUID
46  {
47  public:
48 
49  UUID(std::string const& uuid);
50  UUID(UUID const& other);
51  UUID();
52 
53  ~UUID();
54 
55  UUID& operator=(UUID const&);
56  bool operator==(UUID const&) const;
57  bool operator!=(UUID const&) const;
58 
59  //------------------------------------------------------------
60 
65  void set(std::string const& uuid);
66 
73  uint8_t getData(uint32_t const index) const;
74 
86  std::string const& toString() const;
87 
95  uint32_t getHash32() const;
96 
104  uint64_t getHash64() const;
105 
106  protected:
107 
108  UUID_Internal* m_Internal;
109 
110  uint32_t m_Hash32;
111  uint64_t m_Hash64;
112 
113  std::string m_String;
114 
115  private:
116  };
117  }
121 }
126 OCULAR_REGISTER_TYPE_CUSTOM(Ocular::Core::UUID, "UUID");
127 
128 //------------------------------------------------------------------------------------------
129 
130 #endif
uint8_t getData(uint32_t const index) const
Definition: UUID.cpp:156
uint64_t getHash64() const
Definition: UUID.cpp:171
uint32_t getHash32() const
Definition: UUID.cpp:166
std::string const & toString() const
Definition: UUID.cpp:161
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
Definition: UUID.cpp:74
Definition: UUID.hpp:45
void set(std::string const &uuid)
Definition: UUID.cpp:147