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

<<extension>> Configures the mechanism to publish data using a separate thread More...

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

Public Member Functions

 AsynchronousPublisher ()
 Creates the default policy.
 
AsynchronousPublisherdisable_asynchronous_write (bool the_disable_asynchronous_write)
 Disable asynchronous publishing.
 
bool disable_asynchronous_write () const
 Getter (see setter with the same name)
 
AsynchronousPublisherthread (const rti::core::ThreadSettings &the_thread)
 Settings of the publishing thread.
 
const rti::core::ThreadSettingsthread () const
 Getter (see setter with the same name)
 
rti::core::ThreadSettingsthread ()
 Getter (see setter with the same name)
 
AsynchronousPublisherdisable_asynchronous_batch (bool the_disable_asynchronous_batch)
 Disable asynchronous batch flushing.
 
bool disable_asynchronous_batch () const
 Getter (see setter with the same name)
 
AsynchronousPublisherasynchronous_batch_thread (const rti::core::ThreadSettings &the_asynchronous_batch_thread)
 Settings of the batch flushing thread.
 
const rti::core::ThreadSettingsasynchronous_batch_thread () const
 Getter (see setter with the same name)
 
rti::core::ThreadSettingsasynchronous_batch_thread ()
 Getter (see setter with the same name)
 

Static Public Member Functions

static AsynchronousPublisher Enabled (bool enable_async_batch=false)
 Returns a policy that enables asynchronous write and optionally asynchronous batch flushing.
 
static AsynchronousPublisher Disabled ()
 Creates a policy that disables asynchronous writing.
 

Detailed Description

<<extension>> Configures the mechanism to publish data using a separate thread

Specifies the asynchronous publishing and asynchronous batch flushing settings of the dds::pub::Publisher instances.

The QoS policy specifies whether asynchronous publishing and asynchronous batch flushing are enabled for the dds::pub::DataWriter entities belonging to this dds::pub::Publisher. If so, the publisher will spawn up to two threads, one for asynchronous publishing and one for asynchronous batch flushing.

See Also
rti::core::policy::Batch.
rti::core::policy::PublishMode.
Entity:
dds::pub::Publisher
Properties:
RxO = N/A

Changeable = NO

Usage

You can use this QoS policy to reduce the amount of time your application thread spends sending data.

You can also use it, along with rti::core::policy::PublishMode and a rti::pub::FlowController, to send large data reliably. "Large" in this context means that the data that cannot be sent as a single packet by a network transport. For example, to send data larger than 63K reliably using UDP/IP, you must configure RTI Connext to fragment the data and send it asynchronously.

The asynchronous publisher thread is shared by all rti::core::policy::PublishModeKind_def::ASYNCHRONOUS dds::pub::DataWriter instances that belong to this publisher and handles their data transmission chores.

The asynchronous batch flushing thread is shared by all dds::pub::DataWriter instances with batching enabled that belong to this publisher.

This QoS policy also allows you to adjust the settings of the asynchronous publishing and the asynchronous batch flushing threads. To use different threads for two different dds::pub::DataWriter entities, the instances must belong to different dds::pub::Publisher instances.

A dds::pub::Publisher must have asynchronous publishing enabled for its dds::pub::DataWriter instances to write asynchronously.

A dds::pub::Publisher must have asynchronous batch flushing enabled in order to flush the batches of its dds::pub::DataWriter instances asynchronously. However, no asynchronous batch flushing thread will be started until the first dds::pub::DataWriter instance with batching enabled is created from this dds::pub::Publisher.

Constructor & Destructor Documentation

rti::core::policy::AsynchronousPublisher::AsynchronousPublisher ( )
inline

Creates the default policy.

Member Function Documentation

AsynchronousPublisher& rti::core::policy::AsynchronousPublisher::disable_asynchronous_write ( bool  the_disable_asynchronous_write)

Disable asynchronous publishing.

If set to true, any dds::pub::DataWriter created with rti::core::policy::PublishModeKind_def::ASYNCHRONOUS will fail with dds::core::InconsistentPolicyError.

[default] false

bool rti::core::policy::AsynchronousPublisher::disable_asynchronous_write ( ) const

Getter (see setter with the same name)

AsynchronousPublisher& rti::core::policy::AsynchronousPublisher::thread ( const rti::core::ThreadSettings the_thread)

Settings of the publishing thread.

There is only one asynchronous publishing thread per dds::pub::Publisher.

[default] priority below normal.
The actual value depends on your architecture:

For Windows: -2
For Linux: OS default priority
For a complete list of platform specific values, please refer to Platform Notes.

[default] The actual value depends on your architecture:

For Windows: OS default stack size
For Linux: OS default stack size
For a complete list of platform specific values, please refer to Platform Notes.

[default] mask = rti::core::ThreadSettingsKindMask::ThreadSettingsKindMask()

const rti::core::ThreadSettings& rti::core::policy::AsynchronousPublisher::thread ( ) const

Getter (see setter with the same name)

rti::core::ThreadSettings& rti::core::policy::AsynchronousPublisher::thread ( )

Getter (see setter with the same name)

AsynchronousPublisher& rti::core::policy::AsynchronousPublisher::disable_asynchronous_batch ( bool  the_disable_asynchronous_batch)

Disable asynchronous batch flushing.

If set to true, any dds::pub::DataWriter created with batching enabled will fail with dds::core::InconsistentPolicyError.

If rti::core::policy::Batch::max_flush_delay is different than dds::core::Duration::infinite(), rti::core::policy::AsynchronousPublisher::disable_asynchronous_batch must be set false.

[default] false

bool rti::core::policy::AsynchronousPublisher::disable_asynchronous_batch ( ) const

Getter (see setter with the same name)

AsynchronousPublisher& rti::core::policy::AsynchronousPublisher::asynchronous_batch_thread ( const rti::core::ThreadSettings the_asynchronous_batch_thread)

Settings of the batch flushing thread.

There is only one asynchronous batch flushing thread per dds::pub::Publisher.

[default] priority below normal.
The actual value depends on your architecture:

For Windows: -2
For Linux: OS default priority
For a complete list of platform specific values, please refer to Platform Notes. [default] The actual value depends on your architecture:

For Windows: OS default stack size
For Linux: OS default stack size
For a complete list of platform specific values, please refer to Platform Notes.

[default] mask = rti::core::ThreadSettingsKindMask::ThreadSettingsKindMask()

const rti::core::ThreadSettings& rti::core::policy::AsynchronousPublisher::asynchronous_batch_thread ( ) const

Getter (see setter with the same name)

rti::core::ThreadSettings& rti::core::policy::AsynchronousPublisher::asynchronous_batch_thread ( )

Getter (see setter with the same name)

static AsynchronousPublisher rti::core::policy::AsynchronousPublisher::Enabled ( bool  enable_async_batch = false)
inlinestatic

Returns a policy that enables asynchronous write and optionally asynchronous batch flushing.

It uses the default thread settings.

For example:

using namespace rti::core::policy;
static AsynchronousPublisher rti::core::policy::AsynchronousPublisher::Disabled ( )
inlinestatic

Creates a policy that disables asynchronous writing.


RTI Connext Modern C++ API Version 5.2.0 Copyright © Sun Jun 21 2015 Real-Time Innovations, Inc