/opt/workspace/qpid/tags/M2/Final/cpp/lib/client/IncomingMessage.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 #include <string>
00022 #include <vector>
00023 #include <framing/amqp_framing.h>
00024 
00025 #ifndef _IncomingMessage_
00026 #define _IncomingMessage_
00027 
00028 #include <ClientMessage.h>
00029 
00030 namespace qpid {
00031 namespace client {
00032 
00033     class IncomingMessage{
00034         //content will be preceded by one of these method frames
00035         qpid::framing::BasicDeliverBody::shared_ptr delivered;
00036         qpid::framing::BasicReturnBody::shared_ptr returned;
00037         qpid::framing::BasicGetOkBody::shared_ptr response;
00038         qpid::framing::AMQHeaderBody::shared_ptr header;
00039         std::vector<qpid::framing::AMQContentBody::shared_ptr> content;
00040 
00041         u_int64_t contentSize();
00042     public:
00043         IncomingMessage(qpid::framing::BasicDeliverBody::shared_ptr intro);
00044         IncomingMessage(qpid::framing::BasicReturnBody::shared_ptr intro);
00045         IncomingMessage(qpid::framing::BasicGetOkBody::shared_ptr intro);
00046         ~IncomingMessage();
00047         void setHeader(qpid::framing::AMQHeaderBody::shared_ptr header);
00048         void addContent(qpid::framing::AMQContentBody::shared_ptr content);
00049         bool isComplete();
00050         bool isReturn();
00051         bool isDelivery();
00052         bool isResponse();
00053         const std::string& getConsumerTag();//only relevant if isDelivery()
00054         qpid::framing::AMQHeaderBody::shared_ptr& getHeader();
00055         u_int64_t getDeliveryTag();
00056         void getData(std::string& data);
00057     };
00058 
00059 }
00060 }
00061 
00062 
00063 #endif

Generated on Mon Nov 26 19:13:17 2007 for Qpid by  doxygen 1.5.1