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

PulserTimingCardSetting.cxx

Go to the documentation of this file.
00001 #include "PulserTimingCardSetting.h"
00002 #include "DatabaseInterface/DbiResultSet.h"
00003 #include "MessageService/MsgService.h"
00004 #include <cassert>
00005 
00014 
00015 ClassImp(PulserTimingCardSetting)
00016 
00017 
00018 CVSID("$Id: PulserTimingCardSetting.cxx,v 1.6 2007/03/01 17:06:40 rhatcher Exp $");
00019 
00020 #include "DatabaseInterface/DbiResultPtr.tpl"
00021 template class  DbiResultPtr<PulserTimingCardSetting>;
00022 
00023 #include "DatabaseInterface/DbiWriter.tpl"
00024 template class  DbiWriter<PulserTimingCardSetting>;
00025 
00026 
00027 const double kDefaultOffset = 260.*Munits::ns;
00028 
00029 
00031 // Database stuff
00033 void PulserTimingCardSetting::Fill(DbiResultSet& rs, 
00034                          const DbiValidityRec* /* vrec */ ) {
00035 
00036 //
00037 //
00038 //  Purpose:  Fill object from Result Set
00039 //
00040 //  Arguments: 
00041 //    rs           in    Result Set used to fill object
00042 //    vrec         in    Associated validity record (or 0 if filling
00043 //                                                    DbiValidityRec)
00044 
00045    if ( rs.TableName() == "PULSERTIMINGCARDSETTING" ) {
00046       // Dumb method.
00047      rs  >> fPulserBox >> fDelay_ns;
00048    }
00049    else {      
00050      // Smart method
00051      Int_t numCol = rs.NumCols();
00052      //  The first column (SeqNo) has already been processed.
00053      for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00054        string colName = rs.CurColName();
00055        if ( colName     == "PULSERBOX" )        rs >> fPulserBox;
00056        else if( colName == "DELAYNS" )          rs >> fDelay_ns;
00057        else {
00058             MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol 
00059                                    << "(" << colName << ")"
00060                                    << "; not part of PulserTimingCardSetting" 
00061                                    << endl;
00062             rs.IncrementCurCol();
00063          }
00064       }
00065    }
00066    
00067 }
00068 
00069 
00070 void PulserTimingCardSetting::Store(DbiOutRowStream& ors,
00071                           const DbiValidityRec* /* vrec */) const 
00072 {
00073   //
00074   //
00075   //  Purpose:  Stream object to output row stream
00076   //
00077   
00078   ors << fPulserBox << fDelay_ns;
00079 }
00080 

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