• 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 <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 

Generated on Thu Jan 12 2012 23:13:50 for ACS-10.0 C++ API by  doxygen 1.7.0