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