00001 #ifndef PROTON_LINK_HPP
00002 #define PROTON_LINK_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "./endpoint.hpp"
00026 #include "./internal/export.hpp"
00027 #include "./message.hpp"
00028 #include "./source.hpp"
00029 #include "./target.hpp"
00030 #include "./internal/object.hpp"
00031 #include "./sender_options.hpp"
00032 #include "./receiver_options.hpp"
00033
00034 #include <proton/types.h>
00035
00036 #include <string>
00037
00038 namespace proton {
00039
00040 class sender;
00041 class receiver;
00042 class error_condition;
00043 class link_context;
00044 class proton_event;
00045 class messaging_adapter;
00046 class proton_handler;
00047 class delivery;
00048 class connection;
00049 class container;
00050 class session;
00051 class sender_iterator;
00052 class receiver_iterator;
00053
00056 class
00057 PN_CPP_CLASS_EXTERN link : public internal::object<pn_link_t> , public endpoint {
00059 link(pn_link_t* l) : internal::object<pn_link_t>(l) {}
00061
00062 public:
00064 link() : internal::object<pn_link_t>(0) {}
00065
00066 PN_CPP_EXTERN bool uninitialized() const;
00067 PN_CPP_EXTERN bool active() const;
00068 PN_CPP_EXTERN bool closed() const;
00069
00070 PN_CPP_EXTERN class error_condition error() const;
00071
00072 PN_CPP_EXTERN void close();
00073 PN_CPP_EXTERN void close(const error_condition&);
00074
00079
00080 PN_CPP_EXTERN void detach();
00081
00083 PN_CPP_EXTERN int credit() const;
00084
00091 PN_CPP_EXTERN bool draining();
00092
00094 PN_CPP_EXTERN std::string name() const;
00095
00097 PN_CPP_EXTERN class container &container() const;
00098
00100 PN_CPP_EXTERN class connection connection() const;
00101
00103 PN_CPP_EXTERN class session session() const;
00104
00105 protected:
00107
00108
00109 void attach();
00110
00111 friend class internal::factory<link>;
00112
00114 };
00115
00116 }
00117
00118 #endif // PROTON_LINK_HPP