00001
00002
00003 #include "SpillTimeND.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(SpillTimeND)
00011
00012 CVSID( "$Id: SpillTimeND.cxx,v 1.4 2007/03/01 17:02:25 rhatcher Exp $" );
00013
00014
00015
00016
00017 #include "DatabaseInterface/DbiResultPtr.tpl"
00018 template class DbiResultPtr<SpillTimeND>;
00019
00020 #include "DatabaseInterface/DbiWriter.tpl"
00021 template class DbiWriter<SpillTimeND>;
00022
00023
00024
00025
00026
00027
00028
00029 void SpillTimeND::Fill(DbiResultSet& rs,
00030 const DbiValidityRec* ) {
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 if ( rs.TableName() == "SPILLTIMEND" ) {
00051
00052 rs >> fSecond >> fNanoSec;
00053 }
00054
00055 else {
00056
00057
00058 Int_t numCol = rs.NumCols();
00059
00060 for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00061 string colName = rs.CurColName();
00062 if( colName == "SECOND" ) rs >> fSecond;
00063 else if( colName == "NANOSEC" ) rs >> fNanoSec;
00064 else {
00065 MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol
00066 << "(" << colName << ")"
00067 << "; not part of SpillTimeND"
00068 << endl;
00069 rs.IncrementCurCol();
00070 }
00071 }
00072 }
00073
00074
00075 }
00076
00077
00078
00079 void SpillTimeND::Store(DbiOutRowStream& ors,
00080 const DbiValidityRec* ) const {
00081
00082
00083
00084
00085
00086
00087
00088
00089 ors << fSecond << fNanoSec;
00090 }
00091
00092
00093