Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

LCD_detector_CVS.cc

Go to the documentation of this file.
00001 // CVS $Id: LCD_detector_CVS.cc,v 1.8 2003/11/29 20:02:42 uid561 Exp $
00002 
00003 // => Organizes the output of the detector CVS header block.
00004 //
00005 // General Description:
00006 //
00007 // Organize the output of the detector CVS header block.
00008 //
00009 
00010 #include "SIO_definitions.h"
00011 #include "SIO_functions.h"
00012 
00013 #include "LCD_detector_CVS.hh"
00014 
00015 // Constructor.
00016 
00017 /*
00018  * Comment
00019  */
00020 LCD_detector_CVS::LCD_detector_CVS( const char* i_name ) : SIO_block( i_name )
00021 {
00022 
00023   CRC    = 0;
00024   header = "<unknown>";
00025 
00026 }
00027 
00028 // Destructor.
00029 
00030 /*
00031  * Comment
00032  */
00033 LCD_detector_CVS::~LCD_detector_CVS() {}
00034 
00035 // Get CRC.
00036 
00037 /*
00038  * Comment
00039  */
00040 unsigned int LCD_detector_CVS::getCRC() { return CRC; }
00041 
00042 // Get header.
00043 
00044 /*
00045  * Comment
00046  */
00047 const char* LCD_detector_CVS::getHeader() { return header.c_str(); }
00048 
00049 // Set CRC.
00050 
00051 /*
00052  * Comment
00053  */
00054 void LCD_detector_CVS::setCRC( unsigned int i_CRC ) { CRC = i_CRC; return; }
00055 
00056 // Set header
00057 
00058 
00059 /*
00060  * Comment
00061  */
00062 void LCD_detector_CVS::setHeader
00063 (
00064  char*    i_header
00065  )
00066 {
00067 
00068   //
00069   // Check for presence ofinput string.
00070   //
00071   if( i_header == NULL )
00072     return;
00073 
00074   //
00075   // Copy it!
00076   //
00077   header = i_header;
00078 
00079   //
00080   // That's all folks!
00081   //
00082   return;
00083 }
00084 
00085 // Transfer.
00086 
00087 
00088 /*
00089  * Comment
00090  */
00091 unsigned int LCD_detector_CVS::xfer
00092 (
00093  SIO_stream*     stream,
00094  SIO_operation   op,
00095  unsigned int    version
00096  )
00097 {
00098   if(version) ; // make compiler happy
00099   int
00100     nchr;
00101 
00102   char
00103     *temp;
00104 
00105   unsigned int
00106     status;
00107 
00108   //
00109   // Determine the length of the CVS header.
00110   //
00111   if( op == SIO_OP_WRITE )
00112     nchr = header.size();
00113 
00114   SIO_DATA( stream, &nchr, 1 );
00115 
00116   //
00117   // Transfer the CVS header.
00118   //
00119   if( op == SIO_OP_WRITE )
00120     {
00121       SIO_DATA( stream, const_cast<char*>(header.c_str()), nchr );
00122     }
00123 
00124   else if( op == SIO_OP_READ  )
00125     {
00126       temp = static_cast<char*>(malloc( nchr + 1 ));
00127       SIO_DATA( stream, temp, nchr );
00128       temp[nchr] = '\0';
00129       header = temp;
00130       free( temp );
00131     }
00132 
00133   //
00134   // The rest is easy.
00135   //
00136   SIO_DATA( stream, &CRC, 1 );
00137 
00138   //
00139   // That's all folks!
00140   //
00141   return( SIO_BLOCK_SUCCESS );
00142 }
00143 
00144 // Return version number (encoded).
00145 
00146 
00147 #define LCD_DETECTOR_CVS_MAJOR 1
00148 #define LCD_DETECTOR_CVS_MINOR 0
00149 
00150 /*
00151  * Comment
00152  */
00153 unsigned int LCD_detector_CVS::version()
00154 { return( SIO_VERSION_ENCODE( LCD_DETECTOR_CVS_MAJOR,
00155                               LCD_DETECTOR_CVS_MINOR ) ); }

Generated on Thu Oct 7 18:44:46 2004 for LCDG4 by doxygen 1.3.4