EC_Gateway_Sched.cpp

Go to the documentation of this file.
00001 // $Id: EC_Gateway_Sched.cpp 76589 2007-01-25 18:04:11Z elliott_c $
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            "$Id: EC_Gateway_Sched.cpp 76589 2007-01-25 18:04:11Z elliott_c $")
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 {
00029   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
00030 
00031   this->init_i (supplier_ec, consumer_ec);
00032 
00033   // @@ Should we throw a system exception here?
00034   if (CORBA::is_nil (supplier_sched)
00035       || CORBA::is_nil (consumer_sched)
00036       || consumer_name == 0
00037       || supplier_name == 0)
00038     throw CORBA::BAD_PARAM ();
00039 
00040   this->supplier_info_ =
00041     supplier_sched->create (supplier_name);
00042 
00043   // @@ TODO Many things are hard-coded in the RT_Info here.
00044 
00045   // The worst case execution time is far less than 500 usecs, but
00046   // that is a safe estimate....
00047   ACE_Time_Value tv (0, 500);
00048   TimeBase::TimeT time;
00049   ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
00050   supplier_sched->set (this->supplier_info_,
00051                        RtecScheduler::VERY_HIGH_CRITICALITY,
00052                        time, time, time,
00053                        25000 * 10,
00054                        RtecScheduler::VERY_LOW_IMPORTANCE,
00055                        time,
00056                        0,
00057                        RtecScheduler::OPERATION);
00058 
00059   this->consumer_info_ =
00060     consumer_sched->create (consumer_name);
00061 
00062   tv = ACE_Time_Value (0, 500);
00063   ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
00064   consumer_sched->set (this->consumer_info_,
00065                        RtecScheduler::VERY_HIGH_CRITICALITY,
00066                        time, time, time,
00067                        25000 * 10,
00068                        RtecScheduler::VERY_LOW_IMPORTANCE,
00069                        time,
00070                        1,
00071                        RtecScheduler::REMOTE_DEPENDANT);
00072 }
00073 
00074 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Tue Feb 2 17:44:05 2010 for TAO_RTEvent by  doxygen 1.4.7