Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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.8 2006/10/19 09:47:40 bjeram 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 
00039 using namespace baci;
00040 
00083 class acsexmpl_EXPORT LongDevIO : public DevIO<CORBA::Long>
00084 {
00085   public:
00086     
00090     LongDevIO() {};
00091 
00095     virtual ~LongDevIO() {};
00096 
00104     virtual bool 
00105     initializeValue()
00106         { return true; }
00107   
00125     virtual CORBA::Long 
00126     read(unsigned long long& timestamp)
00127         throw (ACSErr::ACSbaseExImpl)
00128         {
00129         
00130             //Must set the timestamp.  This value is in 100s of nanoseconds that have passed
00131             //since some date in the 1500s.  Most developers will just want to use the getTimeStamp
00132             //method, but you can find more information on the time defintion in the ACS Time 
00133             //System.
00134             timestamp = getTimeStamp();
00135 
00136             //Normally you'd want to access hardware, files, pipes, etc. here. We just return 42
00137             return 42;
00138         }
00139 
00157     virtual void 
00158     write(const CORBA::Long &value, unsigned long long& timestamp)
00159         throw (ACSErr::ACSbaseExImpl)
00160         {
00161             //Must set the timestamp.  This value is in 100s of nanoseconds that have passed
00162             //since some date in the 1500s (see ACS Time System documentation for specific details).  
00163             //Most developers will just want to use the getTimeStamp method.
00164             timestamp = getTimeStamp();
00165             
00166             //Print a message to standard out
00167             std::cout << "LongDevIO::write(...) - the value is:" << value << std::endl;
00168         }
00169 };
00170 
00171 #endif
00172 
00173 
00174 

Generated on Sun Oct 29 02:26:25 2006 for ACS C++ API by doxygen 1.3.6