Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
ObjectId.h
Go to the documentation of this file.
1 /*
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements. See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership. The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License. You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied. See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  */
21 #ifndef _QPID_CONSOLE_OBJECTID_H
22 #define _QPID_CONSOLE_OBJECTID_H
23 
24 #include <iostream>
26 #include "qpid/sys/IntegerTypes.h"
27 
28 namespace qpid {
29 namespace framing {
30  class Buffer;
31 }
32 namespace console {
33 
39  public:
40  ObjectId() : first(0), second(0) {}
41  ObjectId(framing::Buffer& buffer);
42 
43  uint8_t getFlags() const { return (uint8_t)((first & 0xF000000000000000LL) >> 60); }
44  uint16_t getSequence() const { return (uint16_t)((first & 0x0FFF000000000000LL) >> 48); }
45  uint32_t getBrokerBank() const { return (uint32_t)((first & 0x0000FFFFF0000000LL) >> 28); }
46  uint32_t getAgentBank() const { return (uint32_t) (first & 0x000000000FFFFFFFLL); }
47  uint64_t getObject() const { return second; }
48  bool isDurable() const { return getSequence() == 0; }
49  void decode(framing::Buffer& buffer);
50  void encode(framing::Buffer& buffer);
51  void setValue(uint64_t f, uint64_t s) { first = f; second = s; }
52 
53  bool operator==(const ObjectId& other) const;
54  bool operator!=(const ObjectId& other) const;
55  bool operator<(const ObjectId& other) const;
56  bool operator>(const ObjectId& other) const;
57  bool operator<=(const ObjectId& other) const;
58  bool operator>=(const ObjectId& other) const;
59 
60  private:
61  uint64_t first;
62  uint64_t second;
63  };
64 
65  QPID_CONSOLE_EXTERN std::ostream& operator<<(std::ostream& o, const ObjectId& id);
66 }
67 }
68 
69 #endif

Qpid C++ API Reference
Generated on Thu Feb 14 2013 for Qpid C++ Client API by doxygen 1.8.3