Qpid Proton C++ API  0.38.0
link.hpp
Go to the documentation of this file.
1 #ifndef PROTON_LINK_HPP
2 #define PROTON_LINK_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 "./endpoint.hpp"
28 #include "./internal/object.hpp"
29 
30 #include <map>
31 #include <string>
32 
35 
36 struct pn_link_t;
37 
38 namespace proton {
39 
42 class
43 PN_CPP_CLASS_EXTERN link : public internal::object<pn_link_t> , public endpoint {
45  link(pn_link_t* l) : internal::object<pn_link_t>(l) {}
47 
48  public:
50  link() : internal::object<pn_link_t>(0) {}
51 
52  PN_CPP_EXTERN bool uninitialized() const;
53  PN_CPP_EXTERN bool active() const;
54  PN_CPP_EXTERN bool closed() const;
55 
56  PN_CPP_EXTERN class error_condition error() const;
57 
58  PN_CPP_EXTERN void close();
59  PN_CPP_EXTERN void close(const error_condition&);
60 
65  // XXX Should take error condition
66  PN_CPP_EXTERN void detach();
67 
69  PN_CPP_EXTERN int credit() const;
70 
77  PN_CPP_EXTERN bool draining();
78 
80  PN_CPP_EXTERN std::string name() const;
81 
83  PN_CPP_EXTERN class container &container() const;
84 
86  PN_CPP_EXTERN class work_queue& work_queue() const;
87 
89  PN_CPP_EXTERN class connection connection() const;
90 
92  PN_CPP_EXTERN class session session() const;
93 
95  PN_CPP_EXTERN std::map<symbol, value> properties() const;
96 
97  protected:
99 
100  // Initiate the AMQP attach frame.
101  void attach();
102 
103  friend class internal::factory<link>;
104 
106 };
107 
108 }
109 
110 #endif // PROTON_LINK_HPP
A connection to a remote AMQP peer.
Definition: connection.hpp:47
A top-level container of connections, sessions, and links.
Definition: container.hpp:50
The base class for session, connection, and link.
Definition: endpoint.hpp:36
Describes an endpoint error state.
Definition: error_condition.hpp:39
A container of senders and receivers.
Definition: session.hpp:42
Unsettled API - A context for thread-safe execution of work.
Definition: work_queue.hpp:327
The base class for session, connection, and link.
Forward declarations.
The main Proton namespace.
Definition: annotation_key.hpp:33
The base Proton error.
Definition: error.hpp:40