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

Dcs_Hv.cxx

Go to the documentation of this file.
00001 
00002 #include "Dcs_Hv.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_Hv)
00009 
00010 //   Definition of static data members
00011 //   *********************************
00012 
00013 CVSID("$Id: Dcs_Hv.cxx,v 1.3 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_Hv>;
00020 
00021 #include "DatabaseInterface/DbiWriter.tpl"
00022 template class  DbiWriter<Dcs_Hv>;
00023 
00024 // Definition of member functions (alphabetical order)
00025 // ***************************************************
00026 
00027 
00028 //.....................................................................
00029 
00030 void Dcs_Hv::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_HV" 
00047 //       && rs.TableName() != "Dcs_Hv" ) {
00048     
00049 // Dumb method.
00050           rs >> iLogical >> iGeom >> iMainframe >> iCard >> iChannel >> iPlane >> iSupermod >> iSide >> iPmt >> iSetV >> iReadV >> iAlarm;
00051   
00052 //  }
00053   
00054 // Smart method
00055 /*  else {
00056     Int_t numCol = rs.NumCols();
00057     //  The first column (SeqNo) has already been processed.
00058     for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00059       string colName = rs.CurColName();
00060       if (      colName == "HV_LOGICAL" ) rs >> iLogical;
00061       else if ( colName == "HV_GEOMETRICAL" )  rs >> iGeom;
00062       else if ( colName == "HV_MAINFRAME" )     rs >> iMainframe;
00063       else if ( colName == "HV_CARD" )     rs >> iCard;
00064       else if ( colName == "HV_CHANNEL" )     rs >> iChannel;
00065       else if ( colName == "HV_PLANE" )     rs >> iPlane;
00066       else if ( colName == "HV_SUPERMODULE" )     rs >> iSupermod;
00067       else if ( colName == "HV_SIDE" )     rs >> iSide;
00068       else if ( colName == "HV_PMTNUMBER" )     rs >> iPmt;
00069       else if ( colName == "HV_SETVOLTAGE" )     rs >> iSetV;
00070       else if ( colName == "HV_READVOLTAGE" )     rs >> iReadV;
00071       else if ( colName == "HV_ERROR" )     rs >> iAlarm;
00072       else {
00073         MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol 
00074                                << "(" << colName << ")"
00075                               << "; not part of DcsHv" << endl;
00076         rs.IncrementCurCol();
00077       }
00078     }  
00079   }
00080 */
00081 }
00082 //.....................................................................
00083 
00084 void Dcs_Hv::Store(DbiOutRowStream& ors,
00085                          const DbiValidityRec* /* vrec */) const {
00086 //  Purpose:  Stream object to output row stream
00087 //
00088 //  Arguments: 
00089 //    ors          in     Output row stream.
00090 //    vrec         in    Associated validity record (or 0 if filling
00091 //                                                    DbiValidityRec)
00092 //  o  Stream object to output row stream.
00093 
00094   ors << iLogical << iGeom << iMainframe << iCard << iChannel << iPlane << iSupermod << iSide << iPmt << iSetV << iReadV << iAlarm;
00095 //  printf("printing for logical %d    geom %d\n",iLogical,iGeom); 
00096 }
00097 
00098 

Generated on Mon Feb 15 11:06:36 2010 for loon by  doxygen 1.3.9.1