00001 /* @(#) $Id: acstimeDevIOTime.h,v 1.13 2008/10/09 07:31:16 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_DEVIO_TIME_H 00027 #define ACSTIME_DEVIO_TIME_H 00029 #ifndef __cplusplus 00030 #error This is a C++ include file and cannot be used from plain C 00031 #endif 00033 #include <baciDevIO.h> 00034 #include "acstimeTimeUtil.h" 00037 00052 class DevIOTime : public DevIO<ACS::Time> 00053 { 00054 public: 00058 DevIOTime() {} 00059 00063 virtual ~DevIOTime() {} 00064 00071 virtual bool 00072 initializeValue() {return true;} 00073 00084 virtual ACS::Time 00085 read(ACS::Time ×tamp) 00086 { 00087 timestamp = getTimeStamp(); 00088 00089 acstime::Epoch retValue = TimeUtil::ace2epoch(ACE_OS::gettimeofday()); 00090 return (ACS::Time)retValue.value; 00091 } 00092 00101 virtual void 00102 write(const ACS::Time &value, ACS::Time ×tamp) 00103 { 00104 ACE_UNUSED_ARG(value); 00105 timestamp = getTimeStamp(); 00106 } 00107 }; 00108 #endif 00109