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

<<extension>> Configures the ability of a dds::pub::DataWriter to publish samples in response to a rti::sub::TopicQuery More...

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

Public Member Functions

 TopicQueryDispatch ()
 Creates the default policy.
 
 TopicQueryDispatch (bool the_enable, const dds::core::Duration &the_publication_period, int32_t the_samples_per_period)
 Creates a policy with the provided values for enable, publication_period and samples_per_period.
 
TopicQueryDispatchenable (bool the_enable)
 Allows this writer to dispatch TopicQueries.
 
bool enable () const
 Getter (see setter with the same name)
 
TopicQueryDispatchpublication_period (const dds::core::Duration &the_publication_period)
 Sets the periodic interval at which samples are published.
 
dds::core::Duration publication_period () const
 Getter (see setter with the same name)
 
TopicQueryDispatchsamples_per_period (int32_t the_samples_per_period)
 Sets the maximum number of samples to publish in each publication_period.
 
int32_t samples_per_period () const
 Getter (see setter with the same name)
 

Detailed Description

<<extension>> Configures the ability of a dds::pub::DataWriter to publish samples in response to a rti::sub::TopicQuery

Enables the ability of a dds::pub::DataWriter to publish historical samples upon reception of a rti::sub::TopicQuery and how often they are published.

Since a TopicQuery selects previously written samples, the DataWriter must have a dds::core::policy::Durability::kind different from dds::core::policy::DurabilityKind::VOLATILE. Also, dds::core::policy::Reliability::kind must be set to dds::core::policy::ReliabilityKind::RELIABLE.

A TopicQuery may select multiple samples at once. The writer will publish them periodically, independently from newly written samples. rti::core::policy::TopicQueryDispatch::publication_period configures the frequency of that period and rti::core::policy::TopicQueryDispatch::samples_per_period configures the maximum number of samples to publish each period.

If the DataWriter blocks during the publication of one of these samples, it will stop and try again the next period. (See dds::pub::DataWriter::write() for the conditions that may cause the write operation to block.)

All the DataWriters that belong to a single dds::pub::Publisher and enable TopicQueries share the same event thread, but each DataWriter schedules separate events. To configure that thread, see rti::core::policy::AsynchronousPublisher::topic_query_publication_thread.

If the DataWriter is dispatching more than one TopicQuery at the same time, the configuration of this periodic event applies to all of them. For example, if a DataWriter receives two TopicQueries around the same time, the period is 1 second, the number of samples per period is 10, the first TopicQuery selects 5 samples, and the second one selects 8, the DataWriter will immediately attempt to publish all 5 for the first TopicQuery and 5 for the second one. After one second, it will publish the remaining 3 samples.

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

Constructor & Destructor Documentation

rti::core::policy::TopicQueryDispatch::TopicQueryDispatch ( )
inline

Creates the default policy.

rti::core::policy::TopicQueryDispatch::TopicQueryDispatch ( bool  the_enable,
const dds::core::Duration the_publication_period,
int32_t  the_samples_per_period 
)
inline

Creates a policy with the provided values for enable, publication_period and samples_per_period.

Member Function Documentation

TopicQueryDispatch& rti::core::policy::TopicQueryDispatch::enable ( bool  the_enable)

Allows this writer to dispatch TopicQueries.

When set to true, this writer can receive and dispatch TopicQueries.

[default] false

bool rti::core::policy::TopicQueryDispatch::enable ( ) const

Getter (see setter with the same name)

TopicQueryDispatch& rti::core::policy::TopicQueryDispatch::publication_period ( const dds::core::Duration the_publication_period)

Sets the periodic interval at which samples are published.

[default] 1 second

[range] [0,1 year]

dds::core::Duration rti::core::policy::TopicQueryDispatch::publication_period ( ) const

Getter (see setter with the same name)

TopicQueryDispatch& rti::core::policy::TopicQueryDispatch::samples_per_period ( int32_t  the_samples_per_period)

Sets the maximum number of samples to publish in each publication_period.

[default] dds::core::LENGTH_UNLIMITED

[range] [1, 100000000] or dds::core::LENGTH_UNLIMITED

int32_t rti::core::policy::TopicQueryDispatch::samples_per_period ( ) const

Getter (see setter with the same name)


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