**Experimental** - A base container implementation. More...
#include <container_impl_base.hpp>
Public Member Functions | |
void | client_connection_options (const connection_options &opts) |
connection_options | client_connection_options () const |
void | server_connection_options (const connection_options &opts) |
connection_options | server_connection_options () const |
void | sender_options (const class sender_options &opts) |
class sender_options | sender_options () const |
void | receiver_options (const class receiver_options &opts) |
class receiver_options | receiver_options () const |
returned< sender > | open_sender (const std::string &url, const class sender_options &opts, const connection_options &copts) |
returned< receiver > | open_receiver (const std::string &url, const class receiver_options &opts, const connection_options &copts) |
returned< connection > | connect (const std::string &url) |
Connect to `url` and send an open request to the remote peer. | |
virtual returned< connection > | connect (const std::string &url, const connection_options &)=0 |
Connect to `url` and send an open request to the remote peer. | |
listener | listen (const std::string &url, const connection_options &) |
Listen with a fixed set of options for all accepted connections. | |
listener | listen (const std::string &url) |
Start listening on URL. | |
virtual listener | listen (const std::string &url, listen_handler &lh)=0 |
Start listening on url. | |
void | stop () |
**Experimental** - Stop the container with an empty error condition. | |
virtual void | stop (const error_condition &err)=0 |
**Experimental** - Stop the container with an error_condition err. | |
returned< sender > | open_sender (const std::string &url) |
Open a connection and sender for `url`. | |
returned< sender > | open_sender (const std::string &url, const proton::sender_options &o) |
Open a connection and sender for `url`. | |
returned< sender > | open_sender (const std::string &url, const proton::connection_options &o) |
Open a connection and sender for `url`. | |
virtual returned< sender > | open_sender (const std::string &url, const proton::sender_options &o, const connection_options &c)=0 |
Open a connection and sender for `url`. | |
returned< receiver > | open_receiver (const std::string &url) |
Open a connection and receiver for `url`. | |
returned< receiver > | open_receiver (const std::string &url, const proton::receiver_options &o) |
Open a connection and receiver for `url`. | |
returned< receiver > | open_receiver (const std::string &url, const proton::connection_options &o) |
Open a connection and receiver for `url`. | |
virtual returned< receiver > | open_receiver (const std::string &url, const proton::receiver_options &o, const connection_options &c)=0 |
Open a connection and receiver for `url`. | |
virtual void | stop_listening (const std::string &url)=0 |
INTERNAL Stop listening on url, must match the url string given to listen(). | |
virtual void | run ()=0 |
Run the container in this thread. | |
virtual void | auto_stop (bool)=0 |
If true, stop the container when all active connections and listeners are closed. | |
virtual std::string | id () const =0 |
A unique identifier for the container. | |
virtual void | schedule (duration, void_function0 &)=0 |
Schedule a function to be called after the duration. |
**Experimental** - A base container implementation.
This is a thread-safe partial implementation of the proton::container interface to reduce boilerplate code in container implementations. Requires C++11.
You can ignore this class if you want to implement the functions in a different way.
virtual void auto_stop | ( | bool | ) | [pure virtual, inherited] |
If true, stop the container when all active connections and listeners are closed.
If false the container will keep running till stop() is called.
auto_stop is set by default when a new container is created.
Implemented in container_ref< Ptr >, and container_ref< std::auto_ptr< container > >.
connection_options client_connection_options | ( | ) | const [inline, virtual] |
Connection options that will be to outgoing connections. These are applied first and overriden by options provided in connect() and messaging_handler::on_connection_open().
Implements container.
void client_connection_options | ( | const connection_options & | opts | ) | [inline, virtual] |
Connection options that will be to outgoing connections. These are applied first and overriden by options provided in connect() and messaging_handler::on_connection_open().
Implements container.
virtual returned<connection> connect | ( | const std::string & | url, | |
const connection_options & | ||||
) | [pure virtual, inherited] |
Connect to `url` and send an open request to the remote peer.
Options are applied to the connection as follows, values in later options override earlier ones:
1. client_connection_options() 2. options passed to connect()
The handler in the composed options is used to call proton::messaging_handler::on_connection_open() when the remote peer's open response is received.
Implemented in container_ref< Ptr >, and container_ref< std::auto_ptr< container > >.
virtual listener listen | ( | const std::string & | url, | |
listen_handler & | lh | |||
) | [pure virtual, inherited] |
Start listening on url.
Calls to the listen_handler are serialized for this listener, but handlers attached to separate listeners may be called concurrently.
Implemented in container_ref< Ptr >, and container_ref< std::auto_ptr< container > >.
listener listen | ( | const std::string & | url | ) | [virtual, inherited] |
Start listening on URL.
New connections will use the handler from server_connection_options()
Implements container.
listener listen | ( | const std::string & | url, | |
const connection_options & | ||||
) | [virtual, inherited] |
Listen with a fixed set of options for all accepted connections.
See listen(const std::string&, listen_handler&)
Implements container.
virtual returned<receiver> open_receiver | ( | const std::string & | url, | |
const proton::receiver_options & | o, | |||
const connection_options & | c | |||
) | [pure virtual, inherited] |
Open a connection and receiver for `url`.
Supplied receiver or connection options will override the container's template options.
returned<receiver> open_receiver | ( | const std::string & | url, | |
const proton::connection_options & | c | |||
) | [virtual, inherited] |
Open a connection and receiver for `url`.
Supplied receiver or connection options will override the container's template options.
Implements container.
returned<receiver> open_receiver | ( | const std::string & | url, | |
const proton::receiver_options & | o | |||
) | [virtual, inherited] |
Open a connection and receiver for `url`.
Supplied receiver options will override the container's template options.
Implements container.
returned<receiver> open_receiver | ( | const std::string & | url, | |
const class receiver_options & | opts, | |||
const connection_options & | copts | |||
) | [inline] |
Open a connection and receiver for `url`.
virtual returned<sender> open_sender | ( | const std::string & | url, | |
const proton::sender_options & | o, | |||
const connection_options & | c | |||
) | [pure virtual, inherited] |
Open a connection and sender for `url`.
Supplied sender or connection options will override the container's template options.
returned<sender> open_sender | ( | const std::string & | url, | |
const proton::connection_options & | c | |||
) | [virtual, inherited] |
Open a connection and sender for `url`.
Supplied connection options will override the container's template options.
Implements container.
returned<sender> open_sender | ( | const std::string & | url, | |
const proton::sender_options & | o | |||
) | [virtual, inherited] |
Open a connection and sender for `url`.
Supplied sender options will override the container's template options.
Implements container.
returned<sender> open_sender | ( | const std::string & | url, | |
const class sender_options & | opts, | |||
const connection_options & | copts | |||
) | [inline] |
Open a connection and sender for `url`.
class receiver_options receiver_options | ( | ) | const [inline, virtual] |
Receiver options applied to receivers created by this container. They are applied before messaging_handler::on_receiver_open() and can be overridden.
Implements container.
void receiver_options | ( | const class receiver_options & | opts | ) | [inline, virtual] |
Receiver options applied to receivers created by this container. They are applied before messaging_handler::on_receiver_open() and can be overridden.
Implements container.
virtual void run | ( | ) | [pure virtual, inherited] |
Run the container in this thread.
Returns when the container stops.
With a multithreaded container, call run() in multiple threads to create a thread pool.
Implemented in container_ref< Ptr >, and container_ref< std::auto_ptr< container > >.
virtual void schedule | ( | duration | , | |
void_function0 & | ||||
) | [pure virtual, inherited] |
Schedule a function to be called after the duration.
C++03 compatible, for C++11 use the schedule(duration, std::function<void()>)
Implemented in container_ref< Ptr >, and container_ref< std::auto_ptr< container > >.
class sender_options sender_options | ( | ) | const [inline, virtual] |
Sender options applied to senders created by this container. They are applied before messaging_handler::on_sender_open() and can be overridden.
Implements container.
void sender_options | ( | const class sender_options & | opts | ) | [inline, virtual] |
Sender options applied to senders created by this container. They are applied before messaging_handler::on_sender_open() and can be overridden.
Implements container.
connection_options server_connection_options | ( | ) | const [inline, virtual] |
Connection options that will be applied to incoming connections. These are applied first and overridden by options provided in listen(), listen_handler::on_accept() and messaging_handler::on_connection_open().
Implements container.
void server_connection_options | ( | const connection_options & | opts | ) | [inline, virtual] |
Connection options that will be applied to incoming connections. These are applied first and overridden by options provided in listen(), listen_handler::on_accept() and messaging_handler::on_connection_open().
Implements container.
virtual void stop | ( | const error_condition & | err | ) | [pure virtual, inherited] |
**Experimental** - Stop the container with an error_condition err.
Implemented in container_ref< Ptr >, and container_ref< std::auto_ptr< container > >.
void stop | ( | ) | [virtual, inherited] |
**Experimental** - Stop the container with an empty error condition.
Implements container.
virtual void stop_listening | ( | const std::string & | url | ) | [pure virtual, inherited] |
INTERNAL Stop listening on url, must match the url string given to listen().
You can also use the proton::listener object returned by listen()
Implemented in container_ref< Ptr >, and container_ref< std::auto_ptr< container > >.