00001 #ifndef QPID_FRAMING_CLUSTERUPDATEOFFERBODY_H
00002 #define QPID_FRAMING_CLUSTERUPDATEOFFERBODY_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028
00029
00030 #include "qpid/framing/AMQMethodBody.h"
00031 #include "qpid/framing/AMQP_ServerOperations.h"
00032 #include "qpid/framing/MethodBodyConstVisitor.h"
00033 #include "qpid/framing/ModelMethod.h"
00034
00035 #include <ostream>
00036 #include "qpid/framing/amqp_types_full.h"
00037
00038 namespace qpid {
00039 namespace framing {
00040
00041 class ClusterUpdateOfferBody : public ModelMethod {
00042 uint64_t updatee;
00043 Uuid clusterId;
00044 uint32_t version;
00045 uint16_t flags;
00046 public:
00047 static const ClassId CLASS_ID = 0x80;
00048 static const MethodId METHOD_ID = 0x2;
00049 ClusterUpdateOfferBody(
00050 ProtocolVersion, uint64_t _updatee,
00051 const Uuid& _clusterId,
00052 uint32_t _version) :
00053 updatee(_updatee),
00054 clusterId(_clusterId),
00055 version(_version),
00056 flags(0){
00057 flags |= (1 << 8);
00058 flags |= (1 << 9);
00059 flags |= (1 << 10);
00060 }
00061 ClusterUpdateOfferBody(ProtocolVersion=ProtocolVersion()) : updatee(0), version(0), flags(0) {}
00062
00063 void setUpdatee(uint64_t _updatee);
00064 uint64_t getUpdatee() const;
00065 bool hasUpdatee() const;
00066 void clearUpdateeFlag();
00067 void setClusterId(const Uuid& _clusterId);
00068 const Uuid& getClusterId() const;
00069 bool hasClusterId() const;
00070 void clearClusterIdFlag();
00071 void setVersion(uint32_t _version);
00072 uint32_t getVersion() const;
00073 bool hasVersion() const;
00074 void clearVersionFlag();
00075 typedef void ResultType;
00076
00077 template <class T> ResultType invoke(T& invocable) const {
00078 return invocable.updateOffer(getUpdatee(), getClusterId(), getVersion());
00079 }
00080
00081 using AMQMethodBody::accept;
00082 void accept(MethodBodyConstVisitor& v) const { v.visit(*this); }
00083 boost::intrusive_ptr<AMQBody> clone() const { return BodyFactory::copy(*this); }
00084
00085 ClassId amqpClassId() const { return CLASS_ID; }
00086 MethodId amqpMethodId() const { return METHOD_ID; }
00087 bool isContentBearing() const { return false; }
00088 bool resultExpected() const { return false; }
00089 bool responseExpected() const { return false; }
00090 void encode(Buffer&) const;
00091 void decode(Buffer&, uint32_t=0);
00092 void encodeStructBody(Buffer&) const;
00093 void decodeStructBody(Buffer&, uint32_t=0);
00094 uint32_t encodedSize() const;
00095 uint32_t bodySize() const;
00096 void print(std::ostream& out) const;
00097 };
00098
00099 }}
00100 #endif