OpenDDS::DCPS::BitPubListenerImpl Class Reference

#include <BitPubListenerImpl.h>

Inheritance diagram for OpenDDS::DCPS::BitPubListenerImpl:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::BitPubListenerImpl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BitPubListenerImpl (DomainParticipantImpl *partipant)
virtual ~BitPubListenerImpl ()
virtual void on_requested_deadline_missed (DDS::DataReader_ptr reader, const DDS::RequestedDeadlineMissedStatus &status)
virtual void on_requested_incompatible_qos (DDS::DataReader_ptr reader, const DDS::RequestedIncompatibleQosStatus &status)
virtual void on_liveliness_changed (DDS::DataReader_ptr reader, const DDS::LivelinessChangedStatus &status)
virtual void on_subscription_matched (DDS::DataReader_ptr reader, const DDS::SubscriptionMatchedStatus &status)
virtual void on_sample_rejected (DDS::DataReader_ptr reader, const DDS::SampleRejectedStatus &status)
virtual void on_data_available (DDS::DataReader_ptr reader)
virtual void on_sample_lost (DDS::DataReader_ptr reader, const DDS::SampleLostStatus &status)

Private Attributes

DomainParticipantImplpartipant_

Detailed Description

Definition at line 27 of file BitPubListenerImpl.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::BitPubListenerImpl::BitPubListenerImpl ( DomainParticipantImpl partipant  ) 

Definition at line 23 of file BitPubListenerImpl.cpp.

00024 : partipant_ (partipant)
00025 {
00026 }

OpenDDS::DCPS::BitPubListenerImpl::~BitPubListenerImpl (  )  [virtual]

Definition at line 28 of file BitPubListenerImpl.cpp.

00029 {
00030 }


Member Function Documentation

void OpenDDS::DCPS::BitPubListenerImpl::on_data_available ( DDS::DataReader_ptr  reader  )  [virtual]

Definition at line 32 of file BitPubListenerImpl.cpp.

References OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::DomainParticipantImpl::get_domain_id(), DDS::SampleInfo::instance_state, DDS::NOT_ALIVE_DISPOSED_INSTANCE_STATE, DDS::NOT_ALIVE_NO_WRITERS_INSTANCE_STATE, OPENDDS_STRING, partipant_, DDS::RETCODE_NO_DATA, DDS::RETCODE_OK, TheServiceParticipant, OpenDDS::DCPS::DomainParticipantImpl::update_ownership_strength(), and DDS::SampleInfo::valid_data.

00033 {
00034   try {
00035     ::DDS::PublicationBuiltinTopicDataDataReader_var bit_dr =
00036       ::DDS::PublicationBuiltinTopicDataDataReader::_narrow(reader);
00037 
00038     if (CORBA::is_nil(bit_dr.in())) {
00039       ACE_ERROR((LM_ERROR,
00040                  ACE_TEXT("(%P|%t) ERROR: BitPubListenerImpl::on_data_available ")
00041                  ACE_TEXT("_narrow failed!\n")));
00042       return;
00043     }
00044 
00045     ::DDS::PublicationBuiltinTopicData data;
00046     DDS::SampleInfo si;
00047     DDS::ReturnCode_t status;
00048 
00049     do {
00050       status = bit_dr->take_next_sample(data, si);
00051 
00052       if (status == DDS::RETCODE_OK) {
00053         if (si.valid_data) {
00054 #ifndef OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE
00055           Discovery_rch disc =
00056             TheServiceParticipant->get_discovery(partipant_->get_domain_id());
00057           PublicationId pub_id =
00058             disc->bit_key_to_repo_id(partipant_, BUILT_IN_PUBLICATION_TOPIC, data.key);
00059           CORBA::Long const ownership_strength = data.ownership_strength.value;
00060           this->partipant_->update_ownership_strength(pub_id, ownership_strength);
00061           if (DCPS_debug_level > 4) {
00062             GuidConverter writer_converter(pub_id);
00063             ACE_DEBUG((LM_DEBUG,
00064               ACE_TEXT("(%P|%t) BitPubListenerImpl::on_data_available: %X ")
00065               ACE_TEXT("reset ownership strength %d for writer %C.\n"),
00066               this, ownership_strength, OPENDDS_STRING(writer_converter).c_str()));
00067           }
00068 #endif
00069         }
00070         else if (si.instance_state != DDS::NOT_ALIVE_DISPOSED_INSTANCE_STATE
00071                  && si.instance_state != DDS::NOT_ALIVE_NO_WRITERS_INSTANCE_STATE) {
00072           ACE_ERROR((LM_ERROR,
00073                 ACE_TEXT("(%P|%t) ERROR: BitPubListenerImpl::on_data_available:")
00074                 ACE_TEXT(" unknown instance state: %d\n"),
00075                 si.instance_state));
00076         }
00077       } else if (status != DDS::RETCODE_NO_DATA) {
00078         ACE_ERROR((LM_ERROR,
00079                    ACE_TEXT("(%P|%t) ERROR: BitPubListenerImpl::on_data_available:")
00080                    ACE_TEXT(" unexpected status: %d\n"),
00081                    status));
00082       }
00083     } while (status == DDS::RETCODE_OK);
00084 
00085   } catch (const CORBA::Exception& e) {
00086     e._tao_print_exception("Exception caught in BitPubListenerImpl::on_data_available():");
00087   }
00088 }

void OpenDDS::DCPS::BitPubListenerImpl::on_liveliness_changed ( DDS::DataReader_ptr  reader,
const DDS::LivelinessChangedStatus status 
) [virtual]

Definition at line 102 of file BitPubListenerImpl.cpp.

00105 {
00106 }

void OpenDDS::DCPS::BitPubListenerImpl::on_requested_deadline_missed ( DDS::DataReader_ptr  reader,
const DDS::RequestedDeadlineMissedStatus status 
) [virtual]

Definition at line 90 of file BitPubListenerImpl.cpp.

00093 {
00094 }

void OpenDDS::DCPS::BitPubListenerImpl::on_requested_incompatible_qos ( DDS::DataReader_ptr  reader,
const DDS::RequestedIncompatibleQosStatus status 
) [virtual]

Definition at line 96 of file BitPubListenerImpl.cpp.

00099 {
00100 }

void OpenDDS::DCPS::BitPubListenerImpl::on_sample_lost ( DDS::DataReader_ptr  reader,
const DDS::SampleLostStatus status 
) [virtual]

Definition at line 120 of file BitPubListenerImpl.cpp.

00123 {
00124 }

void OpenDDS::DCPS::BitPubListenerImpl::on_sample_rejected ( DDS::DataReader_ptr  reader,
const DDS::SampleRejectedStatus status 
) [virtual]

Definition at line 114 of file BitPubListenerImpl.cpp.

00117 {
00118 }

void OpenDDS::DCPS::BitPubListenerImpl::on_subscription_matched ( DDS::DataReader_ptr  reader,
const DDS::SubscriptionMatchedStatus status 
) [virtual]

Definition at line 108 of file BitPubListenerImpl.cpp.

00111 {
00112 }


Member Data Documentation

DomainParticipantImpl* OpenDDS::DCPS::BitPubListenerImpl::partipant_ [private]

Definition at line 64 of file BitPubListenerImpl.h.

Referenced by on_data_available().


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:06:10 2016 for OpenDDS by  doxygen 1.4.7