00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "config.h"
00019
00020 #include <assert_pp.h>
00021
00022 #include "BasicTaskCallbackImpl.hh"
00023 #include "BasicTaskQosketImpl.hh"
00024
00025 void BasicTaskQosketImpl::initSysconds(const quo::QuoKernel_ptr &kernel)
00026 throw (CORBA::SystemException)
00027 {
00028 quo::SysCond_var sc;
00029
00030 require(kernel != NULL);
00031
00032
00033 sc = kernel->bindSysCond("DeadlinesMissed",
00034 "quo::ValueSC",
00035 "quo_sc::ValueSCImpl");
00036
00037 this->myDeadlinesMissed =
00038 quo::ValueSC::_duplicate(quo::ValueSC::_narrow(sc.in()));
00039 this->myDeadlinesMissed->longValue(0);
00040
00041
00042 sc = kernel->bindSysCond("LastStatus",
00043 "quo::ValueSC",
00044 "quo_sc::ValueSCImpl");
00045
00046 this->myLastStatus =
00047 quo::ValueSC::_duplicate(quo::ValueSC::_narrow(sc.in()));
00048 this->myLastStatus->longValue(0);
00049 }
00050
00051 void BasicTaskQosketImpl::initCallbacks(const CORBA::ORB_ptr &orb)
00052 throw (CORBA::SystemException)
00053 {
00054 Qosket::Basic::BasicTaskCallback_var btc;
00055 BasicTaskCallbackImpl *btci;
00056
00057 require(!CORBA::is_nil(orb));
00058
00059 btci = new BasicTaskCallbackImpl();
00060 btc = btci->_this();
00061 this->myCallback = Qosket::Basic::BasicTaskCallback::_duplicate(btc.in());
00062 }
00063
00064 quo::ValueSC_ptr BasicTaskQosketImpl::DeadlinesMissed(void)
00065 throw (CORBA::SystemException)
00066 {
00067 quo::ValueSC_var retval;
00068
00069 retval = this->myDeadlinesMissed;
00070 return( retval._retn() );
00071 }
00072
00073 void BasicTaskQosketImpl::DeadlinesMissed(quo::ValueSC_ptr)
00074 throw (CORBA::SystemException)
00075 {
00076 }
00077
00078 quo::ValueSC_ptr BasicTaskQosketImpl::LastStatus(void)
00079 throw (CORBA::SystemException)
00080 {
00081 quo::ValueSC_var retval;
00082
00083 retval = this->myLastStatus;
00084 return( retval._retn() );
00085 }
00086
00087 void BasicTaskQosketImpl::LastStatus(quo::ValueSC_ptr)
00088 throw (CORBA::SystemException)
00089 {
00090 }
00091
00092 quo::Callback_ptr BasicTaskQosketImpl::Callback(void)
00093 throw (CORBA::SystemException)
00094 {
00095 Qosket::Basic::BasicTaskCallback_var retval;
00096
00097 retval = this->myCallback;
00098 return( retval._retn() );
00099 }
00100
00101 void BasicTaskQosketImpl::Callback(quo::Callback_ptr)
00102 throw (CORBA::SystemException)
00103 {
00104 }
00105
00106 CORBA::ULongLong BasicTaskQosketImpl::RUsage(void)
00107 throw (CORBA::SystemException)
00108 {
00109 CORBA::ULongLong retval = 0;
00110 struct rusage ru;
00111
00112 if( getrusage(RUSAGE_SELF, &ru) == 0 )
00113 {
00114 retval = ru.ru_utime.tv_usec;
00115 retval += ru.ru_utime.tv_sec * 1000000;
00116 }
00117 else
00118 {
00119 throw CORBA::UNKNOWN();
00120 }
00121 return( retval );
00122 }
00123
00124 void BasicTaskQosketImpl::RUsage(CORBA::ULongLong)
00125 throw (CORBA::SystemException)
00126 {
00127 }