Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation
ReplyTo.h
Go to the documentation of this file.
1 #ifndef QPID_FRAMING_REPLYTO_H
2 #define QPID_FRAMING_REPLYTO_H
3 /*
4  *
5  * Licensed to the Apache Software Foundation (ASF) under one
6  * or more contributor license agreements. See the NOTICE file
7  * distributed with this work for additional information
8  * regarding copyright ownership. The ASF licenses this file
9  * to you under the Apache License, Version 2.0 (the
10  * "License"); you may not use this file except in compliance
11  * with the License. You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing,
16  * software distributed under the License is distributed on an
17  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18  * KIND, either express or implied. See the License for the
19  * specific language governing permissions and limitations
20  * under the License.
21  *
22  */
23 
28 
29 
30 
31 #include <ostream>
32 #include "qpid/framing/amqp_types_full.h"
34 #include "qpid/CommonImportExport.h"
35 
36 namespace qpid {
37 namespace framing {
38 
39 class QPID_COMMON_CLASS_EXTERN ReplyTo {
40  std::string exchange;
41  std::string routingKey;
42  uint16_t flags;
43 public:
45  const std::string& _exchange,
46  const std::string& _routingKey) :
47  exchange(_exchange),
48  routingKey(_routingKey),
49  flags(0){
50  flags |= (1 << 8);
51  flags |= (1 << 9);
52  if (exchange.size() >= 256) throw IllegalArgumentException("Value for exchange is too large");
53  if (routingKey.size() >= 256) throw IllegalArgumentException("Value for routingKey is too large");
54  }
55  ReplyTo() : flags(0) {}
56 
57  QPID_COMMON_EXTERN void setExchange(const std::string& _exchange);
58  QPID_COMMON_EXTERN const std::string& getExchange() const;
59  QPID_COMMON_EXTERN bool hasExchange() const;
60  QPID_COMMON_EXTERN void clearExchangeFlag();
61  QPID_COMMON_EXTERN void setRoutingKey(const std::string& _routingKey);
62  QPID_COMMON_EXTERN const std::string& getRoutingKey() const;
63  QPID_COMMON_EXTERN bool hasRoutingKey() const;
64  QPID_COMMON_EXTERN void clearRoutingKeyFlag();
65  QPID_COMMON_EXTERN friend std::ostream& operator<<(std::ostream&, const ReplyTo&);
66  QPID_COMMON_EXTERN void encode(Buffer&) const;
67  QPID_COMMON_EXTERN void decode(Buffer&, uint32_t=0);
68  QPID_COMMON_EXTERN void encodeStructBody(Buffer&) const;
69  QPID_COMMON_EXTERN void decodeStructBody(Buffer&, uint32_t=0);
70  QPID_COMMON_EXTERN uint32_t encodedSize() const;
71  QPID_COMMON_EXTERN uint32_t bodySize() const;
72  QPID_COMMON_EXTERN void print(std::ostream& out) const;
73 }; /* class ReplyTo */
74 
75 }}
76 #endif
ReplyTo(const std::string &_exchange, const std::string &_routingKey)
Definition: ReplyTo.h:44
std::ostream & operator<<(std::ostream &, TypeCode)
void decode(const Message &message, qpid::types::Variant::Map &map, const std::string &encoding=std::string())
Decodes message content into a Variant::Map.
unsigned int uint32_t
Definition: IntegerTypes.h:27
unsigned short uint16_t
Definition: IntegerTypes.h:25
void encode(const qpid::types::Variant::Map &map, Message &message, const std::string &encoding=std::string())
Encodes a Variant::Map into a message.

Qpid C++ API Reference
Generated on Tue Oct 28 2014 for Qpid C++ Client API by doxygen 1.8.5