Qpid Proton C++ API  0.18.1
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 
33 
34 struct pn_delivery_t;
35 
36 namespace proton {
37 
39 class transfer : public internal::object<pn_delivery_t> {
41  transfer(pn_delivery_t* d) : internal::object<pn_delivery_t>(d) {}
43 
44  public:
46  transfer() : internal::object<pn_delivery_t>(0) {}
47 
49  enum state {
50  NONE = 0,
51  RECEIVED = PN_RECEIVED,
52  ACCEPTED = PN_ACCEPTED,
53  REJECTED = PN_REJECTED,
54  RELEASED = PN_RELEASED,
55  MODIFIED = PN_MODIFIED
56  }; // AMQP spec 3.4 delivery State
57 
59  PN_CPP_EXTERN enum state state() const;
60 
62  PN_CPP_EXTERN class session session() const;
63 
65  PN_CPP_EXTERN class connection connection() const;
66 
68  PN_CPP_EXTERN class work_queue& work_queue() const;
69 
71  PN_CPP_EXTERN class container &container() const;
72 
74  PN_CPP_EXTERN void settle();
75 
77  PN_CPP_EXTERN bool settled() const;
78 
80  friend class internal::factory<transfer>;
82 };
83 
84 } // proton
85 
86 #endif // PROTON_TRANSFER_HPP
A top-level container of connections, sessions, and links.
Definition: container.hpp:55
Unknown state.
Definition: transfer.hpp:50
Forward declarations.
class work_queue & work_queue() const
Get the work_queue for the transfer.
A connection to a remote AMQP peer.
Definition: connection.hpp:43
enum state state() const
Get the remote state for a delivery.
A container of senders and receivers.
Definition: session.hpp:41
transfer()
Create an empty transfer.
Definition: transfer.hpp:46
state
Delivery state values.
Definition: transfer.hpp:49
void settle()
Settle the delivery; informs the remote end.
The base class for delivery and tracker.
Definition: transfer.hpp:39
class container & container() const
Return the container for this transfer.
Settled as accepted.
Definition: transfer.hpp:52
Unsettled API - A context for thread-safe execution of work.
Definition: work_queue.hpp:339
Received but not yet settled.
Definition: transfer.hpp:51
Settled as rejected.
Definition: transfer.hpp:53
The main Proton namespace.
Definition: annotation_key.hpp:33
bool settled() const
Return true if the transfer has been settled.
Settled as released.
Definition: transfer.hpp:54
Settled as modified.
Definition: transfer.hpp:55