Qpid Proton C++  0.13.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
container_impl_base Class Referenceabstract

Experimental - A base container implementation. More...

#include <container_impl_base.hpp>

Inheritance diagram for container_impl_base:
container

Public Member Functions

void client_connection_options (const connection_options &opts)
 Connection options that will be to outgoing connections. More...
 
connection_options client_connection_options () const
 Connection options that will be to outgoing connections. More...
 
void server_connection_options (const connection_options &opts)
 Connection options that will be applied to incoming connections. More...
 
connection_options server_connection_options () const
 Connection options that will be applied to incoming connections. More...
 
void sender_options (const class sender_options &opts)
 Sender options applied to senders created by this container. More...
 
class sender_options sender_options () const
 Sender options applied to senders created by this container. More...
 
void receiver_options (const class receiver_options &opts)
 Receiver options applied to receivers created by this container. More...
 
class receiver_options receiver_options () const
 Receiver options applied to receivers created by this container. More...
 
returned< senderopen_sender (const std::string &url, const class sender_options &opts, const connection_options &copts)
 Open a connection and sender for url. More...
 
returned< receiveropen_receiver (const std::string &url, const class receiver_options &opts, const connection_options &copts)
 Open a connection and receiver for url. More...
 
virtual returned< connectionconnect (const std::string &url, const connection_options &)=0
 Connect to url and send an open request to the remote peer. More...
 
returned< connectionconnect (const std::string &url)
 Connect to url and send an open request to the remote peer.
 
virtual listener listen (const std::string &url, listen_handler &lh)=0
 Start listening on url. More...
 
virtual listener listen (const std::string &url, const connection_options &)
 Listen with a fixed set of options for all accepted connections. More...
 
virtual listener listen (const std::string &url)
 Start listening on URL. More...
 
virtual void run ()=0
 Run the container in this thread. More...
 
virtual void auto_stop (bool)=0
 If true, stop the container when all active connections and listeners are closed. More...
 
virtual void stop (const error_condition &err=error_condition())=0
 Experimental - Stop the container with an optional error_condition err. More...
 
virtual returned< senderopen_sender (const std::string &url)
 Open a connection and sender for url.
 
virtual returned< senderopen_sender (const std::string &url, const proton::sender_options &o)
 Open a connection and sender for url. More...
 
virtual returned< senderopen_sender (const std::string &url, const proton::sender_options &o, const connection_options &c)=0
 Open a connection and sender for url. More...
 
virtual returned< receiveropen_receiver (const std::string &url)
 Open a connection and receiver for url.
 
virtual returned< receiveropen_receiver (const std::string &url, const proton::receiver_options &o)
 Open a connection and receiver for url. More...
 
virtual returned< receiveropen_receiver (const std::string &url, const proton::receiver_options &o, const connection_options &c)=0
 Open a connection and receiver for url. More...
 
virtual std::string id () const =0
 A unique identifier for the container.
 

Detailed Description

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.

Examples:
mt/epoll_container.cpp.

Member Function Documentation

virtual void auto_stop ( bool  )
pure virtualinherited

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 default_container.

Examples:
mt/epoll_container.cpp.
void client_connection_options ( const connection_options opts)
inlinevirtual

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.

connection_options client_connection_options ( ) const
inlinevirtual

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 virtualinherited

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 default_container.

Examples:
helloworld.cpp, mt/epoll_container.cpp, and server.cpp.
virtual listener listen ( const std::string &  url,
listen_handler lh 
)
pure virtualinherited

Start listening on url.

Calls to the listen_handler are serialized for this listener, but handlers attached to separate listeners may be called concurrently.

Parameters
urlidentifies a listening url.
lhhandles listening events
Returns
listener lets you stop listening

Implemented in default_container.

Examples:
direct_recv.cpp, direct_send.cpp, helloworld_direct.cpp, mt/epoll_container.cpp, and server_direct.cpp.
virtual listener listen ( const std::string &  url,
const connection_options  
)
virtualinherited

Listen with a fixed set of options for all accepted connections.

See listen(const std::string&, listen_handler&)

virtual listener listen ( const std::string &  url)
virtualinherited

Start listening on URL.

New connections will use the handler from server_connection_options()

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<receiver> open_receiver ( const std::string &  url,
const proton::receiver_options o 
)
virtualinherited

Open a connection and receiver for url.

Any supplied receiver options will override the container's template options.

virtual returned<receiver> open_receiver ( const std::string &  url,
const proton::receiver_options o,
const connection_options c 
)
pure virtualinherited

Open a connection and receiver for url.

Any supplied receiver or connection options will override the container's template options.

Implemented in default_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.

virtual returned<sender> open_sender ( const std::string &  url,
const proton::sender_options o 
)
virtualinherited

Open a connection and sender for url.

Any supplied sender options will override the container's template options.

virtual returned<sender> open_sender ( const std::string &  url,
const proton::sender_options o,
const connection_options c 
)
pure virtualinherited

Open a connection and sender for url.

Any supplied sender or connection options will override the container's template options.

Implemented in default_container.

void receiver_options ( const class receiver_options opts)
inlinevirtual

Receiver options applied to receivers created by this container.

They are applied before messaging_handler::on_receiver_open() and can be overridden.

Implements container.

class receiver_options receiver_options ( ) const
inlinevirtual

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 virtualinherited

Run the container in this thread.

Returns when the container stops.

See Also
auto_stop() and stop().

With a multithreaded container, call run() in multiple threads to create a thread pool.

Implemented in default_container.

Examples:
mt/broker.cpp, and mt/epoll_container.cpp.
void sender_options ( const class sender_options opts)
inlinevirtual

Sender options applied to senders created by this container.

They are applied before messaging_handler::on_sender_open() and can be overridden.

Implements container.

class sender_options sender_options ( ) const
inlinevirtual

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 server_connection_options ( const connection_options opts)
inlinevirtual

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.

connection_options server_connection_options ( ) const
inlinevirtual

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 = error_condition())
pure virtualinherited

Experimental - Stop the container with an optional error_condition err.

  • Abort all open connections and listeners.
  • Process final handler events and injected functions
  • If !err.empty(), handlers will receive on_transport_error
  • run() will return in all threads.

Implemented in default_container.

Examples:
mt/epoll_container.cpp.

The documentation for this class was generated from the following file: