Qpid Proton C++ API  0.38.0
source.hpp
Go to the documentation of this file.
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 "./map.hpp"
28 #include "./symbol.hpp"
29 #include "./terminus.hpp"
30 #include "./value.hpp"
31 
32 #include <string>
33 
36 
37 struct pn_terminus_t;
38 
39 namespace proton {
40 
44 class source : public terminus {
45  public:
49 
51  source() = default;
52 
55  // XXX Why is unspecified needed? The protocol doesn't have
56  // it.
58  UNSPECIFIED = PN_DIST_MODE_UNSPECIFIED,
60  COPY = PN_DIST_MODE_COPY,
62  MOVE = PN_DIST_MODE_MOVE
63  };
64 
67 
69  PN_CPP_EXTERN std::string address() const;
70 
72  PN_CPP_EXTERN enum distribution_mode distribution_mode() const;
73 
75  PN_CPP_EXTERN const filter_map& filters() const;
76 
77  private:
78  source(pn_terminus_t* t);
79  source(const sender&);
80  source(const receiver&);
81 
82  filter_map filters_;
83 
85  friend class proton::internal::factory<source>;
86  friend class sender;
87  friend class receiver;
89 };
90 
91 } // proton
92 
93 #endif // PROTON_SOURCE_HPP
A channel for receiving messages.
Definition: receiver.hpp:41
A channel for sending messages.
Definition: sender.hpp:40
A point of origin for messages.
Definition: source.hpp:44
std::string address() const
The address of the source.
const filter_map & filters() const
Unsettled API - Obtain the set of message filters.
source()=default
Create an empty source.
distribution_mode
The policy for distributing messages.
Definition: source.hpp:54
@ UNSPECIFIED
Unspecified.
Definition: source.hpp:58
@ COPY
Once transferred, the message remains available to other links.
Definition: source.hpp:60
@ MOVE
Once transferred, the message is unavailable to other links.
Definition: source.hpp:62
map< symbol, value > filter_map
Unsettled API - A map of AMQP symbol keys and filter specifiers.
Definition: source.hpp:48
One end of a link, either a source or a target.
Definition: terminus.hpp:53
expiry_policy
When expiration of the source or target begins.
Definition: terminus.hpp:74
durability_mode
The persistence mode of the source or target.
Definition: terminus.hpp:64
Forward declarations.
A collection of key-value pairs.
The main Proton namespace.
Definition: annotation_key.hpp:33
A string that represents the AMQP symbol type.
One end of a link, either a source or a target.
A holder for any AMQP value, simple or complex.