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 
00119     PN_CPP_EXTERN returned<connection> connect();
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 
00199     PN_CPP_EXTERN void stop();
00200 
00204     PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url);
00205 
00212     PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url,
00213                                                const proton::sender_options& snd_opts);
00214 
00221     PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url,
00222                                                const connection_options& conn_opts);
00223 
00230     PN_CPP_EXTERN returned<sender> open_sender(const std::string& addr_url,
00231                                                const proton::sender_options& snd_opts,
00232                                                const connection_options& conn_opts);
00233 
00237     PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url);
00238 
00239 
00246     PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url,
00247                                                    const proton::receiver_options& rcv_opts);
00248 
00255     PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url,
00256                                                    const connection_options& conn_opts);
00257 
00264     PN_CPP_EXTERN returned<receiver> open_receiver(const std::string& addr_url,
00265                                                    const proton::receiver_options& rcv_opts,
00266                                                    const connection_options& conn_opts);
00267 
00269     PN_CPP_EXTERN std::string id() const;
00270 
00274     PN_CPP_EXTERN void client_connection_options(const connection_options& conn_opts);
00275 
00277     PN_CPP_EXTERN connection_options client_connection_options() const;
00278 
00283     PN_CPP_EXTERN void server_connection_options(const connection_options& conn_opts);
00284 
00286     PN_CPP_EXTERN connection_options server_connection_options() const;
00287 
00291     PN_CPP_EXTERN void sender_options(const class sender_options& snd_opts);
00292 
00294     PN_CPP_EXTERN class sender_options sender_options() const;
00295 
00299     PN_CPP_EXTERN void receiver_options(const class receiver_options& rcv_opts);
00300 
00302     PN_CPP_EXTERN class receiver_options receiver_options() const;
00303 
00309     PN_CPP_EXTERN void schedule(duration dur, work fn);
00310 
00312     PN_CPP_EXTERN PN_CPP_DEPRECATED("Use 'container::schedule(duration, work)'") void schedule(duration dur, void_function0& fn);
00313 
00314   private:
00317 #if PN_CPP_HAS_LAMBDAS && PN_CPP_HAS_VARIADIC_TEMPLATES
00318     PN_CPP_EXTERN void schedule(duration dur, internal::v03::work fn);
00319 #endif
00320     class impl;
00321     internal::pn_unique_ptr<impl> impl_;
00322 
00324   friend class connection_options;
00325   friend class session_options;
00326   friend class receiver_options;
00327   friend class sender_options;
00328   friend class work_queue;
00330 };
00331 
00332 } // proton
00333 
00334 #endif // PROTON_CONTAINER_HPP

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