proton/connection.hpp

Go to the documentation of this file.
00001 #ifndef PROTON_CONNECTION_HPP
00002 #define PROTON_CONNECTION_HPP
00003 
00004 /*
00005  *
00006  * Licensed to the Apache Software Foundation (ASF) under one
00007  * or more contributor license agreements.  See the NOTICE file
00008  * distributed with this work for additional information
00009  * regarding copyright ownership.  The ASF licenses this file
00010  * to you under the Apache License, Version 2.0 (the
00011  * "License"); you may not use this file except in compliance
00012  * with the License.  You may obtain a copy of the License at
00013  *
00014  *   http://www.apache.org/licenses/LICENSE-2.0
00015  *
00016  * Unless required by applicable law or agreed to in writing,
00017  * software distributed under the License is distributed on an
00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00019  * KIND, either express or implied.  See the License for the
00020  * specific language governing permissions and limitations
00021  * under the License.
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 
00086     PN_CPP_EXTERN void open();
00087 
00089     PN_CPP_EXTERN void open(const connection_options&);
00090 
00093     PN_CPP_EXTERN void close();
00094 
00096     PN_CPP_EXTERN void close(const error_condition&);
00097 
00099     PN_CPP_EXTERN session open_session();
00100 
00102     PN_CPP_EXTERN session open_session(const session_options&);
00103 
00106     PN_CPP_EXTERN session default_session();
00107 
00109     PN_CPP_EXTERN sender open_sender(const std::string& addr);
00110 
00112     PN_CPP_EXTERN sender open_sender(const std::string& addr, const sender_options&);
00113 
00115     PN_CPP_EXTERN receiver open_receiver(const std::string& addr);
00116 
00118     PN_CPP_EXTERN receiver open_receiver(const std::string& addr,
00119                                          const receiver_options&);
00120 
00122     PN_CPP_EXTERN class sender_options sender_options() const;
00123 
00125     PN_CPP_EXTERN class receiver_options receiver_options() const;
00126 
00128     PN_CPP_EXTERN session_range sessions() const;
00129 
00131     PN_CPP_EXTERN receiver_range receivers() const;
00132 
00134     PN_CPP_EXTERN sender_range senders() const;
00135 
00139     PN_CPP_EXTERN uint32_t max_frame_size() const;
00140 
00145     PN_CPP_EXTERN uint16_t max_sessions() const;
00146 
00148     PN_CPP_EXTERN std::vector<symbol> offered_capabilities() const;
00149 
00151     PN_CPP_EXTERN std::vector<symbol> desired_capabilities() const;
00152 
00156     PN_CPP_EXTERN uint32_t idle_timeout() const;
00157 
00176     PN_CPP_EXTERN void wake() const;
00177 
00182     PN_CPP_EXTERN bool reconnected() const;
00183 
00185   friend class internal::factory<connection>;
00186   friend class container;
00188 };
00189 
00190 } // proton
00191 
00192 #endif // PROTON_CONNECTION_HPP

Generated on 14 May 2019 for Qpid Proton C++ by  doxygen 1.6.1