Cyclone ISO C++ API Reference Guide
dds::pub::CoherentSet Class Reference

Class for RAII way of beginning/ending coherent publication sets. More...

#include "CoherentSet.hpp"

Inherits dds::core::Value< D >.

Public Member Functions

 CoherentSet (const dds::pub::Publisher &pub)
 
 ~CoherentSet ()
 
void end ()
 
bool operator!= (const Value &other) const
 
D * operator-> ()
 
const D * operator-> () const
 
bool operator== (const Value &other) const
 

Detailed Description

Class for RAII way of beginning/ending coherent publication sets.

A coherent set is a set of modifications that must be propagated in such a way that they are interpreted at the receivers' side as a consistent set of modifications; that is, the receiver will only be able to access the data after all the modifications in the set are available at the receiver end.

A connectivity change may occur in the middle of a set of coherent changes; for example, the set of partitions used by the Publisher or one of its Subscribers may change, a late-joining DataReader may appear on the network, or a communication failure may occur. In the event that such a change prevents an entity from receiving the entire set of coherent changes, that entity must behave as if it had received none of the set.

The support for coherent changes enables a publishing application to change the value of several data-instances that could belong to the same or different topics and have those changes be seen atomically by the readers. This is useful in cases where the values are inter-related. For example, if there are two data instances representing the altitude and velocity vector of the same aircraft and both are changed, it may be useful to communicate those values in such a way the reader can see both together; otherwise, it may, for example, erroneously interpret that the aircraft is on a collision course.

See also
Publication
dds::pub::Publisher

Definition at line 70 of file CoherentSet.hpp.

Constructor & Destructor Documentation

◆ CoherentSet()

dds::pub::CoherentSet::CoherentSet ( const dds::pub::Publisher pub)
explicit

Creating a CoherentSet object, which will begin a ‘coherent set’ of modifications using DataWriter objects attached to this Publisher.

A precondition for making coherent changes is that the PresentationQos of the Publisher has its coherent_access attribute set to TRUE. If this is not the case, the Publisher will not accept any coherent start requests and throw dds::core::PreconditionNotMetError.

Parameters
pubThe publisher to supsend publications on.
Exceptions
dds::core::ErrorAn internal error has occurred.
dds::core::AlreadyClosedErrorThe Publisher has already been closed.
dds::core::NotEnabledErrorThe Publisher has not yet been enabled.
dds::core::OutOfResourcesErrorThe Data Distribution Service ran out of resources to complete this operation.
dds::core::NullReferenceErrorThe Publisher was not properly created and references to dds::core::null.
dds::core::PreconditionNotMetErrorThe coherent access attribute of the Publisher's PresentationQos is not set to true.

◆ ~CoherentSet()

dds::pub::CoherentSet::~CoherentSet ( )

The destruction of the CoherentSet will implicitly end the publication of a coheren set if not already ended by a call to end().

When there is a problem with which end() would normally throw an exception, then that exception is swallowed. Errors can be found in the logs.

Member Function Documentation

◆ end()

void dds::pub::CoherentSet::end ( )

This operation will explicitly end the publication of an coherent set.

If the Publisher already ended its coherent set (by a call to this very operation), then a call to this operation will have no effect.

Exceptions
dds::core::ErrorAn internal error has occurred.
dds::core::AlreadyClosedErrorThe Publisher has already been closed.
dds::core::NotEnabledErrorThe Publisher has not yet been enabled.
dds::core::NullReferenceErrorThe Publisher was not properly created and references to dds::core::null.

◆ operator!=()

template<typename D >
bool dds::core::Value< D >::operator!= ( const Value< D > &  other) const
inherited

Compare this Value with another Value

Parameters
otherValue
Returns
true if not equal

◆ operator->() [1/2]

template<typename D >
D* dds::core::Value< D >::operator-> ( )
inherited

The operator->() is provided to be able to directly invoke functions on the delegate.

The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Value and on all its subclasses as follows:

my_dds_value.standard_function();
my_dds_value->vendor_specific_extension();
Returns
a reference to delegate.

◆ operator->() [2/2]

template<typename D >
const D* dds::core::Value< D >::operator-> ( ) const
inherited

The operator->() is provided to be able to directly invoke functions on the delegate.

The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Value and on all its subclasses as follows:

my_dds_value.standard_function();
my_dds_value->vendor_specific_extension();
Returns
a reference to delegate.

◆ operator==()

template<typename D >
bool dds::core::Value< D >::operator== ( const Value< D > &  other) const
inherited

Compare this Value with another Value

Parameters
otherValue
Returns
true if equal

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