Class Subscriber

Inheritance Relationships

Base Type

Class Documentation

class Subscriber : public dds::core::TEntity<detail::Subscriber>

The Subscriber acts on the behalf of one or several DataReader objects that belong to it.

See also

Subscriber

Public Types

typedef SubscriberListener Listener

Local convenience typedef for dds::pub::SubscriberListener.

Public Functions

OMG_DDS_API const qos::SubscriberQos & qos () const

Gets the SubscriberQos setting for this instance.

Throws
  • dds::core::Error – An internal error has occurred.

  • dds::core::NullReferenceError – The entity was not properly created and references to dds::core::null.

  • dds::core::AlreadyClosedError – The entity has already been closed.

  • dds::core::OutOfResourcesError – The Data Distribution Service ran out of resources to complete this operation.

Returns

the qos

OMG_DDS_API void qos (const qos::SubscriberQos &qos)

Sets the SubscriberQos setting for this instance.

Parameters

qos – the qos

Throws
  • dds::core::Error – An internal error has occurred.

  • dds::core::NullReferenceError – The entity was not properly created and references to dds::core::null.

  • dds::core::AlreadyClosedError – The entity has already been closed.

  • dds::core::OutOfResourcesError – The Data Distribution Service ran out of resources to complete this operation.

OMG_DDS_API Subscriber & operator<< (const qos::SubscriberQos &qos)
OMG_DDS_API Subscriber & operator>> (qos::SubscriberQos &qos)
OMG_DDS_API Subscriber & default_datareader_qos (const qos::DataReaderQos &qos)

Sets the default DataWriterQos of the Subscriber.

This operation sets the default SubscriberQos of the Subscriber which is used for newly created Subscriber objects, when no QoS is provided.

This operation checks if the DataReaderQos is self consistent. If it is not, the operation has no effect and throws dds::core::InconsistentPolicyError.

The values set by this operation are returned by dds::pub::Subscriber::default_datareader_qos().

Parameters

qos – the default DataReaderQos

Throws
  • dds::core::Error – An internal error has occurred.

  • dds::core::NullReferenceError – The entity was not properly created and references to dds::core::null.

  • dds::core::AlreadyClosedError – The entity has already been closed.

  • dds::core::UnsupportedError – One or more of the selected QosPolicy values are currently not supported.

  • dds::core::InconsistentPolicyError – The parameter qos contains conflicting QosPolicy settings,

  • dds::core::OutOfResourcesError – The Data Distribution Service ran out of resources to complete this operation.

OMG_DDS_API qos::DataReaderQos default_datareader_qos () const

Gets the default DataReaderQos of the Subscriber.

This operation gets an object with the default DataReader QosPolicy settings of the Subscriber (that is the DataReaderQos) which is used for newly created DataReader objects, in case no QoS was provided during the creation.

The values retrieved by this operation match the set of values specified on the last successful call to dds::pub::Subscriber::default_datareader_qos(const dds::pub::qos::DataReaderQos& qos), or, if the call was never made, the default values.

Throws
  • dds::core::Error – An internal error has occurred.

  • dds::core::NullReferenceError – The entity was not properly created and references to dds::core::null.

  • dds::core::AlreadyClosedError – The entity has already been closed.

  • dds::core::OutOfResourcesError – The Data Distribution Service ran out of resources to complete this operation.

Returns

the default DataReaderQos

OMG_DDS_API void listener (Listener *plistener, const dds::core::status::StatusMask &mask)

Register a listener with the Subscriber.

The notifications received by the listener depend on the status mask with which it was registered.

Listener un-registration is performed by setting the listener to NULL.

See also listener information.

Parameters
  • plistener – the listener

  • mask – the mask defining the events for which the listener will be notified.

Throws
  • dds::core::Error – An internal error has occurred.

  • dds::core::NullReferenceError – The entity was not properly created and references to dds::core::null.

  • dds::core::AlreadyClosedError – The entity has already been closed.

  • dds::core::UnsupportedError – A status was selected that cannot be supported because the infrastructure does not maintain the required connectivity information.

  • dds::core::OutOfResourcesError – The Data Distribution Service ran out of resources to complete this operation.

OMG_DDS_API Listener * listener () const

Get the listener of this Subscriber.

See also listener information.

Throws

dds::core::NullReferenceError – The entity was not properly created and references to dds::core::null.

Returns

the listener

OMG_DDS_API const dds::domain::DomainParticipant & participant () const

Return the DomainParticipant that owns this Subscriber.

Throws
  • dds::core::Error – An internal error has occurred.

  • dds::core::NullReferenceError – The entity was not properly created and references to dds::core::null.

  • dds::core::AlreadyClosedError – The entity has already been closed.

Returns

the DomainParticipant

Public Members

const dds::domain::DomainParticipant *participant_