Qpid Proton C++  0.13.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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  PN_CPP_EXTERN class session session() const;
45 
47  PN_CPP_EXTERN class connection connection() const;
48 
50  PN_CPP_EXTERN class container &container() const;
51 
53  PN_CPP_EXTERN void settle();
54 
56  PN_CPP_EXTERN bool settled() const;
57 
58  protected:
60  enum state {
61  NONE = 0,
62  RECEIVED = PN_RECEIVED,
63  ACCEPTED = PN_ACCEPTED,
64  REJECTED = PN_REJECTED,
65  RELEASED = PN_RELEASED,
66  MODIFIED = PN_MODIFIED
67  }; // AMQP spec 3.4 delivery State
68 
70  void update(enum state state);
71 
73  void settle(enum state s);
74 
76  enum state state() const;
77 
79  friend class internal::factory<transfer>;
81 };
82 
83 } // proton
84 
85 #endif // PROTON_TRANSFER_HPP
A top-level container of connections, sessions, senders, and receivers.
Definition: container.hpp:59
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
void settle()
Settle the delivery; informs the remote end.
The base class for delivery and tracker.
Definition: transfer.hpp:34