proton/container.hpp

Go to the documentation of this file.
00001 #ifndef PROTON_CONTAINER_HPP
00002 #define PROTON_CONTAINER_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 "./returned.hpp"
00027 #include "./types_fwd.hpp"
00028 
00029 #include "./internal/config.hpp"
00030 #include "./internal/export.hpp"
00031 #include "./internal/pn_unique_ptr.hpp"
00032 
00033 #include <string>
00034 
00037 
00038 namespace proton {
00039 
00050 class PN_CPP_CLASS_EXTERN container {
00051   public:
00062     PN_CPP_EXTERN container(messaging_handler& handler, const std::string& id);
00063 
00072     PN_CPP_EXTERN container(messaging_handler& handler);
00073 
00076     PN_CPP_EXTERN container(const std::string& id);
00077 
00081     PN_CPP_EXTERN container();
00082 
00092     PN_CPP_EXTERN ~container();
00093 
00108     PN_CPP_EXTERN returned<connection> connect(const std::string& conn_url,
00109                                                const connection_options& conn_opts);
00110 
00114     PN_CPP_EXTERN returned<connection> connect(const std::string& conn_url);
00115 
00128     PN_CPP_EXTERN listener listen(const std::string& listen_url,
00129                                   listen_handler& handler);
00130 
00139     PN_CPP_EXTERN listener listen(const std::string& listen_url,
00140                                   const connection_options& conn_opts);
00141 
00147     PN_CPP_EXTERN listener listen(const std::string& listen_url);
00148 
00157     PN_CPP_EXTERN void run();
00158 
00159 #if PN_CPP_SUPPORTS_THREADS
00166     PN_CPP_EXTERN void run(int count);
00167 #endif
00168 
00175     PN_CPP_EXTERN void auto_stop(bool enabled);
00176 
00180     PN_CPP_EXTERN void stop(const error_condition& err);
00181 
00194     PN_CPP_EXTERN void stop();
00195 
00199     PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url);
00200 
00207     PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url,
00208                                                const proton::sender_options& snd_opts);
00209 
00216     PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url,
00217                                                const connection_options& conn_opts);
00218 
00225     PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url,
00226                                                const proton::sender_options& snd_opts,
00227                                                const connection_options& conn_opts);
00228 
00232     PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url);
00233 
00234 
00241     PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url,
00242                                                    const proton::receiver_options& rcv_opts);
00243 
00250     PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url,
00251                                                    const connection_options& conn_opts);
00252 
00259     PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url,
00260                                                    const proton::receiver_options& rcv_opts,
00261                                                    const connection_options& conn_opts);
00262 
00264     PN_CPP_EXTERN std::string id() const;
00265 
00269     PN_CPP_EXTERN void client_connection_options(const connection_options& conn_opts);
00270 
00272     PN_CPP_EXTERN connection_options client_connection_options() const;
00273 
00278     PN_CPP_EXTERN void server_connection_options(const connection_options& conn_opts);
00279 
00281     PN_CPP_EXTERN connection_options server_connection_options() const;
00282 
00286     PN_CPP_EXTERN void sender_options(const class sender_options& snd_opts);
00287 
00289     PN_CPP_EXTERN class sender_options sender_options() const;
00290 
00294     PN_CPP_EXTERN void receiver_options(const class receiver_options& rcv_opts);
00295 
00297     PN_CPP_EXTERN class receiver_options receiver_options() const;
00298 
00304     PN_CPP_EXTERN void schedule(duration dur, work fn);
00305 
00307     PN_CPP_EXTERN PN_CPP_DEPRECATED("Use 'container::schedule(duration, work)'") void schedule(duration dur, void_function0& fn);
00308 
00310     // This is a hack to ensure that the C++03 version is declared
00311     // only during the compilation of the library
00312 #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES && defined(qpid_proton_cpp_EXPORTS)
00313     PN_CPP_EXTERN void schedule(duration dur, internal::v03::work fn);
00314 #endif
00316 
00317   private:
00318     class impl;
00319     internal::pn_unique_ptr<impl> impl_;
00320 
00322   friend class connection_options;
00323   friend class session_options;
00324   friend class receiver_options;
00325   friend class sender_options;
00326   friend class work_queue;
00328 };
00329 
00330 } // proton
00331 
00332 #endif // PROTON_CONTAINER_HPP

Generated on 29 Mar 2018 for Qpid Proton C++ by  doxygen 1.6.1