OpenLexocad  27.0
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/GlobalId_Policy.h>
23 #include <Base/String.h>
24 #include <Base/base_defines.h>
25 
26 #include <functional>
27 
28 class QUuid;
29 
30 namespace Base
31 {
33 {
34 public:
35  GlobalId();
36  GlobalId(const Base::String& base64);
37  GlobalId(const char* aUniqueId);
38 
39  bool isNull() const;
40  static GlobalId createGlobalId();
41  static GlobalId fromQUuid(const QUuid& uuid);
42  static void toQUuid(const GlobalId& in, QUuid& uuid);
43  void toQUuid(QUuid& uuid) const;
44  QUuid toQUuid() const;
45  Base::String toBase64() const;
46  Base::String toString() const;
47 
48  unsigned int data1;
49  unsigned short data2;
50  unsigned short data3;
51  unsigned char data4[8];
52 
53  bool operator==(const GlobalId& rhs) const;
54  bool operator!=(const GlobalId& rhs) const;
55  bool operator<(const GlobalId& rhs) const;
56  bool operator>(const GlobalId& rhs) const;
57 
58  friend std::size_t hash_value(GlobalId const& b) { return b.hash(); }
59 
60  size_t hash() const;
61 };
62 } // namespace Base
63 
64 namespace std
65 {
66 template <>
67 class hash<Base::GlobalId>
68 {
69 public:
70  size_t operator()(const Base::GlobalId& id) const { return id.hash(); }
71 };
72 } // namespace std
#define BASE_EXPORT
Definition: base_defines.h:12
unsigned short data3
Definition: GlobalId.h:50
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:64
friend std::size_t hash_value(GlobalId const &b)
Definition: GlobalId.h:58
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:29
size_t hash() const
Definition: GlobalId.h:32
size_t operator()(const Base::GlobalId &id) const
Definition: GlobalId.h:70
unsigned int data1
Definition: GlobalId.h:48
Definition: AbstractXMLReader.h:8
unsigned short data2
Definition: GlobalId.h:49