RTI Connext Modern C++ API  Version 5.3.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rti::core::policy::PublishMode Class Reference

<<extension>> Specifies whether a dds::pub::DataWriter sends data synchronously or asynchronously. More...

#include <rti/core/policy/CorePolicy.hpp>

Public Member Functions

 PublishMode ()
 Creates a PublishMode qos policy of synchronous kind.
 
PublishModekind (const rti::core::policy::PublishModeKind the_kind)
 Sets the publish mode (synchronous or asynchronous) for a DataWriter.
 
rti::core::policy::PublishModeKind kind () const
 Gets the publish mode.
 
std::string flow_controller_name () const
 Gets the flow controller name.
 
PublishModeflow_controller_name (const std::string &name)
 Sets the flow controller name associated to a DataWriter.
 
int32_t priority () const
 Sets the priority of all samples written by a DataWriter.
 
PublishModepriority (int32_t value)
 Gets the priority.
 

Static Public Member Functions

static PublishMode Synchronous ()
 Creates a PublishMode qos policy of synchronous kind.
 
static PublishMode Asynchronous ()
 Creates a PublishMode qos policy of asynchronous kind with default flow controller and undefined priority.
 
static PublishMode Asynchronous (const std::string &flow_controller_name)
 Creates a PublishMode qos policy of asynchronous kind with a specific flow controller and undefined priority.
 
static PublishMode Asynchronous (const std::string &flow_controller_name, int32_t priority)
 Creates a PublishMode qos policy of asynchronous kind with specific flow controller and priority.
 

Detailed Description

<<extension>> Specifies whether a dds::pub::DataWriter sends data synchronously or asynchronously.

This QoS policy is used to partition the data published by a dds::pub::DataWriter across multiple channels. A channel is defined by a filter expression and a sequence of multicast locators.

Entity:
dds::pub::DataWriter
Properties:
RxO = N/A
Changeable = NO

Usage

By using this QoS, a dds::pub::DataWriter can be configured to send data to different multicast groups based on the content of the data. Using syntax similar to those used in Content-Based Filters, you can associate different multicast addresses with filter expressions that operate on the values of the fields within the data. When your application's code calls dds::pub::DataWriter::write(), data is sent to any multicast address for which the data passes the filter.

Multi-channel DataWriters can be used to trade off network bandwidth with the unnecessary processing of unwanted data for situations where there are multiple DataReaders that are interested in different subsets of data that come from the same data stream (Topic). For example, in Financial applications, the data stream may be quotes for different stocks at an exchange. Applications usually only want to receive data (quotes) for only a subset of the stocks being traded. In tracking applications, a data stream may carry information on hundreds or thousands of objects being tracked, but again, applications may only be interested in a subset.

The problem is that the most efficient way to deliver data to multiple applications is to use multicast, so that a data value is only sent once on the network for any number of subscribers to the data. However, using multicast, an application will receive all of the data sent and not just the data in which it is interested, thus extra CPU time is wasted to throw away unwanted data. With this QoS, you can analyze the data-usage patterns of your applications and optimize network vs. CPU usage by partitioning the data into multiple multicast streams. While network bandwidth is still being conserved by sending data only once using multicast, most applications will only need to listen to a subset of the multicast addresses and receive a reduced amount of unwanted data.

Your system can gain more of the benefits of using multiple multicast groups if your network uses Layer 2 Ethernet switches. Layer 2 switches can be configured to only route multicast packets to those ports that have added membership to specific multicast groups. Using those switches will ensure that only the multicast packets used by applications on a node are routed to the node; all others are filtered-out by the switch.

Constructor & Destructor Documentation

rti::core::policy::PublishMode::PublishMode ( )

Creates a PublishMode qos policy of synchronous kind.

Member Function Documentation

static PublishMode rti::core::policy::PublishMode::Synchronous ( )
static

Creates a PublishMode qos policy of synchronous kind.

static PublishMode rti::core::policy::PublishMode::Asynchronous ( )
static

Creates a PublishMode qos policy of asynchronous kind with default flow controller and undefined priority.

static PublishMode rti::core::policy::PublishMode::Asynchronous ( const std::string &  flow_controller_name)
static

Creates a PublishMode qos policy of asynchronous kind with a specific flow controller and undefined priority.

static PublishMode rti::core::policy::PublishMode::Asynchronous ( const std::string &  flow_controller_name,
int32_t  priority 
)
static

Creates a PublishMode qos policy of asynchronous kind with specific flow controller and priority.

PublishMode& rti::core::policy::PublishMode::kind ( const rti::core::policy::PublishModeKind  the_kind)

Sets the publish mode (synchronous or asynchronous) for a DataWriter.

[default] rti::core::policy::PublishModeKind_def::SYNCHRONOUS

rti::core::policy::PublishModeKind rti::core::policy::PublishMode::kind ( ) const

Gets the publish mode.

std::string rti::core::policy::PublishMode::flow_controller_name ( ) const

Gets the flow controller name.

PublishMode& rti::core::policy::PublishMode::flow_controller_name ( const std::string &  name)

Sets the flow controller name associated to a DataWriter.

NULL value or zero-length string refers to FlowController::DEFAULT_NAME.

See Also
dds::domain::DomainParticipant::FlowController(dds::domain::DomainParticipant,const std::string&,const FlowControllerProperty&)
FlowController::DEFAULT_NAME
FlowController::FIXED_RATE_NAME
FlowController::ON_DEMAND_NAME

[default] FlowController::DEFAULT_NAME

int32_t rti::core::policy::PublishMode::priority ( ) const

Sets the priority of all samples written by a DataWriter.

A positive integer value designating the relative priority of the dds::pub::DataWriter, used to determine the transmission order of pending writes.

Use of publication priorities requires the asynchronous publisher (rti::core::policy::PublishModeKind_def::ASYNCHRONOUS) with rti::pub::FlowControllerProperty::scheduling_policy set to FlowControllerSchedulingPolicy_def::HIGHEST_PRIORITY_FIRST.

Larger numbers have higher priority.

For multi-channel DataWriters, if the publication priority of any channel is set to any value other than PUBLICATION_PRIORITY_UNDEFINED, then the channel's priority will take precedence over that of the DataWriter.

For multi-channel DataWriters, if the publication priority of any channel is PUBLICATION_PRIORITY_UNDEFINED, then the channel will inherit the publication priority of the DataWriter.

If the publicaton priority of the DataWriter, and of any channel of a multi-channel DataWriter, are PUBLICATION_PRIORITY_UNDEFINED, then the priority of the DataWriter or DataWriter channel will be assigned the lowest priority value.

If the publication priority of the DataWriter is PUBLICATION_PRIORITY_AUTOMATIC, then the DataWriter will be assigned the priority of the largest publication priority of all samples in the DataWriter.

The publication priority of each sample can be set in the rti::pub::WriteParams of the dds::pub::DataWriter::write(const T&,rti::pub::WriteParams&) function.

For dispose and unregister samples, use the rti::pub::WriteParams of dds::pub::DataWriter::dispose_instance(rti::pub::WriteParams&) and dds::pub::DataWriter::unregister_instance(rti::pub::WriteParams&).

[default] PUBLICATION_PRIORITY_UNDEFINED

PublishMode& rti::core::policy::PublishMode::priority ( int32_t  value)

Gets the priority.


RTI Connext Modern C++ API Version 5.3.0 Copyright © Sun Jun 25 2017 Real-Time Innovations, Inc