Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
Uuid.h
Go to the documentation of this file.
1 #ifndef QPID_TYPES_UUID_H
2 #define QPID_TYPES_UUID_H
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
26 #include <iosfwd>
27 #include <string>
28 
29 namespace qpid {
30 namespace types {
31 
33 {
34  public:
35  static const size_t SIZE;
40  QPID_TYPES_EXTERN Uuid(bool unique=false);
41  QPID_TYPES_EXTERN Uuid(const Uuid&);
42  QPID_TYPES_EXTERN Uuid& operator=(const Uuid&);
44  QPID_TYPES_EXTERN Uuid(const unsigned char* data16);
45 
47  QPID_TYPES_EXTERN void generate();
48 
50  QPID_TYPES_EXTERN void clear();
51 
53  QPID_TYPES_EXTERN bool isNull() const;
54  QPID_TYPES_EXTERN operator bool() const;
55  QPID_TYPES_EXTERN bool operator!() const;
56 
58  QPID_TYPES_EXTERN std::string str() const;
59 
60  QPID_TYPES_EXTERN size_t size() const;
61  QPID_TYPES_EXTERN const unsigned char* data() const;
62 
63  friend QPID_TYPES_EXTERN bool operator==(const Uuid&, const Uuid&);
64  friend QPID_TYPES_EXTERN bool operator!=(const Uuid&, const Uuid&);
65  friend QPID_TYPES_EXTERN bool operator<(const Uuid&, const Uuid&);
66  friend QPID_TYPES_EXTERN bool operator>(const Uuid&, const Uuid&);
67  friend QPID_TYPES_EXTERN bool operator<=(const Uuid&, const Uuid&);
68  friend QPID_TYPES_EXTERN bool operator>=(const Uuid&, const Uuid&);
69  friend QPID_TYPES_EXTERN std::ostream& operator<<(std::ostream&, Uuid);
70  friend QPID_TYPES_EXTERN std::istream& operator>>(std::istream&, Uuid&);
71 
73  QPID_TYPES_EXTERN size_t hash() const;
74 
76  struct Hasher {
77  size_t operator()(const Uuid& u) const { return u.hash(); }
78  };
79 
80  private:
81  unsigned char bytes[16];
82 };
83 
85 QPID_TYPES_EXTERN bool operator==(const Uuid&, const Uuid&);
87 QPID_TYPES_EXTERN bool operator!=(const Uuid&, const Uuid&);
88 
89 QPID_TYPES_EXTERN bool operator<(const Uuid&, const Uuid&);
90 QPID_TYPES_EXTERN bool operator>(const Uuid&, const Uuid&);
91 QPID_TYPES_EXTERN bool operator<=(const Uuid&, const Uuid&);
92 QPID_TYPES_EXTERN bool operator>=(const Uuid&, const Uuid&);
93 
95 QPID_TYPES_EXTERN std::ostream& operator<<(std::ostream&, Uuid);
96 
98 QPID_TYPES_EXTERN std::istream& operator>>(std::istream&, Uuid&);
99 
100 }} // namespace qpid::types
101 
102 
103 #endif
QPID_TYPES_EXTERN bool operator<=(const Uuid &, const Uuid &)
static const size_t SIZE
Definition: Uuid.h:35
QPID_TYPES_EXTERN bool operator<(const Uuid &, const Uuid &)
QPID_TYPES_EXTERN bool operator==(const Uuid &, const Uuid &)
Returns true if the uuids are equal, false otherwise.
QPID_TYPES_EXTERN size_t hash() const
Hash value suitable for use with unordered_map.
QPID_TYPES_EXTERN bool operator>=(const Uuid &, const Uuid &)
QPID_TYPES_EXTERN std::istream & operator>>(std::istream &, Uuid &)
Read from format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb.
QPID_TYPES_EXTERN bool operator>(const Uuid &, const Uuid &)
size_t operator()(const Uuid &u) const
Definition: Uuid.h:77
Hasher for use with unordered_map.
Definition: Uuid.h:76
#define QPID_TYPES_EXTERN
Definition: ImportExport.h:30
QPID_TYPES_EXTERN bool operator!=(const Uuid &, const Uuid &)
Returns true if the uuids are NOT equal, false if they are.
#define QPID_TYPES_CLASS_EXTERN
Definition: ImportExport.h:31
QPID_TYPES_EXTERN std::ostream & operator<<(std::ostream &, Uuid)
Print in format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb.

Qpid C++ API Reference
Generated on Mon Sep 1 2014 for Qpid C++ Client API by doxygen 1.8.6