Qpid Proton C++ API 0.41.1
Loading...
Searching...
No Matches
receiver.hpp
Go to the documentation of this file.
1#ifndef PROTON_RECEIVER_HPP
2#define PROTON_RECEIVER_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 "./delivery.hpp"
26#include "./fwd.hpp"
27#include "./internal/export.hpp"
28#include "./link.hpp"
29
30#include <proton/type_compat.h>
31
32struct pn_link_t;
33struct pn_session_t;
34
37
38namespace proton {
39
41class
42PN_CPP_CLASS_EXTERN receiver : public link {
44 PN_CPP_EXTERN receiver(pn_link_t* r);
46
47 public:
49 receiver() = default;
50
51 PN_CPP_EXTERN ~receiver();
52
54 PN_CPP_EXTERN void open();
55
57 PN_CPP_EXTERN void open(const receiver_options &opts);
58
60 PN_CPP_EXTERN class source source() const;
61
63 PN_CPP_EXTERN class target target() const;
64
68 PN_CPP_EXTERN void add_credit(uint32_t);
69
78 PN_CPP_EXTERN void drain();
79
82 PN_CPP_EXTERN delivery_range unsettled_deliveries() const;
83
85 friend class internal::factory<receiver>;
86 friend class receiver_iterator;
88};
89
91
93class receiver_iterator : public internal::iter_base<receiver, receiver_iterator> {
94 explicit receiver_iterator(receiver r, pn_session_t* s = nullptr) :
95 internal::iter_base<receiver, receiver_iterator>(r), session_(s) {}
96
97 public:
99 explicit receiver_iterator() :
100 internal::iter_base<receiver, receiver_iterator>(nullptr), session_(nullptr) {}
101
103 PN_CPP_EXTERN receiver_iterator operator++();
104
105 private:
106 pn_session_t* session_;
107
108 friend class connection;
109 friend class session;
110};
111
113typedef internal::iter_range<receiver_iterator> receiver_range;
114
116
117} // proton
118
119#endif // PROTON_RECEIVER_HPP
Options for creating a receiver.
Definition receiver_options.hpp:59
A channel for receiving messages.
Definition receiver.hpp:42
delivery_range unsettled_deliveries() const
Unsettled API - Get a range of unsettled deliveries on this receiver.
class target target() const
Get the target node.
void add_credit(uint32_t)
Increment the credit available to the sender.
void open(const receiver_options &opts)
Open the receiver.
class source source() const
Get the source node.
void open()
Open the receiver.
receiver()=default
Create an empty receiver.
void drain()
Unsettled API - Commence a drain cycle.
A received message.
Forward declarations.
The main Proton namespace.
Definition annotation_key.hpp:33