Qpid Proton C++ API 0.39.0
 
Loading...
Searching...
No Matches
transfer.hpp
Go to the documentation of this file.
1#ifndef PROTON_TRANSFER_HPP
2#define PROTON_TRANSFER_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/object.hpp"
28
29#include <proton/disposition.h>
30#include <iosfwd>
31
34
35struct pn_delivery_t;
36
37namespace proton {
38
40class transfer : public internal::object<pn_delivery_t> {
42 transfer(pn_delivery_t* d) : internal::object<pn_delivery_t>(d) {}
44
45 public:
47 transfer() : internal::object<pn_delivery_t>(0) {}
48
50 enum state {
51 NONE = 0,
52 RECEIVED = PN_RECEIVED,
53 ACCEPTED = PN_ACCEPTED,
54 REJECTED = PN_REJECTED,
55 RELEASED = PN_RELEASED,
56 MODIFIED = PN_MODIFIED
57 }; // AMQP spec 3.4 delivery State
58
60 PN_CPP_EXTERN enum state state() const;
61
63 PN_CPP_EXTERN class session session() const;
64
66 PN_CPP_EXTERN class connection connection() const;
67
69 PN_CPP_EXTERN class work_queue& work_queue() const;
70
72 PN_CPP_EXTERN class container &container() const;
73
75 PN_CPP_EXTERN void settle();
76
78 PN_CPP_EXTERN bool settled() const;
79
81 PN_CPP_EXTERN void user_data(void* user_data) const;
82
84 PN_CPP_EXTERN void* user_data() const;
85
87 friend class internal::factory<transfer>;
89};
90
92PN_CPP_EXTERN std::string to_string(enum transfer::state);
94PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const enum transfer::state);
95
96} // proton
97
98#endif // PROTON_TRANSFER_HPP
A connection to a remote AMQP peer.
Definition: connection.hpp:47
A top-level container of connections, sessions, and links.
Definition: container.hpp:50
A container of senders and receivers.
Definition: session.hpp:42
The base class for delivery and tracker.
Definition: transfer.hpp:40
void settle()
Settle the delivery; informs the remote end.
void * user_data() const
Get user data from this transfer.
transfer()
Create an empty transfer.
Definition: transfer.hpp:47
enum state state() const
Get the remote state for a delivery.
class work_queue & work_queue() const
Get the work_queue for the transfer.
void user_data(void *user_data) const
Set user data on this transfer.
class container & container() const
Return the container for this transfer.
bool settled() const
Return true if the transfer has been settled.
state
Delivery state values.
Definition: transfer.hpp:50
@ RECEIVED
Received but not yet settled.
Definition: transfer.hpp:52
@ MODIFIED
Settled as modified.
Definition: transfer.hpp:56
@ ACCEPTED
Settled as accepted.
Definition: transfer.hpp:53
@ RELEASED
Settled as released.
Definition: transfer.hpp:55
@ NONE
Unknown state.
Definition: transfer.hpp:51
@ REJECTED
Settled as rejected.
Definition: transfer.hpp:54
Unsettled API - A context for thread-safe execution of work.
Definition: work_queue.hpp:327
Forward declarations.
The main Proton namespace.
Definition: annotation_key.hpp:33
std::string to_string(const message &)
Human readable string representation.
std::ostream & operator<<(std::ostream &, const binary &)
Print a binary value.