diff options
Diffstat (limited to 'modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver')
4 files changed, 869 insertions, 0 deletions
diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver.idl b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver.idl new file mode 100644 index 00000000000..4f5b973bc6d --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver.idl @@ -0,0 +1,25 @@ +// $Id$ + +/** + * @file + * @author Marcel Smit <msmit@remedy.nl> + */ + +#ifndef RECEIVER_IDL +#define RECEIVER_IDL + +#include "Connector/QueryFilter_Test_Connector.idl" +#include "Base/QueryFilter_Starter.idl" + +module QueryFilter_Test +{ + component Receiver + { + port QueryFilterTestConn::DDS_Get get_port; + + provides QueryFilterStarter reader_start; + uses QueryFilterRestarter writer_restart; + }; +}; + +#endif diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver.mpc b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver.mpc new file mode 100755 index 00000000000..9b80fe796a4 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver.mpc @@ -0,0 +1,157 @@ +// $Id$ + +project(QueryFilter_Test_Receiver_idl_gen) : componentidldefaults, dds4ccm { + custom_only = 1 + after += QueryFilter_Test_Connector_idl_gen + idlflags += -Wb,stub_export_macro=RECEIVER_STUB_Export \ + -Wb,stub_export_include=Receiver_stub_export.h \ + -Wb,skel_export_macro=RECEIVER_SVNT_Export \ + -Wb,skel_export_include=Receiver_svnt_export.h \ + -Wb,svnt_export_macro=RECEIVER_SVNT_Export \ + -Wb,svnt_export_include=Receiver_svnt_export.h \ + -Wb,exec_export_macro=RECEIVER_EXEC_Export \ + -Wb,exec_export_include=Receiver_exec_export.h -I.. + + IDL_Files { + QueryFilter_Test_Receiver.idl + } +} + +project(QueryFilter_Test_Receiver_lem_gen) : ciaoidldefaults, dds4ccm { + after += QueryFilter_Test_Receiver_idl_gen + custom_only = 1 + idlflags += -Wb,stub_export_macro=RECEIVER_LEM_STUB_Export \ + -Wb,stub_export_include=Receiver_lem_stub_export.h \ + -SS -Gxhst -I.. + + IDL_Files { + QueryFilter_Test_ReceiverE.idl + } +} + +project(QueryFilter_Test_Receiver_lem_stub) : ccm_svnt, dds4ccm_base { + after += QueryFilter_Test_Receiver_lem_gen QueryFilter_Test_Receiver_stub \ + QueryFilter_Test_Connector_stub QueryFilter_Test_Base_stub \ + DDS_QueryFilter_Starter_stub + libs += Receiver_stub QueryFilter_Test_Connector_stub \ + QueryFilter_Test_Base_stub QueryFilter_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_lem_stub + dynamicflags = RECEIVER_LEM_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_ReceiverEC.cpp + } + + Header_Files { + QueryFilter_Test_ReceiverEC.h + Receiver_lem_stub_export.h + } + + Inline_Files { + QueryFilter_Test_ReceiverEC.inl + } +} + +project(QueryFilter_Test_Receiver_stub) : ccm_stub, dds4ccm_base { + after += QueryFilter_Test_Receiver_idl_gen QueryFilter_Test_Connector_stub \ + QueryFilter_Test_Base_stub QueryFilter_Test_Connector_lem_gen \ + DDS_QueryFilter_Starter_stub DDS_QueryFilter_Starter_lem_stub + libs += QueryFilter_Test_Connector_stub QueryFilter_Test_Base_stub \ + QueryFilter_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + sharedname = Receiver_stub + dynamicflags = RECEIVER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_ReceiverC.cpp + } + + Header_Files { + QueryFilter_Test_ReceiverC.h + Receiver_stub_export.h + } + + Inline_Files { + QueryFilter_Test_ReceiverC.inl + } +} + +project(QueryFilter_Test_Receiver_exec) : ciao_executor, dds4ccm_base { + after += QueryFilter_Test_Receiver_lem_stub QueryFilter_Test_Receiver_stub \ + QueryFilter_Test_Base_stub QueryFilter_Test_Connector_stub \ + QueryFilter_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS_QueryFilter_Starter_lem_stub DDS_QueryFilter_Starter_stub + sharedname = Receiver_exec + libs += Receiver_stub Receiver_lem_stub QueryFilter_Test_Base_stub \ + QueryFilter_Test_Connector_stub QueryFilter_Test_Connector_lem_stub \ + DDS4CCM_lem_stub QueryFilter_Starter_lem_stub QueryFilter_Starter_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_EXEC_BUILD_DLL READER_STARTER_STUB_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_Receiver_exec.cpp + } + + Header_Files { + QueryFilter_Test_Receiver_exec.h + Receiver_exec_export.h + } + + Inline_Files { + } +} + + +project(QueryFilter_Test_Receiver_svnt) : ciao_servant, dds4ccm_base { + after += QueryFilter_Test_Receiver_lem_stub QueryFilter_Test_Base_stub \ + QueryFilter_Test_Connector_stub QueryFilter_Test_Connector_svnt \ + QueryFilter_Test_Receiver_exec QueryFilter_Test_Connector_lem_stub \ + DDS4CCM_lem_stub DDS4CCM_skel DDS_QueryFilter_Starter_stub \ + DDS_QueryFilter_Starter_svnt DDS_QueryFilter_Starter_lem_stub + sharedname = Receiver_svnt + libs += Receiver_stub Receiver_lem_stub QueryFilter_Test_Base_stub \ + QueryFilter_Test_Connector_stub QueryFilter_Test_Connector_svnt \ + Receiver_exec QueryFilter_Test_Connector_lem_stub DDS4CCM_lem_stub \ + DDS4CCM_skel QueryFilter_Starter_stub QueryFilter_Starter_svnt \ + QueryFilter_Starter_lem_stub + libpaths += ../lib + libout = ../lib + includes += .. + dynamicflags = RECEIVER_SVNT_BUILD_DLL + + IDL_Files { + } + + Source_Files { + QueryFilter_Test_ReceiverS.cpp + QueryFilter_Test_Receiver_svnt.cpp + } + + Header_Files { + QueryFilter_Test_ReceiverS.h + QueryFilter_Test_Receiver_svnt.h + Receiver_svnt_export.h + } + + Inline_Files { + QueryFilter_Test_ReceiverS.inl + } +} + + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver_exec.cpp b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver_exec.cpp new file mode 100644 index 00000000000..a9992f030fb --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver_exec.cpp @@ -0,0 +1,545 @@ +// -*- C++ -*- +// +// $Id$ + +#include "QueryFilter_Test_Receiver_exec.h" + +#include "ace/OS_NS_unistd.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "ace/Log_Msg.h" + +#include "dds4ccm/impl/dds4ccm_conf.h" + +#define QUERY "( (iteration > %0) AND (iteration < %1) )" + +#define MIN_ITERATION_1 "2" +#define MAX_ITERATION_1 "5" + +#define MIN_ITERATION_2 "12" +#define MAX_ITERATION_2 "25" + + +namespace CIAO_QueryFilter_Test_Receiver_Impl +{ + //============================================================ + // read_action_Generator + //============================================================ + read_action_Generator::read_action_Generator (Receiver_exec_i &callback, int run) + : callback_ (callback), + run_ (run) + { + } + + read_action_Generator::~read_action_Generator () + { + } + + int + read_action_Generator::handle_timeout (const ACE_Time_Value &, const void *) + { + ACE_DEBUG ((LM_DEBUG, "Checking if last sample " + "is available in DDS...\n")); + if (this->run_ == 1 || this->callback_.check_last ()) + { + this->callback_.run (this->run_); + } + return 0; + } + + //============================================================ + // Starter_exec_i + //============================================================ + Starter_exec_i::Starter_exec_i (Receiver_exec_i & callback) + : callback_ (callback) + { + } + + Starter_exec_i::~Starter_exec_i (void) + { + } + + void + Starter_exec_i::set_reader_properties (CORBA::UShort nr_keys, + CORBA::UShort nr_iterations) + { + this->callback_.keys (nr_keys); + this->callback_.iterations (nr_iterations); + } + + void + Starter_exec_i::start_read (CORBA::UShort run) + { + this->callback_.start_read (run); + } + + //============================================================ + // Receiver_exec_i + //============================================================ + Receiver_exec_i::Receiver_exec_i (void) + : iterations_ (10), + keys_ (5), + has_run_ (false), + current_min_iteration_ (ACE_OS::atoi (MIN_ITERATION_1)), + current_max_iteration_ (ACE_OS::atoi (MAX_ITERATION_1)), + ticker_ (0) + { + } + + Receiver_exec_i::~Receiver_exec_i (void) + { + } + + + bool + Receiver_exec_i::check_last () + { + try + { + QueryFilterTest queryfiltertest_info; + ::CCM_DDS::ReadInfo readinfo; + char key[100]; + ACE_OS::sprintf (key, "KEY_%d", this->keys_); + queryfiltertest_info.symbol = CORBA::string_dup (key); + this->reader_->read_one_last ( + queryfiltertest_info, + readinfo, + ::DDS::HANDLE_NIL); + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::check_last - " + "last iteration <%d> - <%d>\n", + queryfiltertest_info.iteration, + this->current_max_iteration_ - 1)); + return queryfiltertest_info.iteration >= this->current_max_iteration_ - 1; + } + catch (...) + { + // no need to catch. An error is given + // when this example didn't run at all. + } + return false; + } + + // Supported operations and attributes. + void + Receiver_exec_i::check_iter (const QueryFilterTest & sample, + const char * test) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%C ALL : ") + ACE_TEXT ("sample received for <%C>: iteration <%u>\n"), + test, + sample.symbol.in (), + sample.iteration)); + if (sample.iteration <= ACE_OS::atoi (MIN_ITERATION_1)) + { + ACE_ERROR ((LM_ERROR, "ERROR: %C ALL: " + "Didn't expect samples with iterations " + "<= %d\n", + test, + this->current_min_iteration_)); + } + if (sample.iteration > this->current_max_iteration_) + { + ACE_ERROR ((LM_ERROR, "ERROR: %C ALL: " + "Didn't expect samples with iterations " + "> %d\n", + test, + this->current_max_iteration_)); + } + } + + + void + Receiver_exec_i::read_all (void) + { + QueryFilterTestSeq *queryfiltertest_info_seq; + ::CCM_DDS::ReadInfoSeq *readinfo_seq; + this->reader_->read_all ( + queryfiltertest_info_seq, + readinfo_seq); + if (queryfiltertest_info_seq->length () == 0) + { + ACE_ERROR ((LM_ERROR, "ERROR : Receiver_exec_i::read_all : " + "No samples available in Reader!\n")); + } + for (CORBA::ULong it = 0; it < queryfiltertest_info_seq->length (); ++it) + { + this->check_iter ((*queryfiltertest_info_seq)[it], "READ"); + } + } + + void + Receiver_exec_i::get_all (void) + { + if (::CORBA::is_nil (this->getter_)) + { + ACE_ERROR ((LM_ERROR, "ERROR: No Getter\n")); + } + QueryFilterTest * qf_info = new QueryFilterTest; + ::CCM_DDS::ReadInfo readinfo; + bool result = this->getter_->get_one (qf_info, readinfo); + this->check_iter (*qf_info, "GET"); + while (result) + { + result = this->getter_->get_one (qf_info, readinfo); + if (result) + { + this->check_iter (*qf_info, "GET"); + } + } + } + + void + Receiver_exec_i::test_all () + { + const char * test = "GET ALL"; + try + { + get_all (); + test = "READ ALL"; + read_all (); + } + catch (const CCM_DDS::NonExistent& ex) + { + for (CORBA::ULong i = 0; i < ex.indexes.length (); ++i) + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ERROR %C: ") + ACE_TEXT ("caught expected exception: index <%u>\n"), + test, + ex.indexes[i])); + } + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: %C: ") + ACE_TEXT ("caught InternalError exception: retval <%u>\n"), + test, + ex.error_code)); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception (test); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("ERROR: Receiver_exec_i::test_all : Exception caught\n"))); + } + } + + void + Receiver_exec_i::test_exception () + { + CCM_DDS::QueryFilter * filter = 0; + try + { + filter = this->reader_->filter (); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::test_excep - " + "Expected InternalErr excep caught : retval <%u>\n", + ex.error_code)); + return; + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: Receiver_exec_i::test_exception: "); + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::test_exception - " + "Unexpected exception caught\n")); + return; + } + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::test_exception - " + "No exception caught while retrieving unset filter.\n")); + } + + void + Receiver_exec_i::check_filter () + { + CCM_DDS::QueryFilter * filter = 0; + try + { + filter = this->reader_->filter (); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "caught InternalError exception: retval <%u>\n", + ex.error_code)); + return; + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: Receiver_exec_i::check_filter: "); + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Exception caught\n")); + return; + } + + //check query + bool error = false; + if (ACE_OS::strcmp (filter->query, QUERY) != 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Unexpected query when retrieving filter: " + "expected <%C> - received <%C>\n", + QUERY, filter->query.in ())); + error = true; + } + //check current parameters. + if (filter->query_parameters.length () != 2) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Unexpected number of parameters: " + "expected <%d> - received <%d>\n", + 2, filter->query_parameters.length ())); + error = true; + } + + if (filter->query_parameters.length () >= 1) + { + if (ACE_OS::atoi (filter->query_parameters[0]) != this->current_min_iteration_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Unexpected query when retrieving filter: " + "expected <%C> - received <%C>\n", + QUERY, filter->query.in ())); + error = true; + } + } + if (filter->query_parameters.length () >= 2) + { + if (ACE_OS::atoi (filter->query_parameters[1]) != this->current_max_iteration_) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::check_filter - " + "Unexpected query when retrieving filter: " + "expected <%C> - received <%C>\n", + QUERY, filter->query.in ())); + error = true; + } + } + if (!error) + { + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::check_filter - " + "Passed check_filter test.\n")); + } + } + + void + Receiver_exec_i::test_set_query_parameters () + { + try + { + CCM_DDS::QueryFilter filter; + filter.query = CORBA::string_dup ("na"); + filter.query_parameters.length (2); + filter.query_parameters[0] = CORBA::string_dup (MIN_ITERATION_2); + filter.query_parameters[1] = CORBA::string_dup (MAX_ITERATION_2); + this->reader_->filter (filter); + this->current_min_iteration_ = ACE_OS::atoi (MIN_ITERATION_2); + this->current_max_iteration_ = ACE_OS::atoi (MAX_ITERATION_2); + } + catch (const CCM_DDS::InternalError& ex) + { + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::test_set_query_parameters - " + "caught InternalError exception: retval <%u>\n", + ex.error_code)); + return; + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("ERROR: Receiver_exec_i::test_set_query_parameters: "); + ACE_ERROR ((LM_ERROR, "ERROR: Receiver_exec_i::test_set_query_parameters - " + "Exception caught\n")); + return; + } + } + + void + Receiver_exec_i::set_filter () + { + ACE_DEBUG ((LM_DEBUG, "Set filter\n")); + CCM_DDS::QueryFilter filter; + filter.query = CORBA::string_dup (QUERY); + filter.query_parameters.length (2); + filter.query_parameters[0] = CORBA::string_dup (MIN_ITERATION_1); + filter.query_parameters[1] = CORBA::string_dup (MAX_ITERATION_1); + this->reader_->filter (filter); + } + + void + Receiver_exec_i::start_read (CORBA::UShort run) + { + this->ticker_ = new read_action_Generator (*this, run); + if (this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->schedule_timer ( + this->ticker_, + 0, + ACE_Time_Value(1, 0), + ACE_Time_Value(1, 0)) == -1) + { + ACE_ERROR ((LM_ERROR, "Unable to schedule Timer\n")); + } + } + + void + Receiver_exec_i::run (CORBA::UShort run) + { + if (this->ticker_) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + this->ticker_ = 0; + } + this->has_run_ = true; + ACE_DEBUG ((LM_DEBUG, "Receiver_exec_i::run - " + "Starting run number <%d>\n", + run)); + switch (run) + { + case 1: + { + test_exception (); + set_filter (); + this->restarter_->restart_write (); + } + break; + case 2: + { + test_all (); + check_filter (); + test_set_query_parameters (); + this->restarter_->restart_write (); + } + break; + case 3: + { + test_all (); + check_filter (); + } + break; + } + } + + ::CORBA::UShort + Receiver_exec_i::iterations (void) + { + return this->iterations_; + } + + void + Receiver_exec_i::iterations (::CORBA::UShort iterations) + { + this->iterations_ = iterations; + } + + ::CORBA::UShort + Receiver_exec_i::keys (void) + { + return this->keys_; + } + + void + Receiver_exec_i::keys (::CORBA::UShort keys) + { + this->keys_ = keys; + } + + // Port operations. + ::QueryFilter_Test::QueryFilterTestConn::CCM_Listener_ptr + Receiver_exec_i::get_read_port_data_listener (void) + { + return ::QueryFilter_Test::QueryFilterTestConn::CCM_Listener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_read_port_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_DDS::CCM_PortStatusListener_ptr + Receiver_exec_i::get_get_port_status (void) + { + return ::CCM_DDS::CCM_PortStatusListener::_nil (); + } + + ::CCM_QueryFilterStarter_ptr + Receiver_exec_i::get_reader_start () + { + return new Starter_exec_i (*this); + } + + // Operations from Components::SessionComponent. + void + Receiver_exec_i::set_session_context ( + ::Components::SessionContext_ptr ctx) + { + this->context_ = + ::QueryFilter_Test::CCM_Receiver_Context::_narrow (ctx); + if ( ::CORBA::is_nil (this->context_.in ())) + { + throw ::CORBA::INTERNAL (); + } + } + + void + Receiver_exec_i::configuration_complete (void) + { + } + + void + Receiver_exec_i::ccm_activate (void) + { + this->reader_ = this->context_->get_connection_get_port_data (); + this->getter_ = this->context_->get_connection_get_port_fresh_data (); + DDS::Duration_t to; + to.sec = 5; + to.nanosec = 0; + if (! ::CORBA::is_nil (this->getter_)) + { + this->getter_->time_out (to); + } + else + { + ACE_ERROR ((LM_ERROR, "ERROR: Unable to set time out.\n")); + } + this->restarter_ = this->context_->get_connection_writer_restart (); +} + + void + Receiver_exec_i::ccm_passivate (void) + { + if (this->ticker_) + { + this->context_->get_CCM_object()->_get_orb ()->orb_core ()->reactor ()->cancel_timer (this->ticker_); + delete this->ticker_; + this->ticker_ = 0; + } + } + + void + Receiver_exec_i::ccm_remove (void) + { + if (!this->has_run_) + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: ") + ACE_TEXT ("Test did not run: Didn't receive ") + ACE_TEXT ("the expected number of DATA_ON_READER ") + ACE_TEXT ("events.\n"))); + } + else + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Finished query filter test.\n"))); + } + } + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QueryFilter_Test_Receiver_Impl (void) + { + ::Components::EnterpriseComponent_ptr retval = + ::Components::EnterpriseComponent::_nil (); + + ACE_NEW_NORETURN ( + retval, + Receiver_exec_i); + + return retval; + } +} + diff --git a/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver_exec.h b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver_exec.h new file mode 100644 index 00000000000..91f373abf67 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/tests/QueryFilter/Receiver/QueryFilter_Test_Receiver_exec.h @@ -0,0 +1,142 @@ +// -*- C++ -*- +// $Id$ + +#ifndef CIAO_RECEIVER_EXEC_H_ +#define CIAO_RECEIVER_EXEC_H_ + +#include "QueryFilter_Test_ReceiverEC.h" + +#include /**/ "Receiver_exec_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +#include <map> + +namespace CIAO_QueryFilter_Test_Receiver_Impl +{ + class Receiver_exec_i; + + //============================================================ + // read_action_Generator + //============================================================ + class read_action_Generator + : public ACE_Event_Handler + { + public: + read_action_Generator (Receiver_exec_i &callback, + int run); + + ~read_action_Generator (); + + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *arg); + private: + Receiver_exec_i &callback_; + int run_; + + }; + + //============================================================ + // Starter_exec_i + //============================================================ + class Starter_exec_i + : public virtual ::CCM_QueryFilterStarter, + public virtual ::CORBA::LocalObject + { + public: + Starter_exec_i (Receiver_exec_i & callback); + virtual ~Starter_exec_i (void); + + virtual void set_reader_properties (CORBA::UShort nr_keys, + CORBA::UShort nr_iterations); + virtual void start_read (CORBA::UShort run); + + private: + Receiver_exec_i &callback_; + }; + + //============================================================ + // Receiver_exec_i + //============================================================ + class RECEIVER_EXEC_Export Receiver_exec_i + : public virtual Receiver_Exec, + public virtual ::CORBA::LocalObject + { + public: + Receiver_exec_i (void); + virtual ~Receiver_exec_i (void); + + // Supported operations and attributes. + // Component attributes. + + // Port operations. + virtual ::QueryFilter_Test::QueryFilterTestConn::CCM_Listener_ptr + get_read_port_data_listener (void); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_read_port_status (void); + + virtual ::CCM_QueryFilterStarter_ptr + get_reader_start (); + + virtual ::CCM_DDS::CCM_PortStatusListener_ptr + get_get_port_status (void); + + bool check_last (); + void start_read (CORBA::UShort run); + void run (CORBA::UShort run); + + ::CORBA::UShort iterations (void); + + void iterations (::CORBA::UShort iterations); + + ::CORBA::UShort keys (void); + + void keys (::CORBA::UShort keys); + + // Operations from Components::SessionComponent. + virtual void + set_session_context ( + ::Components::SessionContext_ptr ctx); + + virtual void configuration_complete (void); + + virtual void ccm_activate (void); + virtual void ccm_passivate (void); + virtual void ccm_remove (void); + + private: + ::QueryFilter_Test::CCM_Receiver_Context_var context_; + ::QueryFilter_Test::QueryFilterTestConn::Reader_var reader_; + ::QueryFilter_Test::QueryFilterTestConn::Getter_var getter_; + QueryFilterRestarter_var restarter_; + CORBA::UShort iterations_; + CORBA::UShort keys_; + bool has_run_; + + int current_min_iteration_; + int current_max_iteration_; + + read_action_Generator *ticker_; + + void test_all (void); + void read_all (void); + void get_all (void); + void check_iter (const QueryFilterTest & sample, + const char * test); + void check_filter (void); + void test_exception (void); + void test_set_query_parameters (void); + void set_filter (void); + }; + + extern "C" RECEIVER_EXEC_Export ::Components::EnterpriseComponent_ptr + create_QueryFilter_Test_Receiver_Impl (void); +} + +#endif /* ifndef */ + |