• Classes
  • Modules
  • Namespaces
  • Files
  • Related Pages
  • File List
  • File Members

acstimeTimerImpl.h

Go to the documentation of this file.
00001 #ifndef ACSTIME_TIMER_IMPL_H
00002 #define ACSTIME_TIMER_IMPL_H
00003 /*******************************************************************************
00004 * ALMA - Atacama Large Millimiter Array
00005 * Copyright (c) European Southern Observatory, 2011
00006 *
00007 * This library is free software; you can redistribute it and/or
00008 * modify it under the terms of the GNU Lesser General Public
00009 * License as published by the Free Software Foundation; either
00010 * version 2.1 of the License, or (at your option) any later version.
00011 *
00012 * This library is distributed in the hope that it will be useful,
00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 * Lesser General Public License for more details.
00016 *
00017 * You should have received a copy of the GNU Lesser General Public
00018 * License along with this library; if not, write to the Free Software
00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00020 *
00021 * "@(#) $Id: acstimeTimerImpl.h,v 1.23 2011/10/28 15:12:04 hsommer Exp $"
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 

Generated on Mon May 4 2015 08:27:42 for ACS-2015.4 C++ API by  doxygen 1.7.0