00001 #include "DaqRunInfoSvc/DaqRunInfo.h" 00002 #include "DatabaseInterface/DbiLog.h" 00003 #include "DatabaseInterface/DbiOutRowStream.h" 00004 #include "DatabaseInterface/DbiResultSet.h" 00005 #include "DatabaseInterface/DbiValidityRec.h" 00006 00007 #include "DatabaseInterface/DbiResultPtr.tpl" 00008 template class DbiResultPtr<DaqRunInfo>; 00009 00010 #include "DatabaseInterface/DbiWriter.tpl" 00011 template class DbiWriter<DaqRunInfo>; 00012 00013 void DaqRunInfo::Fill(DbiResultSet& rs, 00014 const DbiValidityRec* /* vrec */) { 00015 00016 Int_t numCol = rs.NumCols(); 00017 // The first column (SeqNo) has already been processed. 00018 for (Int_t curCol = 2; curCol <= numCol; ++curCol) { 00019 string colName = rs.CurColName(); 00020 if ( colName == "RUNNO" ) rs >> m_RunNo; 00021 else if ( colName == "TRIGGERTYPE" ) rs >> m_TriggerType; 00022 else if ( colName == "RUNTYPE" ) rs >> m_RunType; 00023 else if ( colName == "DETECTORMASK" ) rs >> m_DetectorMask; 00024 else if ( colName == "PARTITIONNAME" ) rs >> m_PartitionName; 00025 else if ( colName == "SCHEMAVERSION" ) rs >> m_SchemaVersion; 00026 else if ( colName == "DATAVERSION" ) rs >> m_DataVersion; 00027 else if ( colName == "BASEVERSION" ) rs >> m_BaseVersion; 00028 else { 00029 LOG(dbi,Logging::kDebug1) << "Ignoring column " << curCol 00030 << "(" << colName << ")" 00031 << "; not part of DaqRunInfo" << std::endl; 00032 rs.IncrementCurCol(); 00033 } 00034 } 00035 00036 } 00037 00038 void DaqRunInfo::Store(DbiOutRowStream& ors, 00039 const DbiValidityRec* /* vrec */) const { 00040 ors << m_RunNo << m_TriggerType << m_RunType << m_DetectorMask 00041 << m_PartitionName << m_SchemaVersion << m_DataVersion 00042 << m_BaseVersion; 00043 00044 } 00045 00046