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

BadHardware Class Reference

#include <BadHardware.h>

Inheritance diagram for BadHardware:

DbiTableRow List of all members.

Public Member Functions

 BadHardware ()
 BadHardware (const string &type, Int_t id, const VldTimeStamp &start, const VldTimeStamp &stop, Int_t badness=0, const string &reason="")
 BadHardware (HardwareComponent component, const VldTimeStamp &start, const VldTimeStamp &stop, Int_t badness=0, const string &reason="")
 ~BadHardware ()
HardwareComponent GetComponent () const
VldTimeStamp GetStart () const
VldTimeStamp GetStop () const
Int_t GetBadness () const
const string & GetReason () const
Bool_t IsInEffect (VldTimeStamp ts) const
void Print (Option_t *option) const
Bool_t CanL2Cache () const
virtual DbiTableRowCreateTableRow () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const

Private Member Functions

 BadHardware (const BadHardware &from)

Private Attributes

Int_t fThingType
Int_t fThingId
UInt_t fStart
UInt_t fStop
Int_t fBadness
string fReason

Constructor & Destructor Documentation

BadHardware::BadHardware  )  [inline]
 

Definition at line 28 of file BadHardware.h.

00028 { LEA_CTOR; }    

BadHardware::BadHardware const string &  type,
Int_t  id,
const VldTimeStamp start,
const VldTimeStamp stop,
Int_t  badness = 0,
const string &  reason = ""
 

Definition at line 42 of file BadHardware.cxx.

00047                                                  :
00048   fThingType(HardwareType::FromString(type)),
00049   fThingId(id),
00050   fStart(start.GetSec()),
00051   fStop(stop.GetSec()),
00052   fBadness(badness),
00053   fReason(reason)
00054 { 
00055   LEA_CTOR;
00056 }

BadHardware::BadHardware HardwareComponent  component,
const VldTimeStamp start,
const VldTimeStamp stop,
Int_t  badness = 0,
const string &  reason = ""
 

Definition at line 58 of file BadHardware.cxx.

00062                                                 :
00063   fThingType(component.GetType()),
00064   fThingId(component.GetId()),
00065   fStart(start.GetSec()),
00066   fStop(stop.GetSec()),
00067   fBadness(badness),
00068   fReason(reason)
00069 {
00070   LEA_CTOR;
00071 }

BadHardware::~BadHardware  )  [inline]
 

Definition at line 44 of file BadHardware.h.

00044 { LEA_DTOR; };

BadHardware::BadHardware const BadHardware from  )  [inline, private]
 

Definition at line 70 of file BadHardware.h.

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


Member Function Documentation

Bool_t BadHardware::CanL2Cache  )  const [inline, virtual]
 

Reimplemented from DbiTableRow.

Definition at line 58 of file BadHardware.h.

00058 { return kTRUE; }

virtual DbiTableRow* BadHardware::CreateTableRow  )  const [inline, virtual]
 

Implements DbiTableRow.

Definition at line 59 of file BadHardware.h.

00059 { return new BadHardware; }

void BadHardware::Fill DbiResultSet rs,
const DbiValidityRec vrec
[virtual]
 

Implements DbiTableRow.

Definition at line 77 of file BadHardware.cxx.

References DbiRowStream::CurColName(), fBadness, fStart, fStop, fThingId, fThingType, DbiRowStream::IncrementCurCol(), MSG, DbiRowStream::NumCols(), and DbiRowStream::TableName().

00078                                                                 {
00079 
00080 
00081 //
00082 //  Purpose:  Fill object from Result Set
00083 //
00084 //  Arguments: 
00085 //    rs           in    Result Set used to fill object
00086 //    vrec         in    Associated validity record (or 0 if filling
00087 //                                                    DbiValidityRec)
00088 //  Return:    
00089 //
00090 //  Contact:   N. West
00091 //
00092 //  Specification:-
00093 //  =============
00094 //
00095 //  o Fill object from current row of Result Set.
00096 
00097 //  Program Notes:-
00098 //  =============
00099 
00100 //  This method demonstrates both the "dumb" fill method (just
00101 //  load the data as it comes) and the smart method (check column
00102 //  name and load according to column order). 
00103 
00104    if ( rs.TableName() == "BADHARDWARE" ) {
00105       // Dumb method.
00106      rs >> fThingType >> fThingId >> fStart >> fStop >> fBadness >> fReason;
00107    }
00108    else {
00109       
00110       // Smart method
00111       Int_t numCol = rs.NumCols();
00112       //  The first column (SeqNo) has already been processed.
00113       for (Int_t curCol = 2; curCol <= numCol; ++curCol) {
00114          string colName = rs.CurColName();
00115          if ( colName == "TYPE" )       rs >> fThingType;
00116          else if ( colName == "ID" )    rs >> fThingId;
00117          else if ( colName == "START" )   rs >> fStart;
00118          else if ( colName == "STOP" )    rs >> fStop;
00119          else if ( colName == "BADNESS" ) rs >> fBadness;
00120          else if ( colName == "REASON" )  rs >> fReason;
00121          else {
00122             MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol 
00123                                    << "(" << colName << ")"
00124                                    << "; not part of BadHardware" 
00125                                    << endl;
00126          rs.IncrementCurCol();
00127          }
00128       }
00129    }
00130    
00131    
00132 }

Int_t BadHardware::GetBadness  )  const [inline]
 

Definition at line 51 of file BadHardware.h.

Referenced by Print(), and Coroner::RecordBadStrips().

00051 { return fBadness; };

HardwareComponent BadHardware::GetComponent  )  const [inline]
 

Definition at line 47 of file BadHardware.h.

References fThingId, and fThingType.

Referenced by Print(), and Coroner::RecordBadStrips().

00047 { return HardwareComponent(fThingType,fThingId); };

const string& BadHardware::GetReason  )  const [inline]
 

Definition at line 52 of file BadHardware.h.

Referenced by Coroner::RecordBadStrips().

00052 { return fReason; };

VldTimeStamp BadHardware::GetStart  )  const [inline]
 

Definition at line 49 of file BadHardware.h.

References fStart.

Referenced by BadHardwareTableMaker::Add(), and Print().

00049 { return VldTimeStamp(fStart,0); };

VldTimeStamp BadHardware::GetStop  )  const [inline]
 

Definition at line 50 of file BadHardware.h.

References fStop.

Referenced by Print().

00050 { return VldTimeStamp(fStop,0); };

Bool_t BadHardware::IsInEffect VldTimeStamp  ts  )  const [inline]
 

Definition at line 84 of file BadHardware.h.

References VldTimeStamp::GetSec().

Referenced by Coroner::RecordBadStrips().

00085 {
00086   UInt_t sec = ts.GetSec();
00087   if(sec<fStart) return false;
00088   if(sec>=fStop) return false;
00089   return true;
00090 }

void BadHardware::Print Option_t *  option  )  const
 

Definition at line 167 of file BadHardware.cxx.

References VldTimeStamp::AsString(), HardwareComponent::AsString(), fReason, GetBadness(), GetComponent(), GetStart(), and GetStop().

00168 {
00169   std::cout << "BadHardware: " << GetComponent().AsString()
00170             << "  " << GetStart().AsString("s") 
00171             << " to " << GetStop().AsString("s")
00172             << "  " << GetBadness() << "  " << fReason << endl;
00173 }

void BadHardware::Store DbiOutRowStream ors,
const DbiValidityRec vrec
const [virtual]
 

Reimplemented from DbiTableRow.

Definition at line 136 of file BadHardware.cxx.

References fBadness, fStart, fStop, fThingId, and fThingType.

00137                                                                {
00138    //
00139 //
00140 //  Purpose:  Stream object to output row stream
00141 //
00142 //  Arguments: 
00143 //    ors          in     Output row stream.
00144 //    vrec         in    Associated validity record (or 0 if filling
00145 //                                                    DbiValidityRec)
00146 //
00147 //  Return:    
00148 //
00149 //  Contact:   N. West
00150 //
00151 //  Specification:-
00152 //  =============
00153 //
00154 //  o  Stream object to output row stream.
00155 
00156 //  Program Notes:-
00157 //  =============
00158 
00159 //  None.
00160 
00161   ors  << fThingType << fThingId << fStart << fStop << fBadness << fReason;
00162 }


Member Data Documentation

Int_t BadHardware::fBadness [private]
 

Definition at line 77 of file BadHardware.h.

Referenced by Fill(), and Store().

string BadHardware::fReason [private]
 

Definition at line 78 of file BadHardware.h.

Referenced by Print().

UInt_t BadHardware::fStart [private]
 

Definition at line 75 of file BadHardware.h.

Referenced by Fill(), GetStart(), and Store().

UInt_t BadHardware::fStop [private]
 

Definition at line 76 of file BadHardware.h.

Referenced by Fill(), GetStop(), and Store().

Int_t BadHardware::fThingId [private]
 

Definition at line 74 of file BadHardware.h.

Referenced by Fill(), GetComponent(), and Store().

Int_t BadHardware::fThingType [private]
 

Definition at line 73 of file BadHardware.h.

Referenced by Fill(), GetComponent(), and Store().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:08:45 2010 for loon by  doxygen 1.3.9.1