diff options
Diffstat (limited to 'CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver_exec.cpp')
-rw-r--r-- | CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver_exec.cpp | 171 |
1 files changed, 73 insertions, 98 deletions
diff --git a/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver_exec.cpp b/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver_exec.cpp index 71fdd66ac81..84415f26e19 100644 --- a/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver_exec.cpp +++ b/CIAO/connectors/dds4ccm/tests/CSLQoS/Receiver/CSL_QoSTest_Receiver_exec.cpp @@ -11,12 +11,10 @@ namespace CIAO_CSL_QoSTest_Receiver_Impl { //============================================================ - // ConnectorStatusListener_exec_i + // Facet Executor Implementation Class: ConnectorStatusListener_exec_i //============================================================ - ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Atomic_Boolean &incompatible, - Atomic_ThreadId &thread_id) - : incompatible_ (incompatible), - thread_id_ (thread_id) + ConnectorStatusListener_exec_i::ConnectorStatusListener_exec_i (Atomic_Boolean &incompatible) + : incompatible_ (incompatible) { } @@ -26,51 +24,44 @@ namespace CIAO_CSL_QoSTest_Receiver_Impl // Operations from ::CCM_DDS::ConnectorStatusListener void ConnectorStatusListener_exec_i::on_inconsistent_topic( - ::DDS::Topic_ptr /*the_topic*/, - const DDS::InconsistentTopicStatus & /*status*/) - { - } + ::DDS::Topic_ptr /*the_topic*/, + const DDS::InconsistentTopicStatus & /*status*/) + { + } - void ConnectorStatusListener_exec_i::on_requested_incompatible_qos ( + void ConnectorStatusListener_exec_i::on_requested_incompatible_qos( ::DDS::DataReader_ptr the_reader, - const DDS::RequestedIncompatibleQosStatus & /*status*/) - { - this->thread_id_ = ACE_Thread::self (); - if(!CORBA::is_nil(the_reader)) - { - this->incompatible_ = true; - } - } - - void ConnectorStatusListener_exec_i::on_sample_rejected ( - ::DDS::DataReader_ptr /*the_reader*/, - const DDS::SampleRejectedStatus & /*status*/) - { - } - - void ConnectorStatusListener_exec_i::on_offered_deadline_missed ( - ::DDS::DataWriter_ptr /*the_writer*/, - const DDS::OfferedDeadlineMissedStatus & /*status*/) - { - } - - void ConnectorStatusListener_exec_i::on_offered_incompatible_qos ( - ::DDS::DataWriter_ptr /*the_writer*/, - const DDS::OfferedIncompatibleQosStatus & /*status*/) - { - } - - void ConnectorStatusListener_exec_i::on_unexpected_status ( + const DDS::RequestedIncompatibleQosStatus & /*status*/) { + if(!CORBA::is_nil(the_reader)) + { + this->incompatible_ = true; + } + } + void ConnectorStatusListener_exec_i::on_sample_rejected( + ::DDS::DataReader_ptr /*the_reader*/, + const DDS::SampleRejectedStatus & /*status*/) { + } + + void ConnectorStatusListener_exec_i::on_offered_deadline_missed( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedDeadlineMissedStatus & /*status*/) { + } + + void ConnectorStatusListener_exec_i::on_offered_incompatible_qos( + ::DDS::DataWriter_ptr /*the_writer*/, + const DDS::OfferedIncompatibleQosStatus & /*status*/) { + } + + void ConnectorStatusListener_exec_i::on_unexpected_status( ::DDS::Entity_ptr /*the_entity*/, - ::DDS::StatusKind /*status_kind */) - { - } + ::DDS::StatusKind /*status_kind */) { + } //============================================================ - // TestTopic_RawListener_exec_i + // Facet Executor Implementation Class: TestTopic_RawListener_exec_i //============================================================ TestTopic_RawListener_exec_i::TestTopic_RawListener_exec_i (Atomic_ULong &received) - : received_ (received) + : received_ (received) { } @@ -97,14 +88,40 @@ namespace CIAO_CSL_QoSTest_Receiver_Impl const ::CCM_DDS::ReadInfoSeq & /* info */) { } + //============================================================ + // Facet Executor Implementation Class: PortStatusListener_exec_i + //============================================================ + + PortStatusListener_exec_i::PortStatusListener_exec_i (void) + { + } + + PortStatusListener_exec_i::~PortStatusListener_exec_i (void) + { + } + + // Operations from ::CCM_DDS::PortStatusListener + + void + PortStatusListener_exec_i::on_requested_deadline_missed ( + ::DDS::DataReader_ptr /* the_reader */, + const ::DDS::RequestedDeadlineMissedStatus & /* status */) + { + } + + void + PortStatusListener_exec_i::on_sample_lost ( + ::DDS::DataReader_ptr /* the_reader */, + const ::DDS::SampleLostStatus & /* status */) + { + } //============================================================ - // Receiver_exec_i + // Component Executor Implementation Class: Receiver_exec_iTestTopic_RawListener_exec_i (); //============================================================ + Receiver_exec_i::Receiver_exec_i (void) - : incompatible_ (false), - received_ (0), - thread_id_listener_ (0) + : incompatible_ (false) { } @@ -112,7 +129,10 @@ namespace CIAO_CSL_QoSTest_Receiver_Impl { } - ::CSL_QoSTest::TestTopicConn::CCM_Listener_ptr + // Supported operations and attributes. + // Component attributes. + // Port operations. + ::CCM_DDS::TestTopic::CCM_Listener_ptr Receiver_exec_i::get_info_out_data_listener (void) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new TestTopic RAW listener\n"))); @@ -123,14 +143,13 @@ namespace CIAO_CSL_QoSTest_Receiver_Impl Receiver_exec_i::get_info_out_status (void) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("new PortStatuslistener\n"))); - return ::CCM_DDS::CCM_PortStatusListener::_nil (); + return new PortStatusListener_exec_i (); } ::CCM_DDS::CCM_ConnectorStatusListener_ptr Receiver_exec_i::get_info_out_connector_status (void) { - return new ConnectorStatusListener_exec_i (this->incompatible_, - this->thread_id_listener_); + return new ConnectorStatusListener_exec_i (this->incompatible_); } // Operations from Components::SessionComponent. @@ -173,62 +192,18 @@ namespace CIAO_CSL_QoSTest_Receiver_Impl void Receiver_exec_i::ccm_remove (void) { - if (!this->incompatible_.value ()) + if(!this->incompatible_.value ()) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("RECEIVER ERROR: did not receive the expected ") + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: did not receive the expected ") ACE_TEXT ("error 'on_requested_incompatible_Qos' in Receiver\n") )); } else { - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("RECEIVER OK: Received the expected ") + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Received the expected ") ACE_TEXT ("'on_requested_incompatible_Qos' in Receiver\n") )); } - if (this->thread_id_listener_.value () == 0) - { - ACE_ERROR ((LM_ERROR, "RECEIVER ERROR: " - "Thread ID for ConnectorStatusListener not set!\n")); - } - #if defined (CIAO_DDS4CCM_CONTEXT_SWITCH) && (CIAO_DDS4CCM_CONTEXT_SWITCH == 1) - else if (ACE_OS::thr_equal (this->thread_id_listener_.value (), - ACE_Thread::self ())) - { - ACE_DEBUG ((LM_DEBUG, "RECEIVER OK: " - "Thread switch for ConnectorStatusListener seems OK. " - "(DDS uses the CCM thread for its callback) " - "listener <%u> - component <%u>\n", - this->thread_id_listener_.value (), - ACE_Thread::self ())); - } - else - { - ACE_ERROR ((LM_ERROR, "RECEIVER ERROR: " - "Thread switch for ConnectorStatusListener " - "doesn't seem to work! " - "listener <%u> - component <%u>\n", - this->thread_id_listener_.value (), - ACE_Thread::self ())); - } - #else - else if (ACE_OS::thr_equal (this->thread_id_listener_.value (), - ACE_Thread::self ())) - { - ACE_ERROR ((LM_ERROR, "RECEIVER ERROR: ConnectorStatusListener: " - "DDS seems to use a CCM thread for its callback: " - "listener <%u> - component <%u>\n", - this->thread_id_listener_.value (), - ACE_Thread::self ())); - } - else - { - ACE_DEBUG ((LM_DEBUG, "RECEIVER OK: ConnectorStatusListener: " - "DDS seems to use its own thread for its callback: " - "listener <%u> - component <%u>\n", - this->thread_id_listener_.value (), - ACE_Thread::self ())); - } - #endif } extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr |