Qpid Proton C++  0.17.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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 #ifdef PN_CPP_HAS_STD_FUNCTION
33 #include <functional>
34 #endif
35 #include <string>
36 
37 #ifdef PN_CPP_HAS_STD_FUNCTION
38 #include <functional>
39 #endif
40 
41 namespace proton {
42 
54 class PN_CPP_CLASS_EXTERN container {
55  public:
57  PN_CPP_EXTERN container(messaging_handler& h, const std::string& id="");
58 
60  PN_CPP_EXTERN container(const std::string& id="");
61 
62  PN_CPP_EXTERN ~container();
63 
75  PN_CPP_EXTERN returned<connection> connect(const std::string& url, const connection_options &);
76 
78  PN_CPP_EXTERN returned<connection> connect(const std::string& url);
79 
83  PN_CPP_EXTERN void stop_listening(const std::string& url);
85 
94  PN_CPP_EXTERN listener listen(const std::string& url, listen_handler& lh);
95 
98  PN_CPP_EXTERN listener listen(const std::string& url, const connection_options&);
99 
102  PN_CPP_EXTERN listener listen(const std::string& url);
103 
109  PN_CPP_EXTERN void run();
110 
115  PN_CPP_EXTERN void auto_stop(bool);
116 
124  PN_CPP_EXTERN void stop(const error_condition& err);
125 
130  PN_CPP_EXTERN void stop();
131 
133  PN_CPP_EXTERN returned<sender> open_sender(const std::string &url);
134 
139  PN_CPP_EXTERN returned<sender> open_sender(const std::string &url,
140  const proton::sender_options &o);
141 
146  PN_CPP_EXTERN returned<sender> open_sender(const std::string &url,
147  const connection_options &c);
148 
153  PN_CPP_EXTERN returned<sender> open_sender(const std::string &url,
154  const proton::sender_options &o,
155  const connection_options &c);
156 
158  PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url);
159 
160 
165  PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url,
166  const proton::receiver_options &o);
167 
172  PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url,
173  const connection_options &c);
174 
179  PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url,
180  const proton::receiver_options &o,
181  const connection_options &c);
182 
184  PN_CPP_EXTERN std::string id() const;
185 
189  PN_CPP_EXTERN void client_connection_options(const connection_options &);
190 
192  PN_CPP_EXTERN connection_options client_connection_options() const;
193 
198  PN_CPP_EXTERN void server_connection_options(const connection_options &);
199 
201  PN_CPP_EXTERN connection_options server_connection_options() const;
202 
206  PN_CPP_EXTERN void sender_options(const class sender_options &);
207 
209  PN_CPP_EXTERN class sender_options sender_options() const;
210 
214  PN_CPP_EXTERN void receiver_options(const class receiver_options &);
215 
217  PN_CPP_EXTERN class receiver_options receiver_options() const;
218 
222  PN_CPP_EXTERN void schedule(duration, void_function0&);
223 
224 #if PN_CPP_HAS_STD_FUNCTION
225  PN_CPP_EXTERN void schedule(duration, std::function<void()>);
227 #endif
228 
229  private:
230  class impl;
231  internal::pn_unique_ptr<impl> impl_;
232 
233  friend class connection_options;
234  friend class session_options;
235  friend class receiver_options;
236  friend class sender_options;
237 };
238 
239 } // proton
240 
241 #endif // PROTON_CONTAINER_HPP
A top-level container of connections, sessions, senders, and receivers.
Definition: container.hpp:54
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
Describes an endpoint error state.
Definition: error_condition.hpp:37