Qpid Proton C++  0.13.1
 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 "./connection_options.hpp"
26 #include "./error_condition.hpp"
27 #include "./listener.hpp"
28 #include "./internal/pn_unique_ptr.hpp"
29 #include "./thread_safe.hpp"
30 
31 #include <string>
32 
33 namespace proton {
34 
35 class connection;
36 class connection_options;
37 class container_impl;
38 class messaging_handler;
39 class listen_handler;
40 class receiver;
41 class receiver_options;
42 class sender;
43 class sender_options;
44 class task;
45 
46 class container;
47 
59 class PN_CPP_CLASS_EXTERN container {
60  public:
61  PN_CPP_EXTERN virtual ~container();
62 
74  virtual returned<connection> connect(const std::string& url, const connection_options &) = 0;
75 
77  PN_CPP_EXTERN returned<connection> connect(const std::string& url);
78 
82  virtual void stop_listening(const std::string& url) = 0;
84 
93  virtual listener listen(const std::string& url, listen_handler& lh) = 0;
94 
97  PN_CPP_EXTERN virtual listener listen(const std::string& url, const connection_options&);
98 
101  PN_CPP_EXTERN virtual listener listen(const std::string& url);
102 
108  virtual void run() = 0;
109 
114  virtual void auto_stop(bool) = 0;
115 
123  virtual void stop(const error_condition& err = error_condition()) = 0;
124 
126  PN_CPP_EXTERN virtual returned<sender> open_sender(const std::string &url);
127 
132  PN_CPP_EXTERN virtual returned<sender> open_sender(const std::string &url,
133  const proton::sender_options &o);
134 
139  virtual returned<sender> open_sender(const std::string &url,
140  const proton::sender_options &o,
141  const connection_options &c) = 0;
142 
144  PN_CPP_EXTERN virtual returned<receiver> open_receiver(const std::string&url);
145 
146 
151  PN_CPP_EXTERN virtual returned<receiver> open_receiver(const std::string&url,
152  const proton::receiver_options &o);
153 
158  virtual returned<receiver> open_receiver(const std::string&url,
159  const proton::receiver_options &o,
160  const connection_options &c) = 0;
161 
163  virtual std::string id() const = 0;
164 
168  virtual void client_connection_options(const connection_options &) = 0;
169 
171  virtual connection_options client_connection_options() const = 0;
172 
177  virtual void server_connection_options(const connection_options &) = 0;
178 
180  virtual connection_options server_connection_options() const = 0;
181 
185  virtual void sender_options(const class sender_options &) = 0;
186 
188  virtual class sender_options sender_options() const = 0;
189 
193  virtual void receiver_options(const class receiver_options &) = 0;
194 
196  virtual class receiver_options receiver_options() const = 0;
197 
198 };
199 
200 } // proton
201 
202 #endif // PROTON_CONTAINER_HPP
A top-level container of connections, sessions, senders, and receivers.
Definition: container.hpp:59
A listener for incoming connections.
Definition: listener.hpp:32
Options for creating a sender.
Definition: sender_options.hpp:64
Options for creating a connection.
Definition: connection_options.hpp:67
A Proton URL.
Definition: url.hpp:55
Options for creating a receiver.
Definition: receiver_options.hpp:62
Experimental - A handler for incoming connections.
Definition: listen_handler.hpp:32
Describes an endpoint error state.
Definition: error_condition.hpp:37