Qpid C++ Messaging API  0.20
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
72  private:
73  unsigned char bytes[16];
74 };
75 
77 QPID_TYPES_EXTERN bool operator==(const Uuid&, const Uuid&);
79 QPID_TYPES_EXTERN bool operator!=(const Uuid&, const Uuid&);
80 
81 QPID_TYPES_EXTERN bool operator<(const Uuid&, const Uuid&);
82 QPID_TYPES_EXTERN bool operator>(const Uuid&, const Uuid&);
83 QPID_TYPES_EXTERN bool operator<=(const Uuid&, const Uuid&);
84 QPID_TYPES_EXTERN bool operator>=(const Uuid&, const Uuid&);
85 
87 QPID_TYPES_EXTERN std::ostream& operator<<(std::ostream&, Uuid);
88 
90 QPID_TYPES_EXTERN std::istream& operator>>(std::istream&, Uuid&);
91 
92 }} // namespace qpid::types
93 
94 #endif