00001 #ifndef QPID_FRAMING_CLUSTERCONNECTIONSESSIONSTATEBODY_H
00002 #define QPID_FRAMING_CLUSTERCONNECTIONSESSIONSTATEBODY_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 ClusterConnectionSessionStateBody : public ModelMethod {
00042 SequenceNumber replayStart;
00043 SequenceNumber commandPoint;
00044 SequenceSet sentIncomplete;
00045 SequenceNumber expected;
00046 SequenceNumber received;
00047 SequenceSet unknownCompleted;
00048 SequenceSet receivedIncomplete;
00049 uint16_t flags;
00050 public:
00051 static const ClassId CLASS_ID = 0x81;
00052 static const MethodId METHOD_ID = 0x1F;
00053 ClusterConnectionSessionStateBody(
00054 ProtocolVersion, const SequenceNumber& _replayStart,
00055 const SequenceNumber& _commandPoint,
00056 const SequenceSet& _sentIncomplete,
00057 const SequenceNumber& _expected,
00058 const SequenceNumber& _received,
00059 const SequenceSet& _unknownCompleted,
00060 const SequenceSet& _receivedIncomplete) :
00061 replayStart(_replayStart),
00062 commandPoint(_commandPoint),
00063 sentIncomplete(_sentIncomplete),
00064 expected(_expected),
00065 received(_received),
00066 unknownCompleted(_unknownCompleted),
00067 receivedIncomplete(_receivedIncomplete),
00068 flags(0){
00069 flags |= (1 << 8);
00070 flags |= (1 << 9);
00071 flags |= (1 << 10);
00072 flags |= (1 << 11);
00073 flags |= (1 << 12);
00074 flags |= (1 << 13);
00075 flags |= (1 << 14);
00076 }
00077 ClusterConnectionSessionStateBody(ProtocolVersion=ProtocolVersion()) : flags(0) {}
00078
00079 void setReplayStart(const SequenceNumber& _replayStart);
00080 SequenceNumber getReplayStart() const;
00081 bool hasReplayStart() const;
00082 void clearReplayStartFlag();
00083 void setCommandPoint(const SequenceNumber& _commandPoint);
00084 SequenceNumber getCommandPoint() const;
00085 bool hasCommandPoint() const;
00086 void clearCommandPointFlag();
00087 void setSentIncomplete(const SequenceSet& _sentIncomplete);
00088 const SequenceSet& getSentIncomplete() const;
00089 bool hasSentIncomplete() const;
00090 void clearSentIncompleteFlag();
00091 void setExpected(const SequenceNumber& _expected);
00092 SequenceNumber getExpected() const;
00093 bool hasExpected() const;
00094 void clearExpectedFlag();
00095 void setReceived(const SequenceNumber& _received);
00096 SequenceNumber getReceived() const;
00097 bool hasReceived() const;
00098 void clearReceivedFlag();
00099 void setUnknownCompleted(const SequenceSet& _unknownCompleted);
00100 const SequenceSet& getUnknownCompleted() const;
00101 bool hasUnknownCompleted() const;
00102 void clearUnknownCompletedFlag();
00103 void setReceivedIncomplete(const SequenceSet& _receivedIncomplete);
00104 const SequenceSet& getReceivedIncomplete() const;
00105 bool hasReceivedIncomplete() const;
00106 void clearReceivedIncompleteFlag();
00107 typedef void ResultType;
00108
00109 template <class T> ResultType invoke(T& invocable) const {
00110 return invocable.sessionState(getReplayStart(), getCommandPoint(), getSentIncomplete(), getExpected(), getReceived(), getUnknownCompleted(), getReceivedIncomplete());
00111 }
00112
00113 using AMQMethodBody::accept;
00114 void accept(MethodBodyConstVisitor& v) const { v.visit(*this); }
00115 boost::intrusive_ptr<AMQBody> clone() const { return BodyFactory::copy(*this); }
00116
00117 ClassId amqpClassId() const { return CLASS_ID; }
00118 MethodId amqpMethodId() const { return METHOD_ID; }
00119 bool isContentBearing() const { return false; }
00120 bool resultExpected() const { return false; }
00121 bool responseExpected() const { return false; }
00122 void encode(Buffer&) const;
00123 void decode(Buffer&, uint32_t=0);
00124 void encodeStructBody(Buffer&) const;
00125 void decodeStructBody(Buffer&, uint32_t=0);
00126 uint32_t encodedSize() const;
00127 uint32_t bodySize() const;
00128 void print(std::ostream& out) const;
00129 };
00130
00131 }}
00132 #endif