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

gen/qpid/framing/FileConsumeBody.h

Go to the documentation of this file.
00001 #ifndef QPID_FRAMING_FILECONSUMEBODY_H
00002 #define QPID_FRAMING_FILECONSUMEBODY_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 FileConsumeBody : public ModelMethod {
00042     string queue;
00043     string consumerTag;
00044     FieldTable arguments;
00045     uint16_t flags;
00046 public:
00047     static const ClassId CLASS_ID = 0x9;
00048     static const MethodId METHOD_ID = 0x3;
00049     FileConsumeBody(
00050         ProtocolVersion, const string& _queue,
00051         const string& _consumerTag,
00052         bool _noLocal,
00053         bool _noAck,
00054         bool _exclusive,
00055         bool _nowait,
00056         const FieldTable& _arguments) : 
00057         queue(_queue),
00058         consumerTag(_consumerTag),
00059         arguments(_arguments),
00060         flags(0){
00061         setNoLocal(_noLocal);
00062         setNoAck(_noAck);
00063         setExclusive(_exclusive);
00064         setNowait(_nowait);
00065         flags |= (1 << 8);
00066         flags |= (1 << 9);
00067         flags |= (1 << 14);
00068     }
00069     FileConsumeBody(ProtocolVersion=ProtocolVersion())  : flags(0) {}
00070     
00071     void setQueue(const string& _queue);
00072     const string& getQueue() const;
00073     bool hasQueue() const;
00074     void clearQueueFlag();
00075     void setConsumerTag(const string& _consumerTag);
00076     const string& getConsumerTag() const;
00077     bool hasConsumerTag() const;
00078     void clearConsumerTagFlag();
00079     void setNoLocal(bool _noLocal);
00080     bool getNoLocal() const;
00081     void setNoAck(bool _noAck);
00082     bool getNoAck() const;
00083     void setExclusive(bool _exclusive);
00084     bool getExclusive() const;
00085     void setNowait(bool _nowait);
00086     bool getNowait() const;
00087     void setArguments(const FieldTable& _arguments);
00088     const FieldTable& getArguments() const;
00089     FieldTable& getArguments();
00090     bool hasArguments() const;
00091     void clearArgumentsFlag();
00092     typedef void ResultType;
00093 
00094     template <class T> ResultType invoke(T& invocable) const {
00095         return invocable.consume(getQueue(), getConsumerTag(), getNoLocal(), getNoAck(), getExclusive(), getNowait(), getArguments());
00096     }
00097 
00098     using  AMQMethodBody::accept;
00099     void accept(MethodBodyConstVisitor& v) const { v.visit(*this); }
00100     boost::intrusive_ptr<AMQBody> clone() const { return BodyFactory::copy(*this); }
00101 
00102     ClassId amqpClassId() const { return CLASS_ID; }
00103     MethodId amqpMethodId() const { return METHOD_ID; }
00104     bool isContentBearing() const { return  false; }
00105     bool resultExpected() const { return  false; }
00106     bool responseExpected() const { return  true; }
00107     void encode(Buffer&) const;
00108     void decode(Buffer&, uint32_t=0);
00109     void encodeStructBody(Buffer&) const;
00110     void decodeStructBody(Buffer&, uint32_t=0);
00111     uint32_t encodedSize() const;
00112     uint32_t bodySize() const;
00113     void print(std::ostream& out) const;
00114 }; /* class FileConsumeBody */
00115 
00116 }}
00117 #endif  

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