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

SpillTimeCalibration.cxx

Go to the documentation of this file.
00001 
00002 
00003 #include "SpillTimeCalibration.h"
00004 #include "MessageService/MsgService.h"
00005 #include "DatabaseInterface/DbiOutRowStream.h"
00006 #include "DatabaseInterface/DbiResultSet.h"
00007 #include "DatabaseInterface/DbiValidityRec.h"
00008 
00009 
00010 ClassImp(SpillTimeCalibration)
00011 
00012 CVSID( "$Id: SpillTimeCalibration.cxx,v 1.1 2008/05/30 18:35:43 tagg Exp $" );
00013 
00014 //  Instantiate associated Result Pointer class.
00015 //  *******************************************
00016 
00017 #include "DatabaseInterface/DbiResultPtr.tpl"
00018 template class  DbiResultPtr<SpillTimeCalibration>;
00019 
00020 #include "DatabaseInterface/DbiWriter.tpl"
00021 template class  DbiWriter<SpillTimeCalibration>;
00022 
00023 // Definition of member functions (alphabetical order)
00024 // ***************************************************
00025 
00026 
00027 //.....................................................................
00028 
00029 void SpillTimeCalibration::Fill(DbiResultSet& rs, 
00030                               const DbiValidityRec* /* vrec */) {
00031 
00032 //
00033 //
00034 //  Purpose:  Fill object from Result Set
00035 //
00036 //  Arguments: 
00037 //    rs           in    Result Set used to fill object
00038 //    vrec         in    Associated validity record (or 0 if filling
00039 //                                                    DbiValidityRec)
00040 //
00041 //  o Fill object from current row of Result Set.
00042 
00043 //  Program Notes:-
00044 //  =============
00045 
00046 //  This method demonstrates both the "dumb" fill method (just
00047 //  load the data as it comes) and the smart method (check column
00048 //  name and load according to column order). 
00049 
00050    if ( rs.TableName() == "SPILLTIMECALIBRATION" ) {
00051       // Dumb method.
00052      rs  >> fOffset >> fError >> fDescription;
00053    }
00054 
00055    else {
00056       
00057       // Smart method
00058       Int_t numCol = rs.NumCols();
00059       //  The first column (SeqNo) has already been processed.
00060       for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00061          string colName = rs.CurColName();
00062               if( colName == "OFFSET" )      rs >> fOffset;
00063          else if( colName == "ERROR" )       rs >> fError;
00064          else if( colName == "DESCRIPTION" ) rs >> fDescription;
00065          else {
00066            MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol 
00067                                   << "(" << colName << ")"
00068                                   << "; not part of SpillTimeCalibration" 
00069                                   << endl;
00070            rs.IncrementCurCol();
00071          }
00072       }
00073    }
00074    
00075    
00076 }
00077 
00078 
00079 //.....................................................................
00080 void SpillTimeCalibration::Store(DbiOutRowStream& ors,
00081                                const DbiValidityRec* /* vrec */) const {
00082   //
00083   //
00084   //  Purpose:  Stream object to output row stream
00085   //
00086   //  Arguments: 
00087   //    ors          in     Output row stream.
00088   //    vrec         in    Associated validity record (or 0 if filling
00089   
00090   ors << fOffset << fError << fDescription;
00091 }
00092 //.....................................................................
00093 
00094 

Generated on Mon Feb 15 11:07:38 2010 for loon by  doxygen 1.3.9.1