Qpid Proton C++  0.17.0
source.hpp
1 #ifndef PROTON_SOURCE_HPP
2 #define PROTON_SOURCE_HPP
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include "./fwd.hpp"
26 #include "./internal/export.hpp"
27 #include "./internal/cached_map.hpp"
28 #include "./symbol.hpp"
29 #include "./terminus.hpp"
30 #include "./value.hpp"
31 
32 #include <string>
33 
34 struct pn_terminus_t;
35 
36 namespace proton {
37 
41 class source : public terminus {
42  public:
45  class filter_map : public internal::cached_map<symbol, value> {};
46 
48  source() : terminus() {}
49 
52  // XXX Why is unspecified needed? The protocol doesn't have
53  // it.
55  UNSPECIFIED = PN_DIST_MODE_UNSPECIFIED,
57  COPY = PN_DIST_MODE_COPY,
59  MOVE = PN_DIST_MODE_MOVE
60  };
61 
64 
66  PN_CPP_EXTERN std::string address() const;
67 
69  PN_CPP_EXTERN enum distribution_mode distribution_mode() const;
70 
72  PN_CPP_EXTERN filter_map filters() const;
73 
74  private:
75  source(pn_terminus_t* t);
76  source(const sender&);
77  source(const receiver&);
78 
80  friend class proton::internal::factory<source>;
81  friend class sender;
82  friend class receiver;
84 };
85 
86 } // proton
87 
88 #endif // PROTON_SOURCE_HPP
filter_map filters() const
Experimental - Obtain the set of message filters.
distribution_mode
The policy for distributing messages.
Definition: source.hpp:51
One end of a link, either a source or a target.
Definition: terminus.hpp:47
Once transferred, the message is unavailable to other links.
Definition: source.hpp:59
A channel for sending messages.
Definition: sender.hpp:35
enum distribution_mode distribution_mode() const
Get the distribution mode.
A point of origin for messages.
Definition: source.hpp:41
source()
Create an empty source.
Definition: source.hpp:48
Experimental - A map of AMQP symbol keys and filter specifiers.
Definition: source.hpp:45
A channel for receiving messages.
Definition: receiver.hpp:37
std::string address() const
The address of the source.
Once transferred, the message remains available to other links.
Definition: source.hpp:57
enum expiry_policy expiry_policy() const
Get the policy for when expiration begins.
Unspecified.
Definition: source.hpp:55
enum durability_mode durability_mode()
Get the durability flag.
The main Proton namespace.
Definition: annotation_key.hpp:30