Debian Codegraph @

cpp/src/transfer.cpp

raw
1 /*
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 */
21
22 #include "proton/delivery.hpp"
23
24 #include "proton/connection.hpp"
25 #include "proton/link.hpp"
26 #include "proton/session.hpp"
27
28 #include <proton/delivery.h>
29 #include <proton/link.h>
30 #include <proton/session.h>
31
32 #include "proton_bits.hpp"
33
34 #include <ostream>
35
36 namespace proton {
37
38 session transfer::session() const { return make_wrapper(pn_link_session(pn_delivery_link(pn_object()))); }
39 connection transfer::connection() const { return make_wrapper(pn_session_connection(pn_link_session(pn_delivery_link(pn_object())))); }
40 container& transfer::container() const { return connection().container(); }
41 work_queue& transfer::work_queue() const { return connection().work_queue(); }
42
43
44 bool transfer::settled() const { return pn_delivery_settled(pn_object()); }
45
46 void transfer::settle() { pn_delivery_settle(pn_object()); }
47
48 enum transfer::state transfer::state() const { return static_cast<enum state>(pn_delivery_remote_state(pn_object())); }
49
50 std::string to_string(enum transfer::state s) { return pn_disposition_type_name(s); }
51 std::ostream& operator<<(std::ostream& o, const enum transfer::state s) { return o << to_string(s); }
52 }