Qpid Proton C++  0.13.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
default_container.hpp
1 #ifndef PROTON_DEFAULT_CONTAINER_HPP
2 #define PROTON_DEFAULT_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 "./container.hpp"
26 
27 namespace proton {
28 
32 class PN_CPP_CLASS_EXTERN default_container : public container {
33  public:
38  PN_CPP_EXTERN explicit default_container(proton::messaging_handler& h, const std::string& id = "");
39 
49  PN_CPP_EXTERN explicit default_container(const std::string& id = "");
50 
53  PN_CPP_EXTERN explicit default_container(container* c) : impl_(c) {}
54 
55  PN_CPP_EXTERN returned<connection> connect(const std::string& url, const connection_options &) PN_CPP_OVERRIDE;
56  PN_CPP_EXTERN listener listen(const std::string& url, listen_handler& l) PN_CPP_OVERRIDE;
57  using container::listen;
58 
61  PN_CPP_EXTERN void stop_listening(const std::string& url) PN_CPP_OVERRIDE;
63 
64  PN_CPP_EXTERN void run() PN_CPP_OVERRIDE;
65  PN_CPP_EXTERN void auto_stop(bool set) PN_CPP_OVERRIDE;
66 
67  PN_CPP_EXTERN void stop(const error_condition& err = error_condition()) PN_CPP_OVERRIDE;
68 
69  PN_CPP_EXTERN returned<sender> open_sender(
70  const std::string &url,
71  const proton::sender_options &o = proton::sender_options(),
72  const connection_options &c = connection_options()) PN_CPP_OVERRIDE;
73 
74  PN_CPP_EXTERN returned<receiver> open_receiver(
75  const std::string&url,
76  const proton::receiver_options &o = proton::receiver_options(),
77  const connection_options &c = connection_options()) PN_CPP_OVERRIDE;
78 
79  PN_CPP_EXTERN std::string id() const PN_CPP_OVERRIDE;
80 
81  PN_CPP_EXTERN void client_connection_options(const connection_options &o) PN_CPP_OVERRIDE;
82  PN_CPP_EXTERN connection_options client_connection_options() const PN_CPP_OVERRIDE;
83 
84  PN_CPP_EXTERN void server_connection_options(const connection_options &o) PN_CPP_OVERRIDE;
85  PN_CPP_EXTERN connection_options server_connection_options() const PN_CPP_OVERRIDE;
86 
87  PN_CPP_EXTERN void sender_options(const class sender_options &o) PN_CPP_OVERRIDE;
88  PN_CPP_EXTERN class sender_options sender_options() const PN_CPP_OVERRIDE;
89 
90  PN_CPP_EXTERN void receiver_options(const class receiver_options & o) PN_CPP_OVERRIDE;
91  PN_CPP_EXTERN class receiver_options receiver_options() const PN_CPP_OVERRIDE;
92 
93  private:
94  internal::pn_unique_ptr<container> impl_;
95 };
96 
97 } // proton
98 
99 #endif // PROTON_DEFAULT_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
A channel for sending messages.
Definition: sender.hpp:40
Options for creating a sender.
Definition: sender_options.hpp:64
default_container(container *c)
Wrap an existing container implementation as a default_container.
Definition: default_container.hpp:53
Options for creating a connection.
Definition: connection_options.hpp:67
A single-threaded container.
Definition: default_container.hpp:32
A Proton URL.
Definition: url.hpp:55
Options for creating a receiver.
Definition: receiver_options.hpp:62
A channel for receiving messages.
Definition: receiver.hpp:39
Experimental - A handler for incoming connections.
Definition: listen_handler.hpp:32
A handler for Proton messaging events.
Definition: messaging_handler.hpp:75
Describes an endpoint error state.
Definition: error_condition.hpp:37