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_FRAMING_UUID_H
2 #define QPID_FRAMING_UUID_H
3 
4 /*
5  *
6  * Copyright (c) 2006 The Apache Software Foundation
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 
23 #include "qpid/sys/IntegerTypes.h"
24 
25 #include <boost/array.hpp>
26 
27 #include <ostream>
28 #include <istream>
29 
30 namespace qpid {
31 namespace framing {
32 
33 class Buffer;
34 
44 struct Uuid : public boost::array<uint8_t, 16> {
46  QPID_COMMON_EXTERN Uuid(bool unique=false);
47 
49  QPID_COMMON_EXTERN Uuid(const uint8_t* data);
50 
52  QPID_COMMON_EXTERN Uuid(const std::string&);
53 
54  // Default op= and copy ctor are fine.
55  // boost::array gives us ==, < etc.
56 
58  QPID_COMMON_EXTERN void assign(const uint8_t* data);
59 
62 
65 
67  QPID_COMMON_EXTERN bool isNull() const;
68  QPID_COMMON_INLINE_EXTERN operator bool() const { return !isNull(); }
69  QPID_COMMON_INLINE_EXTERN bool operator!() const { return isNull(); }
70 
71  QPID_COMMON_EXTERN void encode(framing::Buffer& buf) const;
74  { return static_cast<uint32_t>(size()); }
75 
77  QPID_COMMON_EXTERN std::string str() const;
78 
79  template <class S> void serialize(S& s) {
80  s.raw(begin(), size());
81  }
82 };
83 
85 QPID_COMMON_EXTERN std::ostream& operator<<(std::ostream&, Uuid);
86 
88 QPID_COMMON_EXTERN std::istream& operator>>(std::istream&, Uuid&);
89 
90 }} // namespace qpid::framing
91 
92 
93 
94 #endif

Qpid C++ API Reference
Generated on Mon Apr 1 2013 for Qpid C++ Client API by doxygen 1.8.3.1