Apache Qpid C++ API
Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation

gen/qpid/framing/MessageSubscribeBody.h

Go to the documentation of this file.
00001 #ifndef QPID_FRAMING_MESSAGESUBSCRIBEBODY_H
00002 #define QPID_FRAMING_MESSAGESUBSCRIBEBODY_H
00003 /*
00004  *
00005  * Licensed to the Apache Software Foundation (ASF) under one
00006  * or more contributor license agreements.  See the NOTICE file
00007  * distributed with this work for additional information
00008  * regarding copyright ownership.  The ASF licenses this file
00009  * to you under the Apache License, Version 2.0 (the
00010  * "License"); you may not use this file except in compliance
00011  * with the License.  You may obtain a copy of the License at
00012  *
00013  *   http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing,
00016  * software distributed under the License is distributed on an
00017  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00018  * KIND, either express or implied.  See the License for the
00019  * specific language governing permissions and limitations
00020  * under the License.
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 MessageSubscribeBody : public ModelMethod {
00042     string queue;
00043     string destination;
00044     uint8_t acceptMode;
00045     uint8_t acquireMode;
00046     string resumeId;
00047     uint64_t resumeTtl;
00048     FieldTable arguments;
00049     uint16_t flags;
00050 public:
00051     static const ClassId CLASS_ID = 0x4;
00052     static const MethodId METHOD_ID = 0x7;
00053     MessageSubscribeBody(
00054         ProtocolVersion, const string& _queue,
00055         const string& _destination,
00056         uint8_t _acceptMode,
00057         uint8_t _acquireMode,
00058         bool _exclusive,
00059         const string& _resumeId,
00060         uint64_t _resumeTtl,
00061         const FieldTable& _arguments) : 
00062         queue(_queue),
00063         destination(_destination),
00064         acceptMode(_acceptMode),
00065         acquireMode(_acquireMode),
00066         resumeId(_resumeId),
00067         resumeTtl(_resumeTtl),
00068         arguments(_arguments),
00069         flags(0){
00070         setExclusive(_exclusive);
00071         flags |= (1 << 8);
00072         flags |= (1 << 9);
00073         flags |= (1 << 10);
00074         flags |= (1 << 11);
00075         flags |= (1 << 13);
00076         flags |= (1 << 14);
00077         flags |= (1 << 15);
00078     }
00079     MessageSubscribeBody(ProtocolVersion=ProtocolVersion())  : acceptMode(0), acquireMode(0), resumeTtl(0), flags(0) {}
00080     
00081     void setQueue(const string& _queue);
00082     const string& getQueue() const;
00083     bool hasQueue() const;
00084     void clearQueueFlag();
00085     void setDestination(const string& _destination);
00086     const string& getDestination() const;
00087     bool hasDestination() const;
00088     void clearDestinationFlag();
00089     void setAcceptMode(uint8_t _acceptMode);
00090     uint8_t getAcceptMode() const;
00091     bool hasAcceptMode() const;
00092     void clearAcceptModeFlag();
00093     void setAcquireMode(uint8_t _acquireMode);
00094     uint8_t getAcquireMode() const;
00095     bool hasAcquireMode() const;
00096     void clearAcquireModeFlag();
00097     void setExclusive(bool _exclusive);
00098     bool getExclusive() const;
00099     void setResumeId(const string& _resumeId);
00100     const string& getResumeId() const;
00101     bool hasResumeId() const;
00102     void clearResumeIdFlag();
00103     void setResumeTtl(uint64_t _resumeTtl);
00104     uint64_t getResumeTtl() const;
00105     bool hasResumeTtl() const;
00106     void clearResumeTtlFlag();
00107     void setArguments(const FieldTable& _arguments);
00108     const FieldTable& getArguments() const;
00109     FieldTable& getArguments();
00110     bool hasArguments() const;
00111     void clearArgumentsFlag();
00112     typedef void ResultType;
00113 
00114     template <class T> ResultType invoke(T& invocable) const {
00115         return invocable.subscribe(getQueue(), getDestination(), getAcceptMode(), getAcquireMode(), getExclusive(), getResumeId(), getResumeTtl(), getArguments());
00116     }
00117 
00118     using  AMQMethodBody::accept;
00119     void accept(MethodBodyConstVisitor& v) const { v.visit(*this); }
00120     boost::intrusive_ptr<AMQBody> clone() const { return BodyFactory::copy(*this); }
00121 
00122     ClassId amqpClassId() const { return CLASS_ID; }
00123     MethodId amqpMethodId() const { return METHOD_ID; }
00124     bool isContentBearing() const { return  false; }
00125     bool resultExpected() const { return  false; }
00126     bool responseExpected() const { return  false; }
00127     void encode(Buffer&) const;
00128     void decode(Buffer&, uint32_t=0);
00129     void encodeStructBody(Buffer&) const;
00130     void decodeStructBody(Buffer&, uint32_t=0);
00131     uint32_t encodedSize() const;
00132     uint32_t bodySize() const;
00133     void print(std::ostream& out) const;
00134 }; /* class MessageSubscribeBody */
00135 
00136 }}
00137 #endif  

Qpid C++ API Reference
Generated on Tue Dec 8 15:39:47 2009 for Qpid C++ Client API by doxygen 1.4.7