Class astutedds::dcps::Subscriber

ClassList > astutedds > dcps > Subscriber

Container for DataReaders.

  • #include <dcps.hpp>

Public Functions

Type Name
Subscriber (DomainParticipant * participant)
Subscriber (const Subscriber &) = delete
ReturnCode_t begin_access ()
Begin ordered/coherent access to samples When ordered_access is set, samples are presented in source-timestamp order.
ReturnCode_t copy_from_topic_qos (DataReaderQos & reader_qos, const TopicQos & topic_qos) const
Copy Topic-level QoS into DataReader QoS (DDS §2.2.2.5.1.17)
DataReader * create_datareader (Topic * topic, const DataReaderQos & qos=DataReaderQos{})
Create a DataReader for a topic.
DataReader * create_datareader (TopicDescription * td, const DataReaderQos & qos, DataReaderListener * listener=nullptr, StatusMask mask=STATUS_MASK_ALL)
Create a DataReader for aTopicDescription (Topic or CFT) with listener (PSM overload)
DataReaderQos default_datareader_qos () const
Return the default DataReader QoS (value return)
ReturnCode_t delete_contained_entities ()
Delete all DataReaders owned by this Subscriber (DDS §2.2.2.5.1.14)
bool delete_datareader (DataReader * reader)
Delete a DataReader .
ReturnCode_t enable () noexcept
ReturnCode_t end_access ()
End ordered/coherent access to samples.
std::vector< DataReader * > get_datareaders () const
Get all DataReaders as raw pointers.
ReturnCode_t get_default_datareader_qos (DataReaderQos & qos) const
Get the default DataReader QoS (out-param, PSM style)
InstanceHandle_t get_instance_handle () noexcept const
const SubscriberQos & get_qos () const
SampleLostStatus get_sample_lost_status ()
Aggregated Subscriber-scope sample-lost status (DDS §2.2.2.5.1.12)
StatusMask get_status_changes () noexcept const
EntityStatusCondition * get_statuscondition () noexcept
bool is_access_active () const
bool is_enabled () noexcept const
DataReader * lookup_datareader (const std::string & topic_name) const
Lookup a DataReader by itsTopic name (DDS §2.2.2.5.1.7)
ReturnCode_t notify_datareaders ()
Notify all owned DataReaders that new data may be available (DDS §2.2.2.5.1.11)
Subscriber & operator= (const Subscriber &) = delete
DomainParticipant * participant () const
const std::vector< std::unique_ptr< DataReader > > & readers () const
ReturnCode_t set_default_datareader_qos (const DataReaderQos & qos)
Set the Subscriber 's defaultDataReader QoS (DDS §2.2.2.5.1.15)
void set_qos (const SubscriberQos & qos)
~Subscriber () = default

Public Functions Documentation

function Subscriber [1/2]

astutedds::dcps::Subscriber::Subscriber (
    DomainParticipant * participant
) 

function Subscriber [2/2]

astutedds::dcps::Subscriber::Subscriber (
    const Subscriber &
) = delete

function begin_access

Begin ordered/coherent access to samples When ordered_access is set, samples are presented in source-timestamp order.

inline ReturnCode_t astutedds::dcps::Subscriber::begin_access () 


function copy_from_topic_qos

Copy Topic-level QoS into DataReader QoS (DDS §2.2.2.5.1.17)

inline ReturnCode_t astutedds::dcps::Subscriber::copy_from_topic_qos (
    DataReaderQos & reader_qos,
    const TopicQos & topic_qos
) const

Overwrites the DataReader QoS policies that are also defined at Topic level (durability, deadline, latency_budget, liveliness, reliability, destination_order, history, resource_limits, ownership, representation) with topic_qos values. Policies that only exist on DataReader (time_based_filter, reader_data_lifecycle, user_data, ignore_local_publications) are left untouched.


function create_datareader [1/2]

Create a DataReader for a topic.

DataReader * astutedds::dcps::Subscriber::create_datareader (
    Topic * topic,
    const DataReaderQos & qos=DataReaderQos {}
) 


function create_datareader [2/2]

Create a DataReader for aTopicDescription (Topic or CFT) with listener (PSM overload)

DataReader * astutedds::dcps::Subscriber::create_datareader (
    TopicDescription * td,
    const DataReaderQos & qos,
    DataReaderListener * listener=nullptr,
    StatusMask mask=STATUS_MASK_ALL
) 


function default_datareader_qos

Return the default DataReader QoS (value return)

inline DataReaderQos astutedds::dcps::Subscriber::default_datareader_qos () const


function delete_contained_entities

Delete all DataReaders owned by this Subscriber (DDS §2.2.2.5.1.14)

inline ReturnCode_t astutedds::dcps::Subscriber::delete_contained_entities () 


function delete_datareader

Delete a DataReader .

bool astutedds::dcps::Subscriber::delete_datareader (
    DataReader * reader
) 


function enable

inline ReturnCode_t astutedds::dcps::Subscriber::enable () noexcept

function end_access

End ordered/coherent access to samples.

inline ReturnCode_t astutedds::dcps::Subscriber::end_access () 


function get_datareaders

Get all DataReaders as raw pointers.

inline std::vector< DataReader * > astutedds::dcps::Subscriber::get_datareaders () const


function get_default_datareader_qos

Get the default DataReader QoS (out-param, PSM style)

inline ReturnCode_t astutedds::dcps::Subscriber::get_default_datareader_qos (
    DataReaderQos & qos
) const

DDS §2.2.2.5.1.16 — returns the QoS most recently supplied to set_default_datareader_qos, or DataReaderQos{} defaults if never set.


function get_instance_handle

inline InstanceHandle_t astutedds::dcps::Subscriber::get_instance_handle () noexcept const

function get_qos

inline const SubscriberQos & astutedds::dcps::Subscriber::get_qos () const

function get_sample_lost_status

Aggregated Subscriber-scope sample-lost status (DDS §2.2.2.5.1.12)

SampleLostStatus astutedds::dcps::Subscriber::get_sample_lost_status () 

Sums total_count and total_count_change across all owned DataReaders and resets each reader's total_count_change (the DDS "read-and-clear" semantic).


function get_status_changes

inline StatusMask astutedds::dcps::Subscriber::get_status_changes () noexcept const

function get_statuscondition

inline EntityStatusCondition * astutedds::dcps::Subscriber::get_statuscondition () noexcept

function is_access_active

inline bool astutedds::dcps::Subscriber::is_access_active () const

function is_enabled

inline bool astutedds::dcps::Subscriber::is_enabled () noexcept const

function lookup_datareader

Lookup a DataReader by itsTopic name (DDS §2.2.2.5.1.7)

DataReader * astutedds::dcps::Subscriber::lookup_datareader (
    const std::string & topic_name
) const

Returns the first DataReader whose TopicDescription name matches topic_name, or nullptr if no such reader exists in this Subscriber.


function notify_datareaders

Notify all owned DataReaders that new data may be available (DDS §2.2.2.5.1.11)

ReturnCode_t astutedds::dcps::Subscriber::notify_datareaders () 

Fires on_data_available() on every reader that has at least one unread sample and a listener installed with the DATA_AVAILABLE bit set in its mask. Returns RETCODE_OK when at least one reader was checked; otherwise RETCODE_PRECONDITION_NOT_MET.


function operator=

Subscriber & astutedds::dcps::Subscriber::operator= (
    const Subscriber &
) = delete

function participant

inline DomainParticipant * astutedds::dcps::Subscriber::participant () const

function readers

inline const std::vector< std::unique_ptr< DataReader > > & astutedds::dcps::Subscriber::readers () const

function set_default_datareader_qos

Set the Subscriber 's defaultDataReader QoS (DDS §2.2.2.5.1.15)

inline ReturnCode_t astutedds::dcps::Subscriber::set_default_datareader_qos (
    const DataReaderQos & qos
) 


function set_qos

inline void astutedds::dcps::Subscriber::set_qos (
    const SubscriberQos & qos
) 

function ~Subscriber

astutedds::dcps::Subscriber::~Subscriber () = default


The documentation for this class was generated from the following file include/astutedds/dcps/dcps.hpp