00001 #ifndef PROTON_CONNECTION_HPP
00002 #define PROTON_CONNECTION_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 "./fwd.hpp"
00026 #include "./internal/export.hpp"
00027 #include "./internal/object.hpp"
00028 #include "./endpoint.hpp"
00029 #include "./session.hpp"
00030 #include "./symbol.hpp"
00031
00032 #include <proton/type_compat.h>
00033
00034 #include <string>
00035
00038
00039 struct pn_connection_t;
00040
00041 namespace proton {
00042
00044 class
00045 PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>, public endpoint {
00047 PN_CPP_EXTERN connection(pn_connection_t* c) : internal::object<pn_connection_t>(c) {}
00049
00050 public:
00052 connection() : internal::object<pn_connection_t>(0) {}
00053
00054 PN_CPP_EXTERN ~connection();
00055
00056 PN_CPP_EXTERN bool uninitialized() const;
00057 PN_CPP_EXTERN bool active() const;
00058 PN_CPP_EXTERN bool closed() const;
00059
00060 PN_CPP_EXTERN class error_condition error() const;
00061
00066 PN_CPP_EXTERN class container& container() const;
00067
00069 PN_CPP_EXTERN class work_queue& work_queue() const;
00070
00072 PN_CPP_EXTERN class transport transport() const;
00073
00075 PN_CPP_EXTERN std::string virtual_host() const;
00076
00078 PN_CPP_EXTERN std::string container_id() const;
00079
00082 PN_CPP_EXTERN std::string user() const;
00083
00087 PN_CPP_EXTERN void open();
00088
00090 PN_CPP_EXTERN void open(const connection_options&);
00091
00092 PN_CPP_EXTERN void close();
00093 PN_CPP_EXTERN void close(const error_condition&);
00094
00096 PN_CPP_EXTERN session open_session();
00097
00099 PN_CPP_EXTERN session open_session(const session_options&);
00100
00103 PN_CPP_EXTERN session default_session();
00104
00106 PN_CPP_EXTERN sender open_sender(const std::string& addr);
00107
00109 PN_CPP_EXTERN sender open_sender(const std::string& addr, const sender_options&);
00110
00112 PN_CPP_EXTERN receiver open_receiver(const std::string& addr);
00113
00115 PN_CPP_EXTERN receiver open_receiver(const std::string& addr,
00116 const receiver_options&);
00117
00119 PN_CPP_EXTERN class sender_options sender_options() const;
00120
00122 PN_CPP_EXTERN class receiver_options receiver_options() const;
00123
00125 PN_CPP_EXTERN session_range sessions() const;
00126
00128 PN_CPP_EXTERN receiver_range receivers() const;
00129
00131 PN_CPP_EXTERN sender_range senders() const;
00132
00136 PN_CPP_EXTERN uint32_t max_frame_size() const;
00137
00142 PN_CPP_EXTERN uint16_t max_sessions() const;
00143
00145 PN_CPP_EXTERN std::vector<symbol> offered_capabilities() const;
00146
00148 PN_CPP_EXTERN std::vector<symbol> desired_capabilities() const;
00149
00153 PN_CPP_EXTERN uint32_t idle_timeout() const;
00154
00173 PN_CPP_EXTERN void wake() const;
00174
00176 friend class internal::factory<connection>;
00177 friend class container;
00179 };
00180
00181 }
00182
00183 #endif // PROTON_CONNECTION_HPP