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

acsexmplLongDevIO.h

Go to the documentation of this file.
00001 #ifndef acsexmplLongDevIO_h
00002 #define acsexmplLongDevIO_h
00003 /*******************************************************************************
00004 *    ALMA - Atacama Large Millimiter Array
00005 *    (c) European Southern Observatory, 2002
00006 *    Copyright by ESO (in the framework of the ALMA collaboration)
00007 *    and Cosylab 2002, All rights reserved
00008 *
00009 *    This library is free software; you can redistribute it and/or
00010 *    modify it under the terms of the GNU Lesser General Public
00011 *    License as published by the Free Software Foundation; either
00012 *    version 2.1 of the License, or (at your option) any later version.
00013 *
00014 *    This library is distributed in the hope that it will be useful,
00015 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 *    Lesser General Public License for more details.
00018 *
00019 *    You should have received a copy of the GNU Lesser General Public
00020 *    License along with this library; if not, write to the Free Software
00021 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00022 *
00023 *
00024 * "@(#) $Id: acsexmplLongDevIO.h,v 1.11 2008/10/09 08:41:11 cparedes Exp $"
00025 *
00026 * who       when      what
00027 * --------  --------  ----------------------------------------------
00028 * david 2003-10-20 created
00029 */
00030 
00031 #ifndef __cplusplus
00032 #error This is a C++ include file and cannot be used from plain C
00033 #endif
00034 
00036 #include <baciDevIO.h>
00037 #include <iostream>
00038 
00044 
00049 
00084 /* @}*/
00085 /* @}*/
00086 
00095 class acsexmpl_EXPORT LongDevIO : public DevIO<CORBA::Long>
00096 {
00097   public:
00098     
00102     LongDevIO() {};
00103 
00107     virtual ~LongDevIO() {};
00108 
00116     virtual bool 
00117     initializeValue()
00118         { return true; }
00119   
00138     virtual CORBA::Long 
00139     read(unsigned long long& timestamp)
00140         {
00141         
00142             //Must set the timestamp.  This value is in 100s of nanoseconds that have passed
00143             //since some date in the 1500s.  Most developers will just want to use the getTimeStamp
00144             //method, but you can find more information on the time defintion in the ACS Time 
00145             //System.
00146             timestamp = getTimeStamp();
00147 
00148             //Normally you'd want to access hardware, files, pipes, etc. here. We just return 42
00149             return 42;
00150         }
00151 
00170     virtual void 
00171     write(const CORBA::Long &value, unsigned long long& timestamp)
00172         {
00173             //Must set the timestamp.  This value is in 100s of nanoseconds that have passed
00174             //since some date in the 1500s (see ACS Time System documentation for specific details).  
00175             //Most developers will just want to use the getTimeStamp method.
00176             timestamp = getTimeStamp();
00177             
00178             //Print a message to standard out
00179             std::cout << "LongDevIO::write(...) - the value is:" << value << std::endl;
00180         }
00181 };
00182 
00183 #endif
00184 
00185 
00186 

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