/home/aconway/svn/qpid/cpp/gen/qpid/framing/FileDeliverBody.h

00001 /*
00002  *
00003  * Licensed to the Apache Software Foundation (ASF) under one
00004  * or more contributor license agreements.  See the NOTICE file
00005  * distributed with this work for additional information
00006  * regarding copyright ownership.  The ASF licenses this file
00007  * to you under the Apache License, Version 2.0 (the
00008  * "License"); you may not use this file except in compliance
00009  * with the License.  You may obtain a copy of the License at
00010  * 
00011  *   http://www.apache.org/licenses/LICENSE-2.0
00012  * 
00013  * Unless required by applicable law or agreed to in writing,
00014  * software distributed under the License is distributed on an
00015  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00016  * KIND, either express or implied.  See the License for the
00017  * specific language governing permissions and limitations
00018  * under the License.
00019  *
00020  */
00021 
00022 /*
00023  * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
00024  * Supported AMQP versions:
00025  *   0-9
00026  */
00027 
00028 #ifndef qpid_framing_FileDeliverBody__
00029 #define qpid_framing_FileDeliverBody__
00030 
00031 #include <string>
00032 #include <sstream>
00033 
00034 #include "qpid/framing/amqp_types.h"
00035 #include "qpid/framing/AMQRequestBody.h"
00036 #include "qpid/framing/Buffer.h"
00037 #include "qpid/framing/FieldTable.h"
00038 #include "qpid/framing/FramingContent.h"
00039 
00040 namespace qpid
00041 {
00042 namespace framing
00043 {
00044 
00045  
00046 class FileDeliverBody : public AMQRequestBody
00047 {
00048 
00049         // Method field declarations
00050 
00051     string consumerTag;
00052     u_int64_t deliveryTag;
00053     bool redelivered;
00054     string exchange;
00055     string routingKey;
00056     string identifier;
00057      
00058 
00059 public:
00060     static const ClassId CLASS_ID= 70;
00061     static const MethodId METHOD_ID = 80;
00062 
00063     typedef boost::shared_ptr<FileDeliverBody> shared_ptr;
00064 
00065         // Constructors and destructors
00066 
00067     FileDeliverBody(ProtocolVersion version,
00068         const string& consumerTag,
00069         u_int64_t deliveryTag,
00070         bool redelivered,
00071         const string& exchange,
00072         const string& routingKey,
00073         const string& identifier
00074         ) : AMQRequestBody(version), 
00075         consumerTag(consumerTag),
00076         deliveryTag(deliveryTag),
00077         redelivered(redelivered),
00078         exchange(exchange),
00079         routingKey(routingKey),
00080         identifier(identifier)
00081     { }
00082 
00083 
00084     FileDeliverBody(ProtocolVersion version): AMQRequestBody(version) {}
00085     virtual ~FileDeliverBody() {}
00086     
00087     // Attribute get methods
00088 
00089     const string& getConsumerTag() { return consumerTag; }
00090     u_int64_t getDeliveryTag() { return deliveryTag; }
00091     bool getRedelivered() { return redelivered; }
00092     const string& getExchange() { return exchange; }
00093     const string& getRoutingKey() { return routingKey; }
00094     const string& getIdentifier() { return identifier; }
00095 
00096     // Helper methods
00097     
00098     inline void print(std::ostream& out) const
00099     {
00100             printPrefix(out);
00101             out << "FileDeliver: ";
00102         out << "consumerTag=" << consumerTag;
00103         out << "; deliveryTag=" << deliveryTag;
00104         out << "; redelivered=" << redelivered;
00105         out << "; exchange=" << exchange;
00106         out << "; routingKey=" << routingKey;
00107         out << "; identifier=" << identifier;
00108     }
00109 
00110     inline ClassId amqpClassId() const { return CLASS_ID; }
00111     inline MethodId amqpMethodId() const { return METHOD_ID; }
00112 
00113     u_int32_t size() const
00114     {
00115         u_int32_t sz = baseSize();
00116         sz += 1 + consumerTag.length(); /* consumerTag: shortstr */
00117         sz += 8; /* deliveryTag: longlong */
00118         sz += 1; /* redelivered: bit */
00119         sz += 1 + exchange.length(); /* exchange: shortstr */
00120         sz += 1 + routingKey.length(); /* routingKey: shortstr */
00121         sz += 1 + identifier.length(); /* identifier: shortstr */
00122         return sz;
00123     }
00124 
00125     void encodeContent(Buffer&  buffer) const
00126     {
00127         buffer.putShortString(consumerTag); /* consumerTag: shortstr */
00128         buffer.putLongLong(deliveryTag); /* deliveryTag: longlong */
00129         u_int8_t flags_3[1] = {0};
00130         flags_3[0] |= redelivered << 0; /* redelivered: bit */
00131         buffer.putOctet(flags_3[0]);
00132         buffer.putShortString(exchange); /* exchange: shortstr */
00133         buffer.putShortString(routingKey); /* routingKey: shortstr */
00134         buffer.putShortString(identifier); /* identifier: shortstr */
00135     }
00136 
00137     inline void decodeContent(Buffer&  buffer)
00138     {
00139         buffer.getShortString(consumerTag); /* consumerTag: shortstr */
00140         deliveryTag = buffer.getLongLong(); /* deliveryTag: longlong */
00141         u_int8_t flags_3[1];
00142         flags_3[0] = buffer.getOctet();
00143         redelivered = (1 << 0) & flags_3[0]; /* redelivered: bit */
00144         buffer.getShortString(exchange); /* exchange: shortstr */
00145         buffer.getShortString(routingKey); /* routingKey: shortstr */
00146         buffer.getShortString(identifier); /* identifier: shortstr */
00147     }       
00148 
00149 
00150 
00151 }; // class FileDeliverBody
00152 
00153 
00154 } // namespace framing
00155 } // namespace qpid
00156 
00157 #endif
00158 

Generated on Tue Apr 17 14:22:03 2007 for Qpid by  doxygen 1.4.7