Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET | Apache Qpid Documentation |
00001 #ifndef QPID_MESSAGING_MESSAGE_H 00002 #define QPID_MESSAGING_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 <string> 00026 #include "qpid/messaging/Variant.h" 00027 #include "qpid/client/ClientImportExport.h" 00028 00029 namespace qpid { 00030 namespace client { 00031 } 00032 00033 namespace messaging { 00034 00035 struct Address; 00036 class Codec; 00037 struct MessageImpl; 00038 00042 class Message 00043 { 00044 public: 00045 QPID_CLIENT_EXTERN Message(const std::string& bytes = std::string()); 00046 QPID_CLIENT_EXTERN Message(const char*, size_t); 00047 QPID_CLIENT_EXTERN Message(const Message&); 00048 QPID_CLIENT_EXTERN ~Message(); 00049 00050 QPID_CLIENT_EXTERN Message& operator=(const Message&); 00051 00052 QPID_CLIENT_EXTERN void setReplyTo(const Address&); 00053 QPID_CLIENT_EXTERN const Address& getReplyTo() const; 00054 00055 QPID_CLIENT_EXTERN void setSubject(const std::string&); 00056 QPID_CLIENT_EXTERN const std::string& getSubject() const; 00057 00058 QPID_CLIENT_EXTERN void setContentType(const std::string&); 00059 QPID_CLIENT_EXTERN const std::string& getContentType() const; 00060 00061 QPID_CLIENT_EXTERN const VariantMap& getHeaders() const; 00062 QPID_CLIENT_EXTERN VariantMap& getHeaders(); 00063 00064 QPID_CLIENT_EXTERN const std::string& getContent() const; 00065 QPID_CLIENT_EXTERN std::string& getContent(); 00066 QPID_CLIENT_EXTERN void setContent(const std::string&); 00067 QPID_CLIENT_EXTERN void setContent(const char* chars, size_t count); 00068 QPID_CLIENT_EXTERN void getContent(std::pair<const char*, size_t>& content) const; 00069 00070 private: 00071 MessageImpl* impl; 00072 friend struct MessageImplAccess; 00073 }; 00074 }} // namespace qpid::messaging 00075 00076 #endif