OpenLexocad  28.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 #include <Base/GlobalId_Policy.h>
22 
23 class QUuid;
24 
25 namespace Base
26 {
27 class LX_BASE_EXPORT GlobalId
28 {
29 public:
34  GlobalId(const Base::String& aBase64, bool aCheckBase64 = false);
36  GlobalId(const char* aUniqueId);
37 
38  bool isNull() const;
40  static GlobalId fromQUuid(const QUuid& uuid);
41  static void toQUuid(const GlobalId& in, QUuid& uuid);
42  void toQUuid(QUuid& uuid) const;
43  QUuid toQUuid() const;
46 
47  unsigned int data1;
48  unsigned short data2;
49  unsigned short data3;
50  unsigned char data4[8];
51 
52  bool operator==(const GlobalId& rhs) const;
53  bool operator!=(const GlobalId& rhs) const;
54  bool operator<(const GlobalId& rhs) const;
55  bool operator>(const GlobalId& rhs) const;
56 
57  friend std::size_t hash_value(GlobalId const& b) { return b.hash(); }
58 
59  size_t hash() const;
60 };
61 } // namespace Base
62 
63 namespace std
64 {
65 template <>
66 class hash<Base::GlobalId>
67 {
68 public:
69  size_t operator()(const Base::GlobalId& id) const { return id.hash(); }
70 };
71 } // namespace std
Base::GlobalId::GlobalId
GlobalId(const Base::String &aBase64, bool aCheckBase64=false)
Base::GlobalId::toQUuid
void toQUuid(QUuid &uuid) const
Base::GlobalId::toString
Base::String toString() const
Base::GlobalId::operator>
bool operator>(const GlobalId &rhs) const
std::hash< Base::GlobalId >::operator()
size_t operator()(const Base::GlobalId &id) const
Definition: GlobalId.h:69
Base::GlobalId::data3
unsigned short data3
Definition: GlobalId.h:49
Base::GlobalId::isNull
bool isNull() const
Base::GlobalId::toQUuid
QUuid toQUuid() const
Base::GlobalId::toBase64
Base::String toBase64() const
Base::GlobalId
Definition: GlobalId.h:28
Base::GlobalId::data2
unsigned short data2
Definition: GlobalId.h:48
Base::GlobalId::toQUuid
static void toQUuid(const GlobalId &in, QUuid &uuid)
GlobalId_Policy.h
Base::GlobalId::GlobalId
GlobalId(const char *aUniqueId)
Creates a GlobalId from const char*. Expected format is '{F40650C2-4ACE-4606-89B1-DF4200C40E23}'.
Base::GlobalId::GlobalId
GlobalId()
Creates an empty GlobalId.
Base::GlobalId::createGlobalId
static GlobalId createGlobalId()
Base::GlobalId::operator==
bool operator==(const GlobalId &rhs) const
Base::GlobalId::operator<
bool operator<(const GlobalId &rhs) const
std
Definition: GlobalId.h:64
Base::GlobalId::operator!=
bool operator!=(const GlobalId &rhs) const
Base::GlobalId::hash_value
friend std::size_t hash_value(GlobalId const &b)
Definition: GlobalId.h:57
Base::GlobalId::data1
unsigned int data1
Definition: GlobalId.h:47
Base::String
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:18
Base::GlobalId::fromQUuid
static GlobalId fromQUuid(const QUuid &uuid)
Base::GlobalId::hash
size_t hash() const
Base
Definition: AbstractXMLReader.h:5