OpenLexocad  27.1
GlobalId.h
Go to the documentation of this file.
1 // //
3 // LEXOCAD API //
4 // //
5 // ©2005-2017 Cadwork Informatik. All rights reserved. //
6 // //
7 // ONLY INCLUDE OTHER INTERFACES! //
8 // Lexocad provides API Classes for public use and //
9 // Implementation Classes for private use. //
10 // //
11 // - Do ONLY include and use the LEXOCAD API in this header. //
12 // - Do not change existing interfaces. //
13 // - Document your code! //
14 // //
15 // - All types from Base, Core, Geom, Topo are allowed here. //
16 // - In the Gui modules the use of Qt types is allowed. //
17 // //
19 
20 #pragma once
21 
22 #include <Base/String.h>
23 #include <Base/GlobalId_Policy.h>
24 
25 class QUuid;
26 
27 namespace Base
28 {
29 class LX_BASE_EXPORT GlobalId
30 {
31 public:
32  GlobalId();
33  GlobalId(const Base::String& base64);
34  GlobalId(const char* aUniqueId);
35 
36  bool isNull() const;
37  static GlobalId createGlobalId();
38  static GlobalId fromQUuid(const QUuid& uuid);
39  static void toQUuid(const GlobalId& in, QUuid& uuid);
40  void toQUuid(QUuid& uuid) const;
41  QUuid toQUuid() const;
42  Base::String toBase64() const;
43  Base::String toString() const;
44 
45  unsigned int data1;
46  unsigned short data2;
47  unsigned short data3;
48  unsigned char data4[8];
49 
50  bool operator==(const GlobalId& rhs) const;
51  bool operator!=(const GlobalId& rhs) const;
52  bool operator<(const GlobalId& rhs) const;
53  bool operator>(const GlobalId& rhs) const;
54 
55  friend std::size_t hash_value(GlobalId const& b) { return b.hash(); }
56 
57  size_t hash() const;
58 };
59 } // namespace Base
60 
61 namespace std
62 {
63 template <>
64 class hash<Base::GlobalId>
65 {
66 public:
67  size_t operator()(const Base::GlobalId& id) const { return id.hash(); }
68 };
69 } // namespace std
unsigned short data3
Definition: GlobalId.h:47
constexpr bool operator!=(const basic_hashed_string< Char > &lhs, const basic_hashed_string< Char > &rhs) ENTT_NOEXCEPT
Compares two hashed strings.
Definition: entt.hpp:570
Definition: GlobalId.h:61
friend std::size_t hash_value(GlobalId const &b)
Definition: GlobalId.h:55
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:23
size_t hash() const
Definition: GlobalId.h:29
size_t operator()(const Base::GlobalId &id) const
Definition: GlobalId.h:67
unsigned int data1
Definition: GlobalId.h:45
Definition: AbstractXMLReader.h:5
unsigned short data2
Definition: GlobalId.h:46