diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-07-30 13:55:17 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-07-30 13:55:17 +0000 |
commit | 18b822a443ec44e80a5c96b15629abeef8aad245 (patch) | |
tree | 684477e3d0213f07fb8708ac12283e23d7a65a24 | |
parent | 0e1a92d54b86f0797165a324834ebb0c373c5e7f (diff) | |
download | ATCD-18b822a443ec44e80a5c96b15629abeef8aad245.tar.gz |
Thu Jul 30 13:54:35 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* connectors/dds4ccm/impl/ndds/DataReaderListener.cpp
* connectors/dds4ccm/impl/ndds/DataWriter.cpp
* connectors/dds4ccm/impl/ndds/DataWriterListener.cpp
* connectors/dds4ccm/impl/ndds/DataWriterListener.h
Implement more listen methods
5 files changed, 51 insertions, 38 deletions
diff --git a/modules/CIAO/ChangeLog b/modules/CIAO/ChangeLog index 89af7b1fae5..09a05bc2d00 100644 --- a/modules/CIAO/ChangeLog +++ b/modules/CIAO/ChangeLog @@ -1,3 +1,11 @@ +Thu Jul 30 13:54:35 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl> + + * connectors/dds4ccm/impl/ndds/DataReaderListener.cpp + * connectors/dds4ccm/impl/ndds/DataWriter.cpp + * connectors/dds4ccm/impl/ndds/DataWriterListener.cpp + * connectors/dds4ccm/impl/ndds/DataWriterListener.h + Implement more listen methods + Thu Jul 30 11:47:35 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl> * connectors/dds4ccm/impl/ndds/DataReader.cpp diff --git a/modules/CIAO/connectors/dds4ccm/impl/ndds/DataReaderListener.cpp b/modules/CIAO/connectors/dds4ccm/impl/ndds/DataReaderListener.cpp index cf1996ddbad..7a69d7a19f5 100644 --- a/modules/CIAO/connectors/dds4ccm/impl/ndds/DataReaderListener.cpp +++ b/modules/CIAO/connectors/dds4ccm/impl/ndds/DataReaderListener.cpp @@ -32,7 +32,9 @@ namespace CIAO ::DDSDataReader* the_reader, const ::DDS_RequestedDeadlineMissedStatus & status) { - throw CORBA::NO_IMPLEMENT (); +// the cast doesn't work :-( +// RTI_DataReader_i *dr = dynamic_cast< RTI_DataReader_i *> (the_reader); + //this->drl_->on_requested_deadline_missed (dr, status); } void @@ -49,9 +51,9 @@ namespace CIAO const ::DDS_SampleRejectedStatus & status) { ::DDS::SampleRejectedStatus ddsstatus; - status >>= ddsstatus; - //return this->dr_->get_subscription_matched_status (ddsstatus); - throw CORBA::NO_IMPLEMENT (); + ddsstatus <<= status; + ::DDS::DataReader_var dds_reader = new RTI_DataReader_i (the_reader); + this->drl_->on_sample_rejected (dds_reader.in (), ddsstatus); } void @@ -65,6 +67,8 @@ namespace CIAO void RTI_DataReaderListener_i::on_data_available(::DDSDataReader *reader) { + //RTI_DataReader_i *dr = dynamic_cast< RTI_DataReader_i *> (reader); + //if (!dr) printf ("cast failed %s\n", typeid (*reader).name ()); ::DDS::DataReader_var dds_reader = new RTI_DataReader_i (reader); this->drl_->on_data_available (dds_reader.in ()); } @@ -75,9 +79,9 @@ namespace CIAO const ::DDS_SubscriptionMatchedStatus & status) { ::DDS::SubscriptionMatchedStatus ddsstatus; - status >>= ddsstatus; - //return this->dr_->get_subscription_matched_status (ddsstatus); - throw CORBA::NO_IMPLEMENT (); + ddsstatus <<= status; + ::DDS::DataReader_var dds_reader = new RTI_DataReader_i (the_reader); + this->drl_->on_subscription_matched (dds_reader.in (), ddsstatus); } void diff --git a/modules/CIAO/connectors/dds4ccm/impl/ndds/DataWriter.cpp b/modules/CIAO/connectors/dds4ccm/impl/ndds/DataWriter.cpp index 2e95a48ae05..282ecdc89b7 100644 --- a/modules/CIAO/connectors/dds4ccm/impl/ndds/DataWriter.cpp +++ b/modules/CIAO/connectors/dds4ccm/impl/ndds/DataWriter.cpp @@ -52,15 +52,16 @@ namespace CIAO { return ::DDS::RETCODE_BAD_PARAMETER; } - return this->dw_->set_listener (dwl->get_datawriterlistener (), mask); +// return this->dw_->set_listener (dwl->get_datawriterlistener (), mask); + throw CORBA::NO_IMPLEMENT (); } ::DDS::DataWriterListener_ptr RTI_DataWriter_i::get_listener (void) { DDSDataWriterListener* wr = this->dw_->get_listener (); - ::DDS::DataWriterListener_var retval = new RTI_DataWriterListener_i (wr); - return retval._retn (); + RTI_DataWriterListener_i *dwl = dynamic_cast< RTI_DataWriterListener_i *> (wr); + return dwl->get_datawriterlistener (); } ::DDS::Topic_ptr @@ -90,9 +91,10 @@ namespace CIAO ::DDS::ReturnCode_t RTI_DataWriter_i::get_liveliness_lost_status (::DDS::LivelinessLostStatus & status) { - CIAO_TRACE ("RTI_DataWriter_i::get_liveliness_lost_status"); - throw CORBA::NO_IMPLEMENT (); - // Add your implementation here + ::DDS_LivelinessLostStatus rtistatus; + ::DDS::ReturnCode_t const retval = this->dw_->get_liveliness_lost_status (rtistatus); + // @todo + return retval; } ::DDS::ReturnCode_t diff --git a/modules/CIAO/connectors/dds4ccm/impl/ndds/DataWriterListener.cpp b/modules/CIAO/connectors/dds4ccm/impl/ndds/DataWriterListener.cpp index 398d3735237..5af43d3fe62 100644 --- a/modules/CIAO/connectors/dds4ccm/impl/ndds/DataWriterListener.cpp +++ b/modules/CIAO/connectors/dds4ccm/impl/ndds/DataWriterListener.cpp @@ -14,8 +14,8 @@ namespace CIAO namespace RTI { // Implementation skeleton constructor - RTI_DataWriterListener_i::RTI_DataWriterListener_i (DDSDataWriterListener *s) - : drl_ (s) + RTI_DataWriterListener_i::RTI_DataWriterListener_i (::DDS::DataWriterListener_ptr s) + : drl_ (::DDS::DataWriterListener::_duplicate (s)) { } @@ -26,40 +26,40 @@ namespace CIAO void RTI_DataWriterListener_i::on_offered_deadline_missed ( - ::DDS::DataWriter_ptr the_writer, - const ::DDS::OfferedDeadlineMissedStatus & status) + ::DDSDataWriter *the_writer, + const ::DDS_OfferedDeadlineMissedStatus & status) { throw CORBA::NO_IMPLEMENT (); } void RTI_DataWriterListener_i::on_offered_incompatible_qos ( - ::DDS::DataWriter_ptr the_writer, - const ::DDS::OfferedIncompatibleQosStatus & status) + ::DDSDataWriter *the_writer, + const ::DDS_OfferedIncompatibleQosStatus & status) { throw CORBA::NO_IMPLEMENT (); } void RTI_DataWriterListener_i::on_liveliness_lost ( - ::DDS::DataWriter_ptr the_writer, - const ::DDS::LivelinessLostStatus & status) + ::DDSDataWriter *the_writer, + const ::DDS_LivelinessLostStatus & status) { throw CORBA::NO_IMPLEMENT (); } void RTI_DataWriterListener_i::on_publication_matched ( - ::DDS::DataWriter_ptr the_writer, - const ::DDS::PublicationMatchedStatus & status) + ::DDSDataWriter *the_writer, + const ::DDS_PublicationMatchedStatus & status) { throw CORBA::NO_IMPLEMENT (); } - DDSDataWriterListener * + ::DDS::DataWriterListener_ptr RTI_DataWriterListener_i::get_datawriterlistener (void) { - return this;//->drl_; + return ::DDS::DataWriterListener::_duplicate (this->drl_.in ()); } } } diff --git a/modules/CIAO/connectors/dds4ccm/impl/ndds/DataWriterListener.h b/modules/CIAO/connectors/dds4ccm/impl/ndds/DataWriterListener.h index 8944459afca..069583e3c8e 100644 --- a/modules/CIAO/connectors/dds4ccm/impl/ndds/DataWriterListener.h +++ b/modules/CIAO/connectors/dds4ccm/impl/ndds/DataWriterListener.h @@ -27,39 +27,38 @@ namespace CIAO namespace RTI { class DDS4CCM_NDDS_IMPL_Export RTI_DataWriterListener_i : - public virtual ::DDS::CCM_DataWriterListener, public virtual ::DDSDataWriterListener { public: - // Constructor @todo zap default argument - RTI_DataWriterListener_i (DDSDataWriterListener *p = 0); + // Constructor + RTI_DataWriterListener_i (::DDS::DataWriterListener_ptr p); // Destructor virtual ~RTI_DataWriterListener_i (void); virtual void on_offered_deadline_missed ( - ::DDS::DataWriter_ptr the_writer, - const ::DDS::OfferedDeadlineMissedStatus & status); + ::DDSDataWriter *the_writer, + const ::DDS_OfferedDeadlineMissedStatus & status); virtual void on_offered_incompatible_qos ( - ::DDS::DataWriter_ptr the_writer, - const ::DDS::OfferedIncompatibleQosStatus & status); + ::DDSDataWriter *the_writer, + const ::DDS_OfferedIncompatibleQosStatus & status); virtual void on_liveliness_lost ( - ::DDS::DataWriter_ptr the_writer, - const ::DDS::LivelinessLostStatus & status); + ::DDSDataWriter *the_writer, + const ::DDS_LivelinessLostStatus & status); virtual void on_publication_matched ( - ::DDS::DataWriter_ptr the_writer, - const ::DDS::PublicationMatchedStatus & status); + ::DDSDataWriter *the_writer, + const ::DDS_PublicationMatchedStatus & status); - DDSDataWriterListener * get_datawriterlistener (void); + ::DDS::DataWriterListener_ptr get_datawriterlistener (void); private: - DDSDataWriterListener *drl_; + ::DDS::DataWriterListener_var drl_; }; } } |