Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

acstimeTimerImpl.h

Go to the documentation of this file.
00001 /* @(#) $Id: acstimeTimerImpl.h,v 1.22 2008/10/01 03:11:48 cparedes Exp $ 00002 * 00003 * Copyright (C) 2001 00004 * Associated Universities, Inc. Washington DC, USA. 00005 * 00006 * Produced for the ALMA project 00007 * 00008 * This library is free software; you can redistribute it and/or modify it it 00009 * under the terms of the GNU Library General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or (at your 00011 * option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful but WITHOUT 00014 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00015 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00016 * License for more details. 00017 * 00018 * You should have received a copy of the GNU Library General Public License 00019 * along with this library; if not, write to the Free Software Foundation, 00020 * Inc., 675 Massachusetts Ave, Cambridge, MA, 02139, USA. 00021 * 00022 * Correspondence concerning ALMA should be addressed as follows: 00023 * Internet email: alma-sw-admin@nrao.edu 00024 */ 00026 #ifndef ACSTIME_TIMER_IMPL_H 00027 #define ACSTIME_TIMER_IMPL_H 00028 00029 #ifndef __cplusplus 00030 #error This is a C++ include file and cannot be used from plain C 00031 #endif 00032 00033 #include <baciCharacteristicComponentImpl.h> 00034 #include <baci.h> 00035 #include <ace/Timer_Heap_T.h> 00036 #include <ace/Timer_Queue_Adapters.h> 00037 #include <loggingLogger.h> 00039 #include "acstimeS.h" 00040 #include "ACSTimeError.h" 00041 #include "acstimeTimeUtil.h" 00042 #include "loggingLoggable.h" 00044 00057 class TimerImpl : public virtual acscomponent::ACSComponentImpl, 00058 public virtual POA_acstime::Timer 00059 { 00060 public: 00066 TimerImpl( 00067 const ACE_CString &name, 00068 maci::ContainerServices * containerServices); 00069 00073 virtual ~TimerImpl(); 00075 00083 virtual CORBA::Long 00084 schedule(acstime::TimeoutHandler_ptr callBack, 00085 const acstime::Epoch &time, 00086 const acstime::Duration &interval); 00087 00096 virtual void 00097 cancel(CORBA::Long id); 00098 00100 private: 00101 00103 typedef ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex> Upcall; 00104 00106 typedef ACE_Timer_Heap_T<ACE_Event_Handler*,Upcall,ACE_Null_Mutex> Timer_Heap; 00107 00109 typedef ACE_Timer_Heap_Iterator_T<ACE_Event_Handler*,Upcall,ACE_Null_Mutex> Timer_Heap_Iterator; 00110 00112 typedef ACE_Thread_Timer_Queue_Adapter<Timer_Heap> Thread_Timer_Queue; 00113 00115 Thread_Timer_Queue *m_timerQueue; 00116 00118 TimerImpl(const TimerImpl&); 00119 00121 void operator= (const TimerImpl&); 00122 00124 00128 class Handler : public ACE_Event_Handler, 00129 public Logging::Loggable 00130 00131 { 00132 public: 00139 Handler(acstime::TimeoutHandler_ptr callBack, 00140 bool oneShotFlag); 00141 00145 virtual ~Handler(); 00146 00155 int 00156 handle_timeout(const ACE_Time_Value&, 00157 const void*); 00158 00162 acstime::TimeoutHandler_var m_handler; 00163 00167 bool m_oneShotFlag; 00168 00169 }; 00170 }; 00171 #endif 00172

Generated on Thu Apr 30 02:30:49 2009 for ACS C++ API by doxygen 1.3.8