00001 /* @(#) $Id: acstimeClockImpl.h,v 1.17 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_CLOCK_IMPL_H 00027 #define ACSTIME_CLOCK_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 <baciRWlong.h> 00036 #include <baciROuLongLong.h> 00037 #include <ace/Timer_Heap_T.h> 00038 #include <ace/Timer_Queue_Adapters.h> 00040 #include "acstimeS.h" 00041 #include "ACSTimeError.h" 00042 #include "acstimeTimeUtil.h" 00043 #include "acstimeDevIOTime.h" 00045 00064 class ClockImpl : public virtual baci::CharacteristicComponentImpl, 00065 public virtual POA_acstime::Clock 00066 { 00067 public: 00069 00076 ClockImpl( 00077 const ACE_CString &name, 00078 maci::ContainerServices * containerServices); 00079 00083 virtual ~ClockImpl(); 00085 00092 virtual acstime::Duration 00093 getTimeInterval(const acstime::Epoch &prevEpoch); 00094 00102 virtual ACS::RWlong_ptr 00103 array2TAI(); 00104 00112 virtual ACS::RWlong_ptr 00113 TAI2UTC(); 00114 00122 virtual ACS::ROuLongLong_ptr 00123 now(); 00124 00133 virtual acstime::Epoch 00134 fromISO8601(acstime::TimeSystem ts, 00135 const char *iso); 00136 00145 virtual char* 00146 toISO8601(acstime::TimeSystem ts, 00147 const acstime::Epoch &timeValue); 00148 00150 private: 00151 00155 baci::RWlong *m_array2TAI; 00156 00160 baci::RWlong *m_TAI2UTC; 00161 00165 baci::ROuLongLong *m_now; 00166 00170 DevIOTime *m_now_dev; 00171 00173 ClockImpl(const ClockImpl&); 00174 00176 void operator= (const ClockImpl&); 00178 }; 00179 #endif 00180