diff options
author | thrall <thrall@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-01-09 17:39:20 +0000 |
---|---|---|
committer | thrall <thrall@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-01-09 17:39:20 +0000 |
commit | f093afbfb022e81a9cdbd1213738c1c4a7b55aee (patch) | |
tree | 1e4aebb61f1b177029614a191b12905e0e43e6b2 | |
parent | 18392a2f2502a44f98c4c3d17c591411c031b794 (diff) | |
download | ATCD-f093afbfb022e81a9cdbd1213738c1c4a7b55aee.tar.gz |
Added local subclass of TAO_EC_Gateway_Sched called ECConfig_Gateway so we can make whatever changes (for example, debugging printouts) we find necessary
5 files changed, 143 insertions, 3 deletions
diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig.cpp b/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig.cpp index 6ed00a5b387..6e79b4a254f 100644 --- a/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig.cpp +++ b/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig.cpp @@ -6,6 +6,7 @@ #include "ECConfig.h" #include "Consumer.h" #include "Supplier.h" +#include "ECConfig_Gateway.h" #include <sstream> //for ostringstream @@ -24,7 +25,6 @@ #include "orbsvcs/Event/EC_Kokyu_Factory.h" #include "orbsvcs/RtecSchedulerC.h" #include "orbsvcs/RtecEventCommC.h" -#include "orbsvcs/Event/EC_Gateway_Sched.h" //REACTOR CHANGE #include "tao/ORB_Core.h" @@ -557,7 +557,8 @@ ECConfig<SCHED_STRAT>::make_federated (ACE_ENV_SINGLE_ARG_DECL) ACE_CHECK; ACE_DEBUG((LM_DEBUG,"Creating gateway\n")); - TAO_EC_Gateway_Sched *gateway = new TAO_EC_Gateway_Sched(); + //TAO_EC_Gateway_Sched *gateway = new TAO_EC_Gateway_Sched(); + ECConfig_Gateway *gateway = new ECConfig_Gateway(); ACE_DEBUG((LM_DEBUG,"Gateway init\n")); //for consumer, remote is supplier EC diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig_Gateway.cpp b/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig_Gateway.cpp new file mode 100644 index 00000000000..86f7c47da12 --- /dev/null +++ b/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig_Gateway.cpp @@ -0,0 +1,103 @@ +/** + * @author Stephen Torri + * $Id$ + */ +#include "ECConfig_Gateway.h" +#include "ace/OS_NS_stdio.h" + +ECConfig_Gateway::ECConfig_Gateway (void) {} +ECConfig_Gateway::~ECConfig_Gateway (void) {} + +void ECConfig_Gateway::push (const RtecEventComm::EventSet &events ACE_ENV_ARG_DECL_WITH_DEFAULTS) +{ + ACE_OS::printf ("ECConfig_Gateway::push - %p\n", &events); + TAO_EC_Gateway_Sched::push(events); +} + +void ECConfig_Gateway::update_consumer (const RtecEventChannelAdmin::ConsumerQOS& sub + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_OS::printf ("ECConfig_Gateway::update_consumer - %p\n", &sub); + ACE_OS::printf (" Dependencies:\n"); + for (unsigned int i = 0; i < sub.dependencies.length(); ++i) { + ACE_OS::printf(" Dep #%d\n",i); + // RtecEventComm::Event event + ACE_OS::printf(" - Event:\n"); + // RtecEventComm::EventHeader header + // RtecEventComm::EventType type; (Ulong) + // RtecEventComm::EventSourceID source; (Long) + // CORBA::Long ttl; + ACE_OS::printf(" type=%d source_id=%d ttl=%d\n", + sub.dependencies[i].event.header.type, + sub.dependencies[i].event.header.source, + sub.dependencies[i].event.header.ttl); + // RtecEventComm::Time creation_time;(Ulong) + // RtecEventComm::Time ec_recv_time; (Ulong) + // RtecEventComm::Time ec_send_time; (Ulong) + ACE_OS::printf(" creation_time=%llu\n ec_recv_time=%llu\n ec_send_time=%llu\n", + sub.dependencies[i].event.header.creation_time, + sub.dependencies[i].event.header.ec_recv_time, + sub.dependencies[i].event.header.ec_send_time); + // //RtecEventComm::EventData data + // RtecBase::handle_t rt_info + ACE_OS::printf(" - RT_Info: %d", sub.dependencies[i].rt_info); + } + ACE_OS::printf (" Is this a gateway:"); + if (sub.is_gateway) { + ACE_OS::printf (" true"); + } + else { + ACE_OS::printf (" false"); + } + ACE_OS::printf("\n"); + + TAO_EC_Gateway_Sched::update_consumer(sub); +} + +void ECConfig_Gateway::update_supplier (const RtecEventChannelAdmin::SupplierQOS& pub + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_OS::printf ("ECConfig_Gateway::update_supplier - %p\n", &pub); + // SupplierQOS + // RtecEventChannelAdmin::PublicationSet publications; + ACE_OS::printf (" Publications:\n"); + for (unsigned int i = 0; i < pub.publications.length(); ++i) { + ACE_OS::printf(" Pub #%d\n",i); + // Publication + // RtecEventComm::Event event; + ACE_OS::printf(" - Event:\n"); + // RtecEventComm::EventHeader header + // RtecEventComm::EventType type; (Ulong) + // RtecEventComm::EventSourceID source; (Long) + // CORBA::Long ttl; + ACE_OS::printf(" type=%d source_id=%d ttl=%d\n", + pub.publications[i].event.header.type, + pub.publications[i].event.header.source, + pub.publications[i].event.header.ttl); + // RtecEventComm::Time creation_time;(Ulong) + // RtecEventComm::Time ec_recv_time; (Ulong) + // RtecEventComm::Time ec_send_time; (Ulong) + ACE_OS::printf(" creation_time=%llu\n ec_recv_time=%llu\n ec_send_time=%llu\n", + pub.publications[i].event.header.creation_time, + pub.publications[i].event.header.ec_recv_time, + pub.publications[i].event.header.ec_send_time); + + // RtecBase::Dependency_Info dependency_info; + ACE_OS::printf(" - Dependency_Info\n"); + // RtecBase::Dependency_Type_t dependency_type; + ACE_OS::printf(" type: %d\n", pub.publications[i].dependency_info.dependency_type); + // CORBA::Long number_of_calls; + ACE_OS::printf(" number of calls: %d\n", pub.publications[i].dependency_info.number_of_calls); + // RtecBase::handle_t rt_info; + ACE_OS::printf(" rt_info: %d\n", pub.publications[i].dependency_info.rt_info); + // RtecBase::handle_t rt_info_depended_on; + ACE_OS::printf(" rt_info dependend on: %d\n", pub.publications[i].dependency_info.rt_info_depended_on); + // RtecBase::Dependency_Enabled_Type_t enabled; + ACE_OS::printf(" dependency enabled type: %d\n", pub.publications[i].dependency_info.enabled); + } + + + TAO_EC_Gateway_Sched::update_supplier(pub); +} diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig_Gateway.h b/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig_Gateway.h new file mode 100644 index 00000000000..560503bfa41 --- /dev/null +++ b/TAO/orbsvcs/examples/RtEC/test_driver/ECConfig_Gateway.h @@ -0,0 +1,34 @@ +/** + * @author Stephen Torri + * $Id$ + */ +#ifndef ECCONFIG_GATEWAY_H_ +#define ECCONFIG_GATEWAY_H + +#include <orbsvcs/Event/EC_Gateway_Sched.h> +#include <orbsvcs/RtecEventChannelAdminS.h> +#include <orbsvcs/RtecEventCommS.h> + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class ECConfig_Gateway : public TAO_EC_Gateway_Sched { + public: + ECConfig_Gateway (void); + ~ECConfig_Gateway (void); + + void push (const RtecEventComm::EventSet &events + ACE_ENV_ARG_DECL_WITH_DEFAULTS); + + virtual void update_consumer (const RtecEventChannelAdmin::ConsumerQOS& sub + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void update_supplier (const RtecEventChannelAdmin::SupplierQOS& pub + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + +}; + +#endif // ECCONFIG_GATEWAY_H_ diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/Makefile.test_driver_lib b/TAO/orbsvcs/examples/RtEC/test_driver/Makefile.test_driver_lib index 7fd1eaab536..d1cd7f55814 100644 --- a/TAO/orbsvcs/examples/RtEC/test_driver/Makefile.test_driver_lib +++ b/TAO/orbsvcs/examples/RtEC/test_driver/Makefile.test_driver_lib @@ -29,7 +29,8 @@ FILES = \ Test_Handler \ Config_Factory \ Timer_Event_Handler \ - cpuload + cpuload \ + ECConfig_Gateway #---------------------------------------------------------------------------- # Include macros and targets diff --git a/TAO/orbsvcs/examples/RtEC/test_driver/test_driver.mpc b/TAO/orbsvcs/examples/RtEC/test_driver/test_driver.mpc index 6ffac882fea..26eb427e725 100644 --- a/TAO/orbsvcs/examples/RtEC/test_driver/test_driver.mpc +++ b/TAO/orbsvcs/examples/RtEC/test_driver/test_driver.mpc @@ -10,6 +10,7 @@ project(test_driver_lib): orbsvcslib, rtevent, rtsched, rtkokyuevent, kokyu, ace Config_Factory.cpp Timer_Event_Handler.cpp cpuload.cpp + ECConfig_Gateway.cpp } Template_Files { |