DbiDemoData1 Class Reference

#include <DbiDemoData1.h>

Inheritance diagram for DbiDemoData1:
DbiTableRow

List of all members.

Public Member Functions

 DbiDemoData1 ()
 DbiDemoData1 (const DbiDemoData1 &from)
 DbiDemoData1 (UInt_t s, Float_t p, Float_t g1, Float_t g2)
virtual ~DbiDemoData1 ()
Bool_t CanL2Cache () const
Bool_t Compare (const DbiDemoData1 &that) const
UInt_t GetIndex (UInt_t) const
Int_t GetSubSystem () const
Float_t GetPedestal () const
Float_t GetGain1 () const
Float_t GetGain2 () const
virtual DbiTableRowCreateTableRow () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const

Private Attributes

Int_t fSubSystem
Float_t fPedestal
Float_t fGain1
Float_t fGain2

Detailed Description

Definition at line 23 of file DbiDemoData1.h.


Constructor & Destructor Documentation

DbiDemoData1::DbiDemoData1 (  )  [inline]

Definition at line 30 of file DbiDemoData1.h.

References LEA_CTOR.

00030 { LEA_CTOR; }

DbiDemoData1::DbiDemoData1 ( const DbiDemoData1 from  )  [inline]

Definition at line 31 of file DbiDemoData1.h.

References LEA_CTOR.

00032     : DbiTableRow(from) { LEA_CTOR; *this = from; }

DbiDemoData1::DbiDemoData1 ( UInt_t  s,
Float_t  p,
Float_t  g1,
Float_t  g2 
) [inline]

Definition at line 33 of file DbiDemoData1.h.

References LEA_CTOR.

00033                                                             :
00034    fSubSystem(s),fPedestal(p),fGain1(g1),fGain2(g2) { LEA_CTOR; }
  virtual ~DbiDemoData1(){ LEA_DTOR; };

virtual DbiDemoData1::~DbiDemoData1 (  )  [inline, virtual]

Definition at line 35 of file DbiDemoData1.h.

References LEA_DTOR.

00035 { LEA_DTOR; };


Member Function Documentation

Bool_t DbiDemoData1::CanL2Cache (  )  const [inline, virtual]

Reimplemented from DbiTableRow.

Definition at line 39 of file DbiDemoData1.h.

00039 { return kTRUE; }

Bool_t DbiDemoData1::Compare ( const DbiDemoData1 that  )  const [inline]

Definition at line 40 of file DbiDemoData1.h.

References fGain1, fGain2, fPedestal, and fSubSystem.

00040                                                   {
00041                 return     fSubSystem == that.fSubSystem
00042                        &&  fPedestal  == that.fPedestal
00043                        &&  fGain1     == that.fGain1
00044                        &&  fGain2     == that.fGain2; }

virtual DbiTableRow* DbiDemoData1::CreateTableRow (  )  const [inline, virtual]

Implements DbiTableRow.

Definition at line 52 of file DbiDemoData1.h.

00052                                               { 
00053                                               return new DbiDemoData1; }

void DbiDemoData1::Fill ( DbiResultSet rs,
const DbiValidityRec vrec 
) [virtual]

Implements DbiTableRow.

Definition at line 53 of file DbiDemoData1.cxx.

References DbiRowStream::CurColName(), fGain1, fGain2, fPedestal, fSubSystem, DbiRowStream::IncrementCurCol(), Msg::kDebug, MSG, DbiRowStream::NumCols(), and DbiRowStream::TableName().

00054                                                           {
00055 //
00056 //
00057 //  Purpose:  Fill object from Result Set
00058 //
00059 //  Arguments: 
00060 //    rs           in    Result Set used to fill object
00061 //    vrec         in    Associated validity record (or 0 if filling
00062 //                                                    DbiValidityRec)
00063 //  Return:    
00064 //
00065 //  Contact:   N. West
00066 //
00067 //  Specification:-
00068 //  =============
00069 //
00070 //  o Fill object from current row of Result Set.
00071 
00072 //  Program Notes:-
00073 //  =============
00074 
00075 //  This method demonstrates both the "dumb" fill method (just
00076 //  load the data as it comes) and the smart method (check column
00077 //  name and load according to column order). 
00078 
00079   if (    rs.TableName() != "DEMOASCIIDATA" 
00080        && rs.TableName() != "DemoASCIIData" ) {
00081     
00082 // Dumb method.
00083   rs >> fSubSystem >> fPedestal >> fGain1 >> fGain2;
00084 
00085   }
00086   
00087 // Smart method
00088   else {
00089     Int_t numCol = rs.NumCols();
00090     //  The first column (SeqNo) has already been processed.
00091     for (Int_t curCol = 2; curCol <= numCol; ++curCol) {
00092       string colName = rs.CurColName();
00093       if (      colName == "SUBSYSTEM" ) rs >> fSubSystem;
00094       else if ( colName == "PEDESTAL" )  rs >> fPedestal;
00095       else if ( colName == "GAIN1" )     rs >> fGain1;
00096       else if ( colName == "GAIN2" )     rs >> fGain2;
00097       else {
00098         MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol 
00099                                << "(" << colName << ")"
00100                               << "; not part of DbiDemoData1" << endl;
00101         rs.IncrementCurCol();
00102       }
00103     }
00104     
00105   }
00106 }

Float_t DbiDemoData1::GetGain1 (  )  const [inline]

Definition at line 49 of file DbiDemoData1.h.

References fGain1.

00049 { return  fGain1; }

Float_t DbiDemoData1::GetGain2 (  )  const [inline]

Definition at line 50 of file DbiDemoData1.h.

References fGain2.

00050 { return fGain2; }

UInt_t DbiDemoData1::GetIndex ( UInt_t   )  const [inline, virtual]

Reimplemented from DbiTableRow.

Definition at line 46 of file DbiDemoData1.h.

References fSubSystem.

00046 { return fSubSystem + 3000000000U; }

Float_t DbiDemoData1::GetPedestal (  )  const [inline]

Definition at line 48 of file DbiDemoData1.h.

References fPedestal.

00048 { return fPedestal; }

Int_t DbiDemoData1::GetSubSystem (  )  const [inline]

Definition at line 47 of file DbiDemoData1.h.

References fSubSystem.

00047 { return fSubSystem; }

void DbiDemoData1::Store ( DbiOutRowStream ors,
const DbiValidityRec vrec 
) const [virtual]

Reimplemented from DbiTableRow.

Definition at line 109 of file DbiDemoData1.cxx.

References fGain1, fGain2, fPedestal, and fSubSystem.

00110                                                                  {
00111 //
00112 //
00113 //  Purpose:  Stream object to output row stream
00114 //
00115 //  Arguments: 
00116 //    ors          in     Output row stream.
00117 //    vrec         in    Associated validity record (or 0 if filling
00118 //                                                    DbiValidityRec)
00119 //
00120 //  Return:    
00121 //
00122 //  Contact:   N. West
00123 //
00124 //  Specification:-
00125 //  =============
00126 //
00127 //  o  Stream object to output row stream.
00128 
00129 //  Program Notes:-
00130 //  =============
00131 
00132 //  None.
00133 
00134 
00135   ors << fSubSystem << fPedestal << fGain1 << fGain2;
00136    
00137 }


Member Data Documentation

Float_t DbiDemoData1::fGain1 [private]

Definition at line 67 of file DbiDemoData1.h.

Referenced by Compare(), Fill(), GetGain1(), and Store().

Float_t DbiDemoData1::fGain2 [private]

Definition at line 68 of file DbiDemoData1.h.

Referenced by Compare(), Fill(), GetGain2(), and Store().

Float_t DbiDemoData1::fPedestal [private]

Definition at line 66 of file DbiDemoData1.h.

Referenced by Compare(), Fill(), GetPedestal(), and Store().

Int_t DbiDemoData1::fSubSystem [private]

Definition at line 65 of file DbiDemoData1.h.

Referenced by Compare(), Fill(), GetIndex(), GetSubSystem(), and Store().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1