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

BadHardware.h

Go to the documentation of this file.
00001 // $Id: BadHardware.h,v 1.2 2005/03/03 15:41:47 tagg Exp $
00002 
00003 #ifndef BADHARDWARE_H
00004 #define BADHARDWARE_H
00005 
00006 #include "DatabaseInterface/DbiTableRow.h"
00007 #include "LeakChecker/Lea.h"
00008 #include "Plex/PlexStripEndId.h"
00009 #include "Plex/PlexPixelSpotId.h"
00010 #include "RawData/RawChannelId.h"
00011 #include "Plex/PlexHandle.h"
00012 #include "HardwareComponent.h"
00013 #include "HardwareType.h"
00014 
00015 #include <vector>
00016 #include <string>
00017 
00018 using std::string;
00019 
00020 class DbiValidityRec;
00021 
00022 class BadHardware : public DbiTableRow
00023 {
00024 
00025 public:
00026   
00027   // Constructors and destructors.
00028   BadHardware() { LEA_CTOR; }    
00029 
00030   // Ctor for experts.
00031   BadHardware( const string& type,
00032                Int_t         id,
00033                const VldTimeStamp&  start,
00034                const VldTimeStamp&  stop,
00035                Int_t         badness=0,
00036                const string& reason="");
00037 
00038   BadHardware( HardwareComponent component,
00039                const VldTimeStamp&  start,
00040                const VldTimeStamp&  stop,
00041                Int_t         badness=0,
00042                const string& reason="");
00043 
00044   ~BadHardware() { LEA_DTOR; };
00045 
00046   // Get functions:
00047   HardwareComponent GetComponent() const { return HardwareComponent(fThingType,fThingId); };
00048 
00049   VldTimeStamp      GetStart() const { return VldTimeStamp(fStart,0); };
00050   VldTimeStamp      GetStop () const { return VldTimeStamp(fStop,0); };
00051   Int_t             GetBadness() const { return fBadness; };
00052   const string&     GetReason() const { return fReason; };
00053   Bool_t            IsInEffect(VldTimeStamp ts) const;
00054 
00055   void              Print(Option_t* option) const;
00056 
00057   // State testing member functions
00058   Bool_t CanL2Cache() const { return kTRUE; }
00059   virtual DbiTableRow* CreateTableRow() const { return new BadHardware; }
00060   
00061   // State changing member functions
00062   virtual void Fill(DbiResultSet& rs,
00063                     const DbiValidityRec* vrec);
00064   virtual void Store(DbiOutRowStream& ors,
00065                      const DbiValidityRec* vrec) const;
00066   
00067   
00068  private:  
00069   
00070   BadHardware(const BadHardware& from) : DbiTableRow(from) { LEA_CTOR; *this = from; };
00071     
00072   // Data members
00073   Int_t        fThingType;
00074   Int_t        fThingId;
00075   UInt_t       fStart;
00076   UInt_t       fStop;
00077   Int_t        fBadness;
00078   string       fReason; 
00079     
00080   ClassDef(BadHardware,1)    // Example of non-aggregated datadata type. 
00081 };
00082 
00083 
00084 inline Bool_t BadHardware::IsInEffect(VldTimeStamp ts) const 
00085 {
00086   UInt_t sec = ts.GetSec();
00087   if(sec<fStart) return false;
00088   if(sec>=fStop) return false;
00089   return true;
00090 }
00091 
00092 
00093 #endif  // BADHARDWARE_H

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