00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _QPID_CONSOLE_OBJECTID_H
00022 #define _QPID_CONSOLE_OBJECTID_H
00023
00024 #include <iostream>
00025 #include "qpid/console/ConsoleImportExport.h"
00026 #include "qpid/sys/IntegerTypes.h"
00027
00028 namespace qpid {
00029 namespace framing {
00030 class Buffer;
00031 }
00032 namespace console {
00033
00038 class QPID_CONSOLE_EXTERN ObjectId {
00039 public:
00040 ObjectId() : first(0), second(0) {}
00041 ObjectId(framing::Buffer& buffer);
00042
00043 uint8_t getFlags() const { return (first & 0xF000000000000000LL) >> 60; }
00044 uint16_t getSequence() const { return (first & 0x0FFF000000000000LL) >> 48; }
00045 uint32_t getBrokerBank() const { return (first & 0x0000FFFFF0000000LL) >> 28; }
00046 uint32_t getAgentBank() const { return first & 0x000000000FFFFFFFLL; }
00047 uint64_t getObject() const { return second; }
00048 bool isDurable() const { return getSequence() == 0; }
00049 void decode(framing::Buffer& buffer);
00050 void encode(framing::Buffer& buffer);
00051 void setValue(uint64_t f, uint64_t s) { first = f; second = s; }
00052
00053 bool operator==(const ObjectId& other) const;
00054 bool operator!=(const ObjectId& other) const;
00055 bool operator<(const ObjectId& other) const;
00056 bool operator>(const ObjectId& other) const;
00057 bool operator<=(const ObjectId& other) const;
00058 bool operator>=(const ObjectId& other) const;
00059
00060 private:
00061 uint64_t first;
00062 uint64_t second;
00063 };
00064
00065 QPID_CONSOLE_EXTERN std::ostream& operator<<(std::ostream& o, const ObjectId& id);
00066 }
00067 }
00068
00069 #endif