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

Options for creating a link. More...

#include <link_options.hpp>

Public Types

enum  delivery_mode { DELIVERY_MODE_NONE, AT_MOST_ONCE, AT_LEAST_ONCE }
 The message delivery policy to establish when opening a link.
 
enum  sender_settle_mode { UNSETTLED, SETTLED, MIXED }
 Sender settlement behaviour for a link.
 
enum  lifetime_policy {
  LIFETIME_UNSPECIFIED, DELETE_ON_CLOSE, DELETE_ON_NO_LINKS, DELETE_ON_NO_MESSAGES,
  DELETE_ON_NO_LINKS_OR_MESSAGES
}
 The lifetime of dynamically created nodes.
 

Public Member Functions

 link_options ()
 Create an empty set of options.
 
 link_options (const link_options &)
 Copy options.
 
link_optionsoperator= (const link_options &)
 Copy options.
 
void override (const link_options &other)
 Override with options from other.
 
link_optionshandler (class handler *)
 Set a handler for events scoped to the link. More...
 
link_optionsbrowsing (bool)
 Receiver-only option to specify whether messages are browsed or consumed. More...
 
link_optionsdistribution_mode (enum terminus::distribution_mode)
 Set the distribution mode for message transfer.
 
link_optionsdurable_subscription (bool)
 Receiver-only option to create a durable subsription on the receiver. More...
 
link_optionsdelivery_mode (delivery_mode)
 Set the delivery mode on the link.
 
link_optionsdynamic_address (bool)
 Request a dynamically generated node at the peer.
 
link_optionslifetime_policy (lifetime_policy)
 Set the lifetime policy for a receiver to a dynamically created node. More...
 
link_optionslocal_address (const std::string &addr)
 Set the local address for the link.
 

Detailed Description

Options for creating a link.

Options can be "chained" like this:

* l = container.create_sender(url, link_options().handler(h).browsing(true));
*

You can also create an options object with common settings and use it as a base for different connections that have mostly the same settings:

* link_options opts;
* opts.browsing(true);
* l1 = container.open_sender(url1, opts.handler(h1));
* c2 = container.open_receiver(url2, opts.handler(h2));
*

Normal value semantics: copy or assign creates a separate copy of the options.

Examples:
client.cpp, and engine/client.cpp.

Member Function Documentation

link_options& browsing ( bool  )

Receiver-only option to specify whether messages are browsed or consumed.

Setting browsing to true is equivalent to setting distribution_mode(COPY). Setting browsing to false is equivalent to setting distribution_mode(MOVE).

link_options& durable_subscription ( bool  )

Receiver-only option to create a durable subsription on the receiver.

Equivalent to setting the terminus durability to terminus::DELIVERIES and the expiry policy to terminus::EXPIRE_NEVER.

link_options& handler ( class handler )

Set a handler for events scoped to the link.

If NULL, link-scoped events on the link are discarded.

Set the lifetime policy for a receiver to a dynamically created node.


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