Qpid Proton C++  0.14.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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 "./value.hpp"
26 #include "./terminus.hpp"
27 #include "./codec/map.hpp"
28 
29 #include "./internal/cached_map.hpp"
30 #include "./internal/export.hpp"
31 #include "./internal/object.hpp"
32 
33 #include <string>
34 
35 namespace proton {
36 
37 class sender;
38 class receiver;
39 
43 class source : public terminus {
44  public:
47  class filter_map : public internal::cached_map<symbol, value> {};
48 
50  source() : terminus() {}
51 
54  // XXX Why is unspecified needed? The protocol doesn't have
55  // it.
57  UNSPECIFIED = PN_DIST_MODE_UNSPECIFIED,
59  COPY = PN_DIST_MODE_COPY,
61  MOVE = PN_DIST_MODE_MOVE
62  };
63 
66 
68  PN_CPP_EXTERN std::string address() const;
69 
71  PN_CPP_EXTERN enum distribution_mode distribution_mode() const;
72 
74  PN_CPP_EXTERN filter_map filters() const;
75 
76  private:
77  source(pn_terminus_t* t);
78  source(const sender&);
79  source(const receiver&);
80 
82  friend class proton::internal::factory<source>;
83  friend class sender;
84  friend class receiver;
86 };
87 
88 } // proton
89 
90 #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:53
One end of a link, either a source or a target.
Definition: terminus.hpp:40
Once transferred, the message is unavailable to other links.
Definition: source.hpp:61
A channel for sending messages.
Definition: sender.hpp:40
enum distribution_mode distribution_mode() const
Get the distribution mode.
A point of origin for messages.
Definition: source.hpp:43
source()
Create an empty source.
Definition: source.hpp:50
Experimental - A map of AMQP symbol keys and filter specifiers.
Definition: source.hpp:47
A channel for receiving messages.
Definition: receiver.hpp:39
std::string address() const
The address of the source.
Once transferred, the message remains available to other links.
Definition: source.hpp:59
enum expiry_policy expiry_policy() const
Get the policy for when expiration begins.
Unspecified.
Definition: source.hpp:57
enum durability_mode durability_mode()
Get the durability flag.
Type traits for mapping between AMQP and C++ types.
Definition: annotation_key.hpp:28