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
00031 #include <proton/type_compat.h>
00032
00033 #include <string>
00034
00037
00038 struct pn_connection_t;
00039
00040 namespace proton {
00041
00043 class
00044 PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>, public endpoint {
00046 PN_CPP_EXTERN connection(pn_connection_t* c) : internal::object<pn_connection_t>(c) {}
00048
00049 public:
00051 connection() : internal::object<pn_connection_t>(0) {}
00052
00053 PN_CPP_EXTERN bool uninitialized() const;
00054 PN_CPP_EXTERN bool active() const;
00055 PN_CPP_EXTERN bool closed() const;
00056
00057 PN_CPP_EXTERN class error_condition error() const;
00058
00063 PN_CPP_EXTERN class container& container() const;
00064
00066 PN_CPP_EXTERN class work_queue& work_queue() const;
00067
00069 PN_CPP_EXTERN class transport transport() const;
00070
00072 PN_CPP_EXTERN std::string virtual_host() const;
00073
00075 PN_CPP_EXTERN std::string container_id() const;
00076
00079 PN_CPP_EXTERN std::string user() const;
00080
00084 PN_CPP_EXTERN void open();
00085
00087 PN_CPP_EXTERN void open(const connection_options&);
00088
00089 PN_CPP_EXTERN void close();
00090 PN_CPP_EXTERN void close(const error_condition&);
00091
00093 PN_CPP_EXTERN session open_session();
00094
00096 PN_CPP_EXTERN session open_session(const session_options&);
00097
00100 PN_CPP_EXTERN session default_session();
00101
00103 PN_CPP_EXTERN sender open_sender(const std::string& addr);
00104
00106 PN_CPP_EXTERN sender open_sender(const std::string& addr, const sender_options&);
00107
00109 PN_CPP_EXTERN receiver open_receiver(const std::string& addr);
00110
00112 PN_CPP_EXTERN receiver open_receiver(const std::string& addr,
00113 const receiver_options&);
00114
00116 PN_CPP_EXTERN class sender_options sender_options() const;
00117
00119 PN_CPP_EXTERN class receiver_options receiver_options() const;
00120
00122 PN_CPP_EXTERN session_range sessions() const;
00123
00125 PN_CPP_EXTERN receiver_range receivers() const;
00126
00128 PN_CPP_EXTERN sender_range senders() const;
00129
00133 PN_CPP_EXTERN uint32_t max_frame_size() const;
00134
00139 PN_CPP_EXTERN uint16_t max_sessions() const;
00140
00144 PN_CPP_EXTERN uint32_t idle_timeout() const;
00145
00164 PN_CPP_EXTERN void wake() const;
00165
00167 friend class internal::factory<connection>;
00168 friend class container;
00170 };
00171
00172 }
00173
00174 #endif // PROTON_CONNECTION_HPP