#include <DDSSubscriber.h>
Public Member Functions | |
DDSSubscriber (CORBA::String_var channel_name) | |
~DDSSubscriber () | |
void | consumerReady () |
template<class DRV , class DR , class D > | |
void | addSubscription (void(*templateFunction)(D, void *), void *handlerParam=0) |
template<class D , class TSV , class TSI > | |
void | initialize () |
Public Attributes | |
DDS::DataReaderQos | drQos |
Protected Attributes | |
DDS::SubscriberQos | subQos |
Private Member Functions | |
int | attachToTransport () |
int | createSubscriber () |
Private Attributes | |
DDS::Subscriber_var | sub |
OpenDDS::DCPS::SubscriberImpl * | sub_impl |
DDS::DataReaderListener_var * | listener |
The Subscriber implementation of ACS Notification Channel based on DDS
ddsnc::DDSSubscriber::DDSSubscriber | ( | CORBA::String_var | channel_name | ) |
Constructor of the class.
ddsnc::DDSSubscriber::~DDSSubscriber | ( | ) | [inline] |
References listener.
void ddsnc::DDSSubscriber::addSubscription | ( | void(*)(D, void *) | templateFunction, | |
void * | handlerParam = 0 | |||
) | [inline] |
The method maintains the name provided by the old acsnc API. Actually this function initializes the DataReader listener.
The <type> corresponds to the name of data type (without namespace) defined in the idl file, the classes required by the template are autogenerated by dcps_ts.pl tools and are specific to the data type defined.
D | <type> struct | |
DR | <type>DataReader class | |
DRV | <type>DataReader_var class |
(*templateFunction)(D,void | *) callback function to handle data received by DataReaderListener | |
*handlerParam |
References listener.
int ddsnc::DDSSubscriber::attachToTransport | ( | ) | [private] |
void ddsnc::DDSSubscriber::consumerReady | ( | ) |
Initialize the DataReader with Qos. This method leaves the Subscriber initializated when is executed.
int ddsnc::DDSSubscriber::createSubscriber | ( | ) | [private] |
Creates the subscriber with default QoS or QoS with a partition
Referenced by initialize().
void ddsnc::DDSSubscriber::initialize | ( | void | ) | [inline] |
Create the participant, initialize the subscriber with the partition provided in the channelName constructor parameter, if there is not partition, initialize the subscriber with default QoS properties, then initialize the transport for the participant, create the subscriber and initialize the topic with topicNanme provided as parameter of the constructor and with data type support defined by templates and finally initialize the data reader QoS with default values
The <type> corresponds to the name of data type (without namespace) defined in the idl file, the classes required by the template are autogenerated by dcps_ts.pl tools and are specific to the data type defined.
D | <type> struct | |
TSV | <type>TypeSupport_var class | |
TSI | <type>TypeSupportImpl class |
References ddsnc::DDSHelper::createParticipant(), createSubscriber(), drQos, ddsnc::DDSHelper::initializeTopic(), ddsnc::DDSHelper::initializeTransport(), NULL, ddsnc::DDSHelper::participant, ddsnc::DDSHelper::partitionName, sub, subQos, and ddsnc::DDSHelper::topic.
DDS::DataReaderQos ddsnc::DDSSubscriber::drQos |
Data Writer Qos, can be modified according OpenDDS API, the Qos properties will be applied when is called consumerReady for first time and they cannot be changed after that.
Referenced by initialize().
DDS::DataReaderListener_var* ddsnc::DDSSubscriber::listener [private] |
Referenced by addSubscription(), and ~DDSSubscriber().
DDS::Subscriber_var ddsnc::DDSSubscriber::sub [private] |
Referenced by initialize().
OpenDDS::DCPS::SubscriberImpl* ddsnc::DDSSubscriber::sub_impl [private] |
DDS::SubscriberQos ddsnc::DDSSubscriber::subQos [protected] |
Referenced by initialize().