Qpid Proton C++  0.16.0
container.hpp
1 #ifndef PROTON_CONTAINER_HPP
2 #define PROTON_CONTAINER_HPP
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include "./fwd.hpp"
26 #include "./types_fwd.hpp"
27 
28 #include "./internal/config.hpp"
29 #include "./internal/export.hpp"
30 #include "./internal/pn_unique_ptr.hpp"
31 
32 #include <string>
33 
34 #ifdef PN_CPP_HAS_STD_FUNCTION
35 #include <functional>
36 #endif
37 
38 namespace proton {
39 
51 class PN_CPP_CLASS_EXTERN container {
52  public:
54  PN_CPP_EXTERN container(messaging_handler& h, const std::string& id="");
55 
57  PN_CPP_EXTERN container(const std::string& id="");
58 
59  PN_CPP_EXTERN ~container();
60 
72  PN_CPP_EXTERN returned<connection> connect(const std::string& url, const connection_options &);
73 
75  PN_CPP_EXTERN returned<connection> connect(const std::string& url);
76 
80  PN_CPP_EXTERN void stop_listening(const std::string& url);
82 
91  PN_CPP_EXTERN listener listen(const std::string& url, listen_handler& lh);
92 
95  PN_CPP_EXTERN listener listen(const std::string& url, const connection_options&);
96 
99  PN_CPP_EXTERN listener listen(const std::string& url);
100 
106  PN_CPP_EXTERN void run();
107 
112  PN_CPP_EXTERN void auto_stop(bool);
113 
121  PN_CPP_EXTERN void stop(const error_condition& err);
122 
127  PN_CPP_EXTERN void stop();
128 
130  PN_CPP_EXTERN returned<sender> open_sender(const std::string &url);
131 
136  PN_CPP_EXTERN returned<sender> open_sender(const std::string &url,
137  const proton::sender_options &o);
138 
143  PN_CPP_EXTERN returned<sender> open_sender(const std::string &url,
144  const connection_options &c);
145 
150  PN_CPP_EXTERN returned<sender> open_sender(const std::string &url,
151  const proton::sender_options &o,
152  const connection_options &c);
153 
155  PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url);
156 
157 
162  PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url,
163  const proton::receiver_options &o);
164 
169  PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url,
170  const connection_options &c);
171 
176  PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url,
177  const proton::receiver_options &o,
178  const connection_options &c);
179 
181  PN_CPP_EXTERN std::string id() const;
182 
186  PN_CPP_EXTERN void client_connection_options(const connection_options &);
187 
189  PN_CPP_EXTERN connection_options client_connection_options() const;
190 
195  PN_CPP_EXTERN void server_connection_options(const connection_options &);
196 
198  PN_CPP_EXTERN connection_options server_connection_options() const;
199 
203  PN_CPP_EXTERN void sender_options(const class sender_options &);
204 
206  PN_CPP_EXTERN class sender_options sender_options() const;
207 
211  PN_CPP_EXTERN void receiver_options(const class receiver_options &);
212 
214  PN_CPP_EXTERN class receiver_options receiver_options() const;
215 
219  PN_CPP_EXTERN void schedule(duration, void_function0&);
220 
221 #if PN_CPP_HAS_STD_FUNCTION
222  PN_CPP_EXTERN void schedule(duration, std::function<void()>);
224 #endif
225 
226  private:
227  class impl;
228  internal::pn_unique_ptr<impl> impl_;
229 
230  friend class connection_options;
231  friend class session_options;
232  friend class receiver_options;
233  friend class sender_options;
234 };
235 
236 } // proton
237 
238 #endif // PROTON_CONTAINER_HPP
A top-level container of connections, sessions, senders, and receivers.
Definition: container.hpp:51
A listener for incoming connections.
Definition: listener.hpp:31
Options for creating a sender.
Definition: sender_options.hpp:54
A span of time in milliseconds.
Definition: duration.hpp:36
Options for creating a connection.
Definition: connection_options.hpp:62
A C++03 compatible void no-argument callback function object.
Definition: function.hpp:35
A URL parser.
Definition: url.hpp:56
Forward declarations for all the C++ types used by Proton to represent AMQP types.
Options for creating a receiver.
Definition: receiver_options.hpp:52
Experimental - A handler for incoming connections.
Definition: listen_handler.hpp:34
A handler for Proton messaging events.
Definition: messaging_handler.hpp:59
Options for creating a session.
Definition: session_options.hpp:38
The main Proton namespace.
Definition: annotation_key.hpp:30
Describes an endpoint error state.
Definition: error_condition.hpp:37