summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Event/Basic/Schedule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/Event/Basic/Schedule.cpp')
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Schedule.cpp210
1 files changed, 0 insertions, 210 deletions
diff --git a/TAO/orbsvcs/tests/Event/Basic/Schedule.cpp b/TAO/orbsvcs/tests/Event/Basic/Schedule.cpp
deleted file mode 100644
index 6624eb52451..00000000000
--- a/TAO/orbsvcs/tests/Event/Basic/Schedule.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-// $Id$
-
-#include "Schedule.h"
-#include "Consumer.h"
-#include "Supplier.h"
-#include "orbsvcs/Event/EC_Event_Channel.h"
-#include "orbsvcs/Sched/Config_Scheduler.h"
-#include "orbsvcs/Event_Utilities.h"
-#include "orbsvcs/Scheduler_Factory.h"
-#include "orbsvcs/Time_Utilities.h"
-#include "ace/Get_Opt.h"
-#include "ace/Sched_Params.h"
-
-ACE_RCSID(EC_Tests_Basic, Schedule, "$Id$")
-
-int
-main (int argc, char *argv [])
-{
- EC_Schedule driver;
- return driver.run (argc, argv);
-}
-
-// ****************************************************************
-
-EC_Schedule::EC_Schedule (void)
-{
-}
-
-int
-EC_Schedule::parse_args (int& argc, char* argv[])
-{
- if (this->EC_Driver::parse_args (argc, argv) != 0)
- return -1;
-
- return 0;
-}
-
-void
-EC_Schedule::print_args (void) const
-{
- this->EC_Driver::print_args ();
-}
-
-void
-EC_Schedule::print_usage (void)
-{
- this->EC_Driver::print_usage ();
-}
-
-void
-EC_Schedule::initialize_ec_impl (CORBA::Environment &ACE_TRY_ENV)
-{
- this->scheduler_impl_ = new ACE_Config_Scheduler;
- this->scheduler_ = this->scheduler_impl_->_this (ACE_TRY_ENV);
- ACE_CHECK;
-
- this->EC_Driver::initialize_ec_impl (ACE_TRY_ENV);
-}
-
-void
-EC_Schedule::modify_attributes (TAO_EC_Event_Channel_Attributes& attr)
-{
- attr.scheduler = this->scheduler_.in (); // no need to dup
-}
-
-void
-EC_Schedule::execute_test (CORBA::Environment& ACE_TRY_ENV)
-{
- CORBA::Long min_priority =
- (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO)
- + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2;
- CORBA::Long max_priority =
- ACE_Sched_Params::priority_max (ACE_SCHED_FIFO);
-
- if (this->verbose ())
- ACE_DEBUG ((LM_DEBUG,
- "EC_Schedule (%P|%t) computing schedule\n"));
-
- RtecScheduler::RT_Info_Set_var infos;
- RtecScheduler::Config_Info_Set_var configs;
- RtecScheduler::Scheduling_Anomaly_Set_var anomalies;
- this->scheduler_->compute_scheduling (min_priority, max_priority,
- infos.out (),
- configs.out (),
- anomalies.out (),
- ACE_TRY_ENV);
- ACE_CHECK;
-
- if (this->verbose ())
- ACE_DEBUG ((LM_DEBUG,
- "EC_Schedule (%P|%t) schedule prepared\n"));
-
- ACE_Scheduler_Factory::dump_schedule (infos.in (),
- configs.in (),
- anomalies.in ());
-
- if (this->verbose ())
- ACE_DEBUG ((LM_DEBUG,
- "EC_Schedule (%P|%t) schedule dumped\n"));
-
-}
-
-void
-EC_Schedule::build_consumer_qos (
- int i,
- RtecEventChannelAdmin::ConsumerQOS& qos,
- int& shutdown_event_type,
- CORBA::Environment &ACE_TRY_ENV)
-{
- char name[128];
- ACE_OS::sprintf (name, "EC_Schedule::Consumer::%04.4x", i);
-
- RtecScheduler::handle_t rt_info =
- this->scheduler_->create (name, ACE_TRY_ENV);
- ACE_CHECK;
-
- // The worst case execution time is far less than 2
- // milliseconds, but that is a safe estimate....
- ACE_Time_Value tv (0, 2000);
- TimeBase::TimeT time;
- ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
- this->scheduler_->set (rt_info,
- RtecScheduler::VERY_HIGH_CRITICALITY,
- time, time, time,
- 0,
- RtecScheduler::VERY_LOW_IMPORTANCE,
- time,
- 0,
- RtecScheduler::OPERATION,
- ACE_TRY_ENV);
- ACE_CHECK;
-
- int type_start =
- this->consumer_type_start_
- + i * this->consumer_type_shift_;
-
- shutdown_event_type = type_start + this->consumer_type_count_;
-
- ACE_ConsumerQOS_Factory qos_factory;
- qos_factory.start_disjunction_group ();
- qos_factory.insert_type (shutdown_event_type, rt_info);
-
- for (int j = 0; j != this->consumer_type_count_; ++j)
- qos_factory.insert_type (type_start + j, rt_info);
-
- qos = qos_factory.get_ConsumerQOS ();
-}
-
-void
-EC_Schedule::build_supplier_qos (
- int i,
- RtecEventChannelAdmin::SupplierQOS& qos,
- int& shutdown_event_type,
- CORBA::Environment &ACE_TRY_ENV)
-{
- char name[128];
- ACE_OS::sprintf (name, "EC_Schedule::Supplier::%04.4x", i);
-
- RtecScheduler::handle_t rt_info =
- this->scheduler_->create (name, ACE_TRY_ENV);
- ACE_CHECK;
-
- ACE_Time_Value tv (0, this->burst_pause_);
- RtecScheduler::Period_t rate = tv.usec () * 10;
-
- // The execution times are set to reasonable values, but
- // actually they are changed on the real execution, i.e. we
- // lie to the scheduler to obtain right priorities; but we
- // don't care if the set is schedulable.
- tv.set (0, 2000);
- TimeBase::TimeT time;
- ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
- this->scheduler_->set (rt_info,
- RtecScheduler::VERY_HIGH_CRITICALITY,
- time, time, time,
- rate,
- RtecScheduler::VERY_LOW_IMPORTANCE,
- time,
- 1,
- RtecScheduler::OPERATION,
- ACE_TRY_ENV);
- ACE_CHECK;
-
- int type_start = this->supplier_type_start_ + i*this->supplier_type_shift_;
- int supplier_id = i + 1;
- shutdown_event_type = type_start + this->supplier_type_count_;
-
- ACE_SupplierQOS_Factory qos_factory;
- for (int j = 0; j != this->supplier_type_count_; ++j)
- qos_factory.insert (supplier_id,
- type_start + j,
- rt_info, 1);
-
- qos_factory.insert (supplier_id,
- shutdown_event_type,
- rt_info, 1);
-
- qos = qos_factory.get_SupplierQOS ();
-}
-
-void
-EC_Schedule::dump_results (void)
-{
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-
-#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */