Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
00001 #ifndef QPID_CLIENT_MESSAGEIMPL_H 00002 #define QPID_CLIENT_MESSAGEIMPL_H 00003 00004 /* 00005 * 00006 * Licensed to the Apache Software Foundation (ASF) under one 00007 * or more contributor license agreements. See the NOTICE file 00008 * distributed with this work for additional information 00009 * regarding copyright ownership. The ASF licenses this file 00010 * to you under the Apache License, Version 2.0 (the 00011 * "License"); you may not use this file except in compliance 00012 * with the License. You may obtain a copy of the License at 00013 * 00014 * http://www.apache.org/licenses/LICENSE-2.0 00015 * 00016 * Unless required by applicable law or agreed to in writing, 00017 * software distributed under the License is distributed on an 00018 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00019 * KIND, either express or implied. See the License for the 00020 * specific language governing permissions and limitations 00021 * under the License. 00022 * 00023 */ 00024 #include "Message.h" 00025 #include "qpid/client/Session.h" 00026 #include "qpid/framing/MessageTransferBody.h" 00027 #include "qpid/framing/TransferContent.h" 00028 #include <string> 00029 00030 namespace qpid { 00031 namespace client { 00032 00033 class MessageImpl : public framing::TransferContent 00034 { 00035 public: 00040 MessageImpl(const std::string& data=std::string(), 00041 const std::string& routingKey=std::string()); 00042 00048 std::string getDestination() const; 00049 00051 bool isRedelivered() const; 00053 void setRedelivered(bool redelivered); 00054 00056 framing::FieldTable& getHeaders(); 00057 00059 const framing::FieldTable& getHeaders() const; 00060 00062 const framing::MessageTransferBody& getMethod() const; 00064 const framing::SequenceNumber& getId() const; 00065 00067 MessageImpl(const framing::FrameSet& frameset); 00068 00069 static MessageImpl* get(Message& m) { return m.impl; } 00070 static const MessageImpl* get(const Message& m) { return m.impl; } 00071 00072 private: 00073 //method and id are only set for received messages: 00074 framing::MessageTransferBody method; 00075 framing::SequenceNumber id; 00076 }; 00077 00078 }} 00079 00080 #endif