EC_Gateway_Sched.cpp

Go to the documentation of this file.
00001 // EC_Gateway_Sched.cpp,v 1.9 2006/03/14 06:14:25 jtc Exp
00002 
00003 #include "orbsvcs/Event/EC_Gateway_Sched.h"
00004 #include "orbsvcs/Time_Utilities.h"
00005 
00006 ACE_RCSID (Event, 
00007            EC_Gateway_sched, 
00008            "EC_Gateway_Sched.cpp,v 1.9 2006/03/14 06:14:25 jtc Exp")
00009 
00010 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00011 
00012 TAO_EC_Gateway_Sched::TAO_EC_Gateway_Sched (void)
00013   :  TAO_EC_Gateway_IIOP ()
00014 {
00015 }
00016 
00017 TAO_EC_Gateway_Sched::~TAO_EC_Gateway_Sched (void)
00018 {
00019 }
00020 
00021 void
00022 TAO_EC_Gateway_Sched::init (RtecEventChannelAdmin::EventChannel_ptr supplier_ec,
00023                            RtecEventChannelAdmin::EventChannel_ptr consumer_ec,
00024                            RtecScheduler::Scheduler_ptr supplier_sched,
00025                            RtecScheduler::Scheduler_ptr consumer_sched,
00026                            const char* consumer_name,
00027                            const char* supplier_name
00028                            ACE_ENV_ARG_DECL)
00029 {
00030   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
00031 
00032   this->init_i (supplier_ec, consumer_ec ACE_ENV_ARG_PARAMETER);
00033   ACE_CHECK;
00034 
00035   // @@ Should we throw a system exception here?
00036   if (CORBA::is_nil (supplier_sched)
00037       || CORBA::is_nil (consumer_sched)
00038       || consumer_name == 0
00039       || supplier_name == 0)
00040     ACE_THROW (CORBA::BAD_PARAM ());
00041 
00042   this->supplier_info_ =
00043     supplier_sched->create (supplier_name ACE_ENV_ARG_PARAMETER);
00044   ACE_CHECK;
00045 
00046   // @@ TODO Many things are hard-coded in the RT_Info here.
00047 
00048   // The worst case execution time is far less than 500 usecs, but
00049   // that is a safe estimate....
00050   ACE_Time_Value tv (0, 500);
00051   TimeBase::TimeT time;
00052   ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
00053   supplier_sched->set (this->supplier_info_,
00054                        RtecScheduler::VERY_HIGH_CRITICALITY,
00055                        time, time, time,
00056                        25000 * 10,
00057                        RtecScheduler::VERY_LOW_IMPORTANCE,
00058                        time,
00059                        0,
00060                        RtecScheduler::OPERATION
00061                        ACE_ENV_ARG_PARAMETER);
00062   ACE_CHECK;
00063 
00064   this->consumer_info_ =
00065     consumer_sched->create (consumer_name ACE_ENV_ARG_PARAMETER);
00066   ACE_CHECK;
00067 
00068   tv = ACE_Time_Value (0, 500);
00069   ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
00070   consumer_sched->set (this->consumer_info_,
00071                        RtecScheduler::VERY_HIGH_CRITICALITY,
00072                        time, time, time,
00073                        25000 * 10,
00074                        RtecScheduler::VERY_LOW_IMPORTANCE,
00075                        time,
00076                        1,
00077                        RtecScheduler::REMOTE_DEPENDANT
00078                        ACE_ENV_ARG_PARAMETER);
00079   ACE_CHECK;
00080 }
00081 
00082 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 13:11:07 2006 for TAO_RTEvent by doxygen 1.3.6