Go to the documentation of this file.00001 #ifndef ACSTIME_TIMER_IMPL_H
00002 #define ACSTIME_TIMER_IMPL_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __cplusplus
00024 #error This is a C++ include file and cannot be used from plain C
00025 #endif
00026
00027 #include <baciCharacteristicComponentImpl.h>
00028 #include <baci.h>
00029 #include <ace/Timer_Heap_T.h>
00030 #include <ace/Timer_Queue_Adapters.h>
00031 #include <Event_Handler_Handle_Timeout_Upcall.h>
00032 #include <loggingLogger.h>
00034 #include "acstimeS.h"
00035 #include "ACSTimeError.h"
00036 #include "acstimeTimeUtil.h"
00037 #include "loggingLoggable.h"
00039
00052 class TimerImpl : public virtual acscomponent::ACSComponentImpl,
00053 public virtual POA_acstime::Timer
00054 {
00055 public:
00061 TimerImpl(
00062 const ACE_CString &name,
00063 maci::ContainerServices * containerServices);
00064
00068 virtual ~TimerImpl();
00070
00078 virtual CORBA::Long
00079 schedule(acstime::TimeoutHandler_ptr callBack,
00080 const acstime::Epoch &time,
00081 const acstime::Duration &interval);
00082
00091 virtual void
00092 cancel(CORBA::Long id);
00093
00095 private:
00096
00098 typedef ACE_Event_Handler_Handle_Timeout_Upcall Upcall;
00099
00101 typedef ACE_Timer_Heap_T<ACE_Event_Handler*,Upcall,ACE_Null_Mutex> Timer_Heap;
00102
00104 typedef ACE_Timer_Heap_Iterator_T<ACE_Event_Handler*,Upcall,ACE_Null_Mutex> Timer_Heap_Iterator;
00105
00107 typedef ACE_Thread_Timer_Queue_Adapter<Timer_Heap> Thread_Timer_Queue;
00108
00110 Thread_Timer_Queue *m_timerQueue;
00111
00113 TimerImpl(const TimerImpl&);
00114
00116 void operator= (const TimerImpl&);
00117
00119
00123 class Handler : public ACE_Event_Handler,
00124 public Logging::Loggable
00125
00126 {
00127 public:
00134 Handler(acstime::TimeoutHandler_ptr callBack,
00135 bool oneShotFlag);
00136
00140 virtual ~Handler();
00141
00150 int
00151 handle_timeout(const ACE_Time_Value&,
00152 const void*);
00153
00157 acstime::TimeoutHandler_var m_handler;
00158
00162 bool m_oneShotFlag;
00163
00164 };
00165 };
00166 #endif
00167