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 <loggingLogger.h>
00033 #include "acstimeS.h"
00034 #include "ACSTimeError.h"
00035 #include "acstimeTimeUtil.h"
00036 #include "loggingLoggable.h"
00038
00051 class TimerImpl : public virtual acscomponent::ACSComponentImpl,
00052 public virtual POA_acstime::Timer
00053 {
00054 public:
00060 TimerImpl(
00061 const ACE_CString &name,
00062 maci::ContainerServices * containerServices);
00063
00067 virtual ~TimerImpl();
00069
00077 virtual CORBA::Long
00078 schedule(acstime::TimeoutHandler_ptr callBack,
00079 const acstime::Epoch &time,
00080 const acstime::Duration &interval);
00081
00090 virtual void
00091 cancel(CORBA::Long id);
00092
00094 private:
00095
00097 typedef ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex> Upcall;
00098
00100 typedef ACE_Timer_Heap_T<ACE_Event_Handler*,Upcall,ACE_Null_Mutex> Timer_Heap;
00101
00103 typedef ACE_Timer_Heap_Iterator_T<ACE_Event_Handler*,Upcall,ACE_Null_Mutex> Timer_Heap_Iterator;
00104
00106 typedef ACE_Thread_Timer_Queue_Adapter<Timer_Heap> Thread_Timer_Queue;
00107
00109 Thread_Timer_Queue *m_timerQueue;
00110
00112 TimerImpl(const TimerImpl&);
00113
00115 void operator= (const TimerImpl&);
00116
00118
00122 class Handler : public ACE_Event_Handler,
00123 public Logging::Loggable
00124
00125 {
00126 public:
00133 Handler(acstime::TimeoutHandler_ptr callBack,
00134 bool oneShotFlag);
00135
00139 virtual ~Handler();
00140
00149 int
00150 handle_timeout(const ACE_Time_Value&,
00151 const void*);
00152
00156 acstime::TimeoutHandler_var m_handler;
00157
00161 bool m_oneShotFlag;
00162
00163 };
00164 };
00165 #endif
00166