00001 00002 #include "Dcs_Can.h" 00003 #include "MessageService/MsgService.h" 00004 #include "DatabaseInterface/DbiOutRowStream.h" 00005 #include "DatabaseInterface/DbiResultSet.h" 00006 #include "DatabaseInterface/DbiValidityRec.h" 00007 00008 ClassImp(Dcs_Can) 00009 00010 // Definition of static data members 00011 // ********************************* 00012 00013 CVSID("$Id: Dcs_Can.cxx,v 1.4 2005/03/11 16:17:48 west Exp $\n CVSID_DBIRESULTPTR "); 00014 00015 // Instantiate associated Result Pointer class. 00016 // ******************************************* 00017 00018 #include "DatabaseInterface/DbiResultPtr.tpl" 00019 template class DbiResultPtr<Dcs_Can>; 00020 00021 #include "DatabaseInterface/DbiWriter.tpl" 00022 template class DbiWriter<Dcs_Can>; 00023 00024 // Definition of member functions (alphabetical order) 00025 // *************************************************** 00026 00027 00028 //..................................................................... 00029 00030 void Dcs_Can::Fill(DbiResultSet& rs, 00031 const DbiValidityRec* /* vrec */) { 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 // This method demonstrates both the "dumb" fill method (just 00043 // load the data as it comes) and the smart method (check column 00044 // name and load according to column order). 00045 00046 // if ( rs.TableName() != "DCS_Can" 00047 // && rs.TableName() != "Dcs_Can" ) { 00048 00049 // Dumb method. 00050 rs >> iCrateNo >> iPower >> fVolt1 >> fVolt2 >> fVolt3 >> fVolt4 >> fCurr1 >> fCurr2 >> fCurr3 >> fCurr4 >> iCrTemp; 00051 // } 00052 00053 // Smart method 00054 /* else { 00055 Int_t numCol = rs.NumCols(); 00056 // The first column (SeqNo) has already been processed. 00057 for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) { 00058 string colName = rs.CurColName(); 00059 if ( colName == "Can_RACKNO" ) rs >> iRackno; 00060 else if ( colName == "Can_PACKEDDATA" ) rs >> iRackraw; 00061 else if ( colName == "Can_RACKSTATUS" ) rs >> iRackstatus; 00062 else if ( colName == "Can_ISWARN" ) rs >> iWarn; 00063 else if ( colName == "Can_ISERROR" ) rs >> iErr; 00064 else { 00065 MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol 00066 << "(" << colName << ")" 00067 << "; not part of DcsCan" << endl; 00068 rs.IncrementCurCol(); 00069 } 00070 } 00071 00072 } 00073 */ 00074 } 00075 //..................................................................... 00076 00077 void Dcs_Can::Store(DbiOutRowStream& ors, 00078 const DbiValidityRec* /* vrec */) const { 00079 // Purpose: Stream object to output row stream 00080 // 00081 // Arguments: 00082 // ors in Output row stream. 00083 // vrec in Associated validity record (or 0 if filling 00084 // DbiValidityRec) 00085 // o Stream object to output row stream. 00086 00087 ors << iCrateNo << iPower << fVolt1 << fVolt2 << fVolt3 << fVolt4 << fCurr1 << fCurr2 << fCurr3 << fCurr4 << iCrTemp; 00088 } 00089 00090
1.3.9.1