Qpid Proton C++  0.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
container Class Reference

A top-level container of connections, sessions, and links. More...

#include <container.hpp>

Public Member Functions

 container (const std::string &id="")
 Create a container. More...
 
 container (handler &mhandler, const std::string &id=std::string())
 Create a container with an event handler. More...
 
connection connect (const proton::url &, const connection_options &opts=connection_options())
 Open a connection to url.
 
acceptor listen (const proton::url &, const connection_options &opts=connection_options())
 Listen on url for incoming connections.
 
void run ()
 Start processing events. More...
 
sender open_sender (const proton::url &, const proton::link_options &l=proton::link_options(), const connection_options &c=connection_options())
 Open a connection to url and open a sender for url.path(). More...
 
receiver open_receiver (const url &, const proton::link_options &l=proton::link_options(), const connection_options &c=connection_options())
 Open a connection to url and open a receiver for url.path(). More...
 
std::string id () const
 A unique identifier for the container.
 
void client_connection_options (const connection_options &)
 Copy the connection options to a template which will be applied to subsequent outgoing connections. More...
 
void server_connection_options (const connection_options &)
 Copy the connection options to a template which will be applied to incoming connections. More...
 
void link_options (const link_options &)
 Copy the link options to a template applied to new links created and opened by this container. More...
 

Detailed Description

A top-level container of connections, sessions, and links.

A container gives a unique identity to each communicating peer. It is often a process-level object. It serves as an entry point to the API, allowing connections and links to be established. It can be supplied with an event handler in order to intercept important messaging events, such as newly received messages or newly issued link credit for sending messages.

Examples:
broker.cpp, client.cpp, direct_recv.cpp, direct_send.cpp, engine/broker.cpp, helloworld.cpp, helloworld_direct.cpp, server.cpp, server_direct.cpp, simple_recv.cpp, and simple_send.cpp.

Constructor & Destructor Documentation

container ( const std::string &  id = "")

Create a container.

Container ID should be unique within your system. By default a random ID is generated.

container ( handler mhandler,
const std::string &  id = std::string() 
)

Create a container with an event handler.

Container ID should be unique within your system. By default a random ID is generated.

Member Function Documentation

void client_connection_options ( const connection_options )

Copy the connection options to a template which will be applied to subsequent outgoing connections.

These are applied first and overriden by additional connection options provided in other methods.

void link_options ( const link_options )

Copy the link options to a template applied to new links created and opened by this container.

They are applied before the open event on the link and may be overriden by link options in other methods.

receiver open_receiver ( const url ,
const proton::link_options l = proton::link_options(),
const connection_options c = connection_options() 
)

Open a connection to url and open a receiver for url.path().

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

Examples:
simple_recv.cpp.
sender open_sender ( const proton::url ,
const proton::link_options l = proton::link_options(),
const connection_options c = connection_options() 
)

Open a connection to url and open a sender for url.path().

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

Examples:
client.cpp, helloworld_direct.cpp, and simple_send.cpp.
void run ( )

Start processing events.

It returns when all connections and acceptors are closed.

Examples:
client.cpp, direct_recv.cpp, direct_send.cpp, helloworld.cpp, helloworld_direct.cpp, server.cpp, server_direct.cpp, simple_recv.cpp, and simple_send.cpp.
void server_connection_options ( const connection_options )

Copy the connection options to a template which will be applied to incoming connections.

These are applied before the first open event on the connection.


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