CoreDX DDS Modern C++ API
Public Member Functions | List of all members
dds::sub::Subscriber Class Reference

Subscriber is a container for DataReaders. More...

Inheritance diagram for dds::sub::Subscriber:
Inheritance graph
[legend]
Collaboration diagram for dds::sub::Subscriber:
Collaboration graph
[legend]

Public Member Functions

 Subscriber (const dds::domain::DomainParticipant &dp)
 Create a Subscriber attached to the given domain participant. More...
 
 Subscriber (const dds::domain::DomainParticipant &dp, const dds::sub::qos::SubscriberQos &qos, dds::sub::SubscriberListener *listener=NULL, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::none())
 Create a Subscriber attached to the given domain participant. More...
 
void notify_datareaders ()
 This operation invokes the operation on_data_available on the DataReaderListener objects attached to contained DataReader entities with a DATA_AVAILABLE status that is considered changed as described in Section 7.1.4.2.2, Changes in Read Communication Statuses.
 
void listener (Listener *listener, const dds::core::status::StatusMask &event_mask)
 Attach a listener to this. More...
 
Listenerlistener () const
 Get the Subscriber listener.
 
const dds::sub::qos::SubscriberQosqos () const
 Get the Subscriber QoS.
 
void qos (const dds::sub::qos::SubscriberQos &the_qos)
 Set the Subscriber QoS. More...
 
dds::sub::qos::DataReaderQos default_datareader_qos () const
 Get the default DataReader QoS.
 
Subscriberdefault_datareader_qos (const dds::sub::qos::DataReaderQos &qos)
 Set the default DataReader QoS. More...
 
const dds::domain::DomainParticipantparticipant () const
 Return the DomainParticipant that owns this Subscriber.
 
- Public Member Functions inherited from dds::core::Entity
void enable ()
 This operation enables the Entity. More...
 
const dds::core::status::StatusMask status_changes ()
 This operation retrieves the list of communication statuses in the Entity that are triggered.That is, the list of statuses whose value has changed since the last time the application read the status. More...
 
const dds::core::InstanceHandle instance_handle () const
 This operation returns the InstanceHandle_t that represents the Entity.
 
void close ()
 This method closes the entity and releases all resources associated with DDS, such as threads, sockets, buffers, etc. More...
 
void retain ()
 Indicates that references to this object may go out of scope but that the application expects to look it up again later. More...
 
- Public Member Functions inherited from dds::core::Reference< DELEGATE >
 Reference (dds::core::null_type &)
 Creates a "null" reference.
 
 Reference (const Reference &ref)
 Creates a reference from another. More...
 
template<typename D >
 Reference (const Reference< D > &ref)
 Enables safe assignment from other reference types. More...
 
 Reference (DELEGATE_T *p)
 The following two constructors create a dds Reference from a vendor specific delegate. More...
 
 ~Reference ()
 Destroys a reference.
 
template<typename R >
bool operator== (const R &ref) const
 Compares two reference objects and returns true if they are equal. More...
 
template<typename R >
bool operator!= (const R &ref) const
 Compares two reference objects and returns true if they are not-equal. More...
 
Referenceoperator= (const null_type)
 Special assignment operators that takes care of assigning null to this reference. More...
 
bool is_nil () const
 Returns true if this reference object is nil, meaning pointing to null.
 
bool operator== (const null_type) const
 Special operator== used to check if this reference object equals the null reference. More...
 
bool operator!= (const null_type nil) const
 Special operator!= used to check if this reference object does not equals the null reference. More...
 
const DELEGATE_REF_T & delegate () const
 Returns a reference to the underlying delegate. More...
 
DELEGATE_REF_T & delegate ()
 Returns a reference to the underlying delegate. More...
 
DELEGATE * operator-> ()
 The operator->() is provided to be able to directly invoke methods on the delegate. More...
 
const DELEGATE * operator-> () const
 The operator->() is provided to be able to directly invoke methods on the delegate. More...
 

Detailed Description

Subscriber is a container for DataReaders.

Constructor & Destructor Documentation

◆ Subscriber() [1/2]

dds::sub::Subscriber::Subscriber ( const dds::domain::DomainParticipant dp)

Create a Subscriber attached to the given domain participant.

The subscriber QoS will be set to the default as provided by the domain participant.

Parameters
dpthe domain participant that will own this subscriber.

◆ Subscriber() [2/2]

dds::sub::Subscriber::Subscriber ( const dds::domain::DomainParticipant dp,
const dds::sub::qos::SubscriberQos qos,
dds::sub::SubscriberListener listener = NULL,
const dds::core::status::StatusMask mask = dds::core::status::StatusMask::none() 
)

Create a Subscriber attached to the given domain participant.

Parameters
dpthe domain participant that will own this subscriber.
qosthe subscriber qos
listenerthe subscriber listener.
maskthe listener event mask.

Member Function Documentation

◆ default_datareader_qos()

Subscriber& dds::sub::Subscriber::default_datareader_qos ( const dds::sub::qos::DataReaderQos qos)

Set the default DataReader QoS.

Parameters
qosthe default DataReader QoS.

◆ listener()

void dds::sub::Subscriber::listener ( Listener listener,
const dds::core::status::StatusMask event_mask 
)

Attach a listener to this.

Parameters
listenerthe listener
event_maskthe event mask for the listener.

◆ qos()

void dds::sub::Subscriber::qos ( const dds::sub::qos::SubscriberQos the_qos)

Set the Subscriber QoS.

Parameters
the_qosthe new QoS.

© 2009-2020 Twin Oaks Computing, Inc
Castle Rock, CO 80104
All rights reserved.