proton/session.hpp

Go to the documentation of this file.
00001 #ifndef PROTON_SESSION_HPP
00002 #define PROTON_SESSION_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 "./endpoint.hpp"
00028 #include "./receiver.hpp"
00029 #include "./sender.hpp"
00030 
00031 #include <string>
00032 
00035 
00036 struct pn_session_t;
00037 
00038 namespace proton {
00039 
00041 class
00042 PN_CPP_CLASS_EXTERN session : public internal::object<pn_session_t>, public endpoint {
00043   public:
00045     PN_CPP_EXTERN session(pn_session_t* s) : internal::object<pn_session_t>(s) {}
00047 
00048   public:
00050     session() : internal::object<pn_session_t>(0) {}
00051 
00052     PN_CPP_EXTERN ~session();
00053 
00054     PN_CPP_EXTERN bool uninitialized() const;
00055     PN_CPP_EXTERN bool active() const;
00056     PN_CPP_EXTERN bool closed() const;
00057 
00058     PN_CPP_EXTERN class error_condition error() const;
00059 
00061     PN_CPP_EXTERN void open();
00062 
00064     PN_CPP_EXTERN void open(const session_options &opts);
00065 
00066     PN_CPP_EXTERN void close();
00067     PN_CPP_EXTERN void close(const error_condition&);
00068 
00070     PN_CPP_EXTERN class container &container() const;
00071 
00073     PN_CPP_EXTERN class work_queue& work_queue() const;
00074 
00076     PN_CPP_EXTERN class connection connection() const;
00077 
00079     PN_CPP_EXTERN sender open_sender(const std::string &addr);
00080 
00082     PN_CPP_EXTERN sender open_sender(const std::string &addr, const sender_options &opts);
00083 
00085     PN_CPP_EXTERN receiver open_receiver(const std::string &addr);
00086 
00088     PN_CPP_EXTERN receiver open_receiver(const std::string &addr, const receiver_options &opts);
00089 
00091     PN_CPP_EXTERN size_t incoming_bytes() const;
00092 
00094     PN_CPP_EXTERN size_t outgoing_bytes() const;
00095 
00097     PN_CPP_EXTERN sender_range senders() const;
00098 
00100     PN_CPP_EXTERN receiver_range receivers() const;
00101 
00103   friend class internal::factory<session>;
00104   friend class session_iterator;
00106 };
00107 
00109     
00111 class session_iterator : public internal::iter_base<session, session_iterator> {
00112  public:
00113     explicit session_iterator(session s = 0) : internal::iter_base<session, session_iterator>(s) {}
00114 
00116     PN_CPP_EXTERN session_iterator operator++();
00117 };
00118 
00120 typedef internal::iter_range<session_iterator> session_range;
00121 
00123     
00124 } // proton
00125 
00126 #endif // PROTON_SESSION_HPP

Generated on 30 Jul 2020 for Qpid Proton C++ by  doxygen 1.6.1