Qpid Proton C++  0.16.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 #include <string>
33 
34 namespace proton {
35 
47 class PN_CPP_CLASS_EXTERN container {
48  public:
50  PN_CPP_EXTERN container(messaging_handler& h, const std::string& id="");
51 
53  PN_CPP_EXTERN container(const std::string& id="");
54 
55  PN_CPP_EXTERN ~container();
56 
68  PN_CPP_EXTERN returned<connection> connect(const std::string& url, const connection_options &);
69 
71  PN_CPP_EXTERN returned<connection> connect(const std::string& url);
72 
76  PN_CPP_EXTERN void stop_listening(const std::string& url);
78 
87  PN_CPP_EXTERN listener listen(const std::string& url, listen_handler& lh);
88 
91  PN_CPP_EXTERN listener listen(const std::string& url, const connection_options&);
92 
95  PN_CPP_EXTERN listener listen(const std::string& url);
96 
102  PN_CPP_EXTERN void run();
103 
108  PN_CPP_EXTERN void auto_stop(bool);
109 
117  PN_CPP_EXTERN void stop(const error_condition& err);
118 
123  PN_CPP_EXTERN void stop();
124 
126  PN_CPP_EXTERN returned<sender> open_sender(const std::string &url);
127 
132  PN_CPP_EXTERN returned<sender> open_sender(const std::string &url,
133  const proton::sender_options &o);
134 
139  PN_CPP_EXTERN returned<sender> open_sender(const std::string &url,
140  const connection_options &c);
141 
146  PN_CPP_EXTERN returned<sender> open_sender(const std::string &url,
147  const proton::sender_options &o,
148  const connection_options &c);
149 
151  PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url);
152 
153 
158  PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url,
159  const proton::receiver_options &o);
160 
165  PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url,
166  const connection_options &c);
167 
172  PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url,
173  const proton::receiver_options &o,
174  const connection_options &c);
175 
177  PN_CPP_EXTERN std::string id() const;
178 
182  PN_CPP_EXTERN void client_connection_options(const connection_options &);
183 
185  PN_CPP_EXTERN connection_options client_connection_options() const;
186 
191  PN_CPP_EXTERN void server_connection_options(const connection_options &);
192 
194  PN_CPP_EXTERN connection_options server_connection_options() const;
195 
199  PN_CPP_EXTERN void sender_options(const class sender_options &);
200 
202  PN_CPP_EXTERN class sender_options sender_options() const;
203 
207  PN_CPP_EXTERN void receiver_options(const class receiver_options &);
208 
210  PN_CPP_EXTERN class receiver_options receiver_options() const;
211 
215  PN_CPP_EXTERN void schedule(duration, void_function0&);
216 
217 #if PN_CPP_HAS_STD_FUNCTION
218  PN_CPP_EXTERN void schedule(duration, std::function<void()>);
220 #endif
221 
222  private:
223  class impl;
224  internal::pn_unique_ptr<impl> impl_;
225 
226  friend class connection_options;
227  friend class session_options;
228  friend class receiver_options;
229  friend class sender_options;
230 };
231 
232 } // proton
233 
234 #endif // PROTON_CONTAINER_HPP
A top-level container of connections, sessions, senders, and receivers.
Definition: container.hpp:47
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