Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
qpid/client/Message.h
Go to the documentation of this file.
00001 #ifndef QPID_CLIENT_MESSAGE_H
00002 #define QPID_CLIENT_MESSAGE_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 
00025 #include "qpid/client/ClientImportExport.h"
00026 #include "qpid/framing/MessageProperties.h"
00027 #include "qpid/framing/DeliveryProperties.h"
00028 #include <string>
00029 
00030 namespace qpid {
00031 
00032 namespace framing {
00033 class FieldTable;
00034 class SequenceNumber;           // FIXME aconway 2009-04-17: remove with getID?
00035 }
00036 
00037 namespace client {
00038 
00039 class MessageImpl;
00040 
00115 class QPID_CLIENT_CLASS_EXTERN Message
00116 {
00117 public:
00122     QPID_CLIENT_EXTERN Message(
00123         const std::string& data=std::string(),
00124         const std::string& routingKey=std::string());
00125     Message(MessageImpl*);    
00126     QPID_CLIENT_EXTERN Message(const Message&);
00127     QPID_CLIENT_EXTERN ~Message();
00128     QPID_CLIENT_EXTERN Message& operator=(const Message&);
00129     QPID_CLIENT_EXTERN void swap(Message&);
00130 
00131     QPID_CLIENT_EXTERN void setData(const std::string&);
00132     QPID_CLIENT_EXTERN const std::string& getData() const;
00133     QPID_CLIENT_EXTERN std::string& getData();
00134 
00135     QPID_CLIENT_EXTERN void appendData(const std::string&);
00136 
00137     QPID_CLIENT_EXTERN bool hasMessageProperties() const;
00138     QPID_CLIENT_EXTERN framing::MessageProperties& getMessageProperties();
00139     QPID_CLIENT_EXTERN const framing::MessageProperties& getMessageProperties() const;
00140 
00141     QPID_CLIENT_EXTERN bool hasDeliveryProperties() const;
00142     QPID_CLIENT_EXTERN framing::DeliveryProperties& getDeliveryProperties();
00143     QPID_CLIENT_EXTERN const framing::DeliveryProperties& getDeliveryProperties() const;
00144 
00145 
00151     QPID_CLIENT_EXTERN std::string getDestination() const;
00152 
00154     QPID_CLIENT_EXTERN bool isRedelivered() const;
00156     QPID_CLIENT_EXTERN void setRedelivered(bool redelivered);
00157 
00159     QPID_CLIENT_EXTERN framing::FieldTable& getHeaders();
00160 
00162     QPID_CLIENT_EXTERN const framing::FieldTable& getHeaders() const;
00163 
00164     // FIXME aconway 2009-04-17: does this need to be in public API?
00166     QPID_CLIENT_EXTERN const framing::SequenceNumber& getId() const;
00167 
00168   private:
00169     MessageImpl* impl;
00170     friend class MessageImpl; // Helper template for implementation
00171 };
00172 
00173 }}
00174 
00175 #endif  

Qpid C++ API Reference
Generated on Thu Aug 23 2012 for Qpid C++ Client API by doxygen 1.7.5