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 
00040 #define PN_CPP_SUPPORTS_THREADS PN_CPP_HAS_STD_THREAD && PN_CPP_HAS_STD_MUTEX
00042 
00043 namespace proton {
00044 
00055 class PN_CPP_CLASS_EXTERN container {
00056   public:
00067     PN_CPP_EXTERN container(messaging_handler& handler, const std::string& id);
00068 
00077     PN_CPP_EXTERN container(messaging_handler& handler);
00078 
00081     PN_CPP_EXTERN container(const std::string& id);
00082 
00086     PN_CPP_EXTERN container();
00087 
00097     PN_CPP_EXTERN ~container();
00098 
00113     PN_CPP_EXTERN returned<connection> connect(const std::string& conn_url,
00114                                                const connection_options& conn_opts);
00115 
00119     PN_CPP_EXTERN returned<connection> connect(const std::string& conn_url);
00120 
00133     PN_CPP_EXTERN listener listen(const std::string& listen_url,
00134                                   listen_handler& handler);
00135 
00144     PN_CPP_EXTERN listener listen(const std::string& listen_url,
00145                                   const connection_options& conn_opts);
00146 
00152     PN_CPP_EXTERN listener listen(const std::string& listen_url);
00153 
00162     PN_CPP_EXTERN void run();
00163 
00164 #if PN_CPP_SUPPORTS_THREADS
00171     PN_CPP_EXTERN void run(int count);
00172 #endif
00173 
00180     PN_CPP_EXTERN void auto_stop(bool enabled);
00181 
00185     PN_CPP_EXTERN void stop(const error_condition& err);
00186 
00200     PN_CPP_EXTERN void stop();
00201 
00205     PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url);
00206 
00213     PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url,
00214                                                const proton::sender_options& snd_opts);
00215 
00222     PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url,
00223                                                const connection_options& conn_opts);
00224 
00231     PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url,
00232                                                const proton::sender_options& snd_opts,
00233                                                const connection_options& conn_opts);
00234 
00238     PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url);
00239 
00240 
00247     PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url,
00248                                                    const proton::receiver_options& rcv_opts);
00249 
00256     PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url,
00257                                                    const connection_options& conn_opts);
00258 
00265     PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url,
00266                                                    const proton::receiver_options& rcv_opts,
00267                                                    const connection_options& conn_opts);
00268 
00270     PN_CPP_EXTERN std::string id() const;
00271 
00275     PN_CPP_EXTERN void client_connection_options(const connection_options& conn_opts);
00276 
00278     PN_CPP_EXTERN connection_options client_connection_options() const;
00279 
00284     PN_CPP_EXTERN void server_connection_options(const connection_options& conn_opts);
00285 
00287     PN_CPP_EXTERN connection_options server_connection_options() const;
00288 
00292     PN_CPP_EXTERN void sender_options(const class sender_options& snd_opts);
00293 
00295     PN_CPP_EXTERN class sender_options sender_options() const;
00296 
00300     PN_CPP_EXTERN void receiver_options(const class receiver_options& rcv_opts);
00301 
00303     PN_CPP_EXTERN class receiver_options receiver_options() const;
00304 
00310     PN_CPP_EXTERN void schedule(duration dur, work fn);
00311 
00313     PN_CPP_EXTERN PN_CPP_DEPRECATED("Use 'container::schedule(duration, work)'") void schedule(duration dur, void_function0& fn);
00314 
00316     // This is a hack to ensure that the C++03 version is declared
00317     // only during the compilation of the library
00318 #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES && defined(qpid_proton_cpp_EXPORTS)
00319     PN_CPP_EXTERN void schedule(duration dur, internal::v03::work fn);
00320 #endif
00322 
00323   private:
00324     class impl;
00325     internal::pn_unique_ptr<impl> impl_;
00326 
00328   friend class connection_options;
00329   friend class session_options;
00330   friend class receiver_options;
00331   friend class sender_options;
00332   friend class work_queue;
00334 };
00335 
00336 } // proton
00337 
00338 #endif // PROTON_CONTAINER_HPP

Generated on 28 Nov 2017 for Qpid Proton C++ by  doxygen 1.6.1