Qpid Proton C++  0.14.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 "./internal/export.hpp"
26 #include "./internal/object.hpp"
27 
28 #include <proton/delivery.h>
29 #include <proton/disposition.h>
30 
31 namespace proton {
32 
34 class transfer : public internal::object<pn_delivery_t> {
36  transfer(pn_delivery_t* d) : internal::object<pn_delivery_t>(d) {}
38 
39  public:
41  transfer() : internal::object<pn_delivery_t>(0) {}
42 
44  enum state {
45  NONE = 0,
46  RECEIVED = PN_RECEIVED,
47  ACCEPTED = PN_ACCEPTED,
48  REJECTED = PN_REJECTED,
49  RELEASED = PN_RELEASED,
50  MODIFIED = PN_MODIFIED
51  }; // AMQP spec 3.4 delivery State
52 
54  PN_CPP_EXTERN enum state state() const;
55 
57  PN_CPP_EXTERN class session session() const;
58 
60  PN_CPP_EXTERN class connection connection() const;
61 
63  PN_CPP_EXTERN class container &container() const;
64 
66  PN_CPP_EXTERN void settle();
67 
69  PN_CPP_EXTERN bool settled() const;
70 
72  friend class internal::factory<transfer>;
74 };
75 
76 } // proton
77 
78 #endif // PROTON_TRANSFER_HPP
A top-level container of connections, sessions, senders, and receivers.
Definition: container.hpp:62
Unknown state.
Definition: transfer.hpp:45
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:48
A container of senders and receivers.
Definition: session.hpp:46
transfer()
Create an empty transfer.
Definition: transfer.hpp:41
state
Delivery state values.
Definition: transfer.hpp:44
void settle()
Settle the delivery; informs the remote end.
The base class for delivery and tracker.
Definition: transfer.hpp:34
Settled as accepted.
Definition: transfer.hpp:47
Received but not yet settled.
Definition: transfer.hpp:46
enum state state() const
Get the remote state for a delivery.
Settled as rejected.
Definition: transfer.hpp:48
Type traits for mapping between AMQP and C++ types.
Definition: annotation_key.hpp:28
Settled as released.
Definition: transfer.hpp:49
Settled as modified.
Definition: transfer.hpp:50