MCFilePOTInfo Class Reference

#include <MCFilePOTInfo.h>

Inheritance diagram for MCFilePOTInfo:
DbiTableRow

List of all members.

Public Member Functions

 MCFilePOTInfo ()
 MCFilePOTInfo (MCFilePOTInfoKey key, Int_t foo, Float_t bar)
 MCFilePOTInfo (const MCFilePOTInfo &from)
virtual ~MCFilePOTInfo ()
Bool_t CanL2Cache () const
void SetAggregateNo (Int_t aggNo)
Int_t GetAggregateNo () const
virtual DbiTableRowCreateTableRow () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const
bool IsSameAll (const MCFilePOTInfo &other) const
virtual void Print (const Option_t *opt="") const

Public Attributes

MCFilePOTInfoKey fKey
Float_t fFoo
Int_t fBar
std::string fComment

Private Attributes

Int_t fAggNo

Friends

std::istream & operator>> (std::istream &is, MCFilePOTInfo &row)
std::ostream & operator<< (std::ostream &os, const MCFilePOTInfo &row)

Detailed Description

this is the actual DBI row format

Definition at line 64 of file MCFilePOTInfo.h.


Constructor & Destructor Documentation

MCFilePOTInfo::MCFilePOTInfo (  )  [inline]

Definition at line 73 of file MCFilePOTInfo.h.

References LEA_CTOR.

00073                    : fKey(), fFoo(-1), fBar(-1)
00074                    , fComment(""), fAggNo(-1) { LEA_CTOR; }

MCFilePOTInfo::MCFilePOTInfo ( MCFilePOTInfoKey  key,
Int_t  foo,
Float_t  bar 
) [inline]

Definition at line 76 of file MCFilePOTInfo.h.

References LEA_CTOR.

00077      : fKey(key)
00078      , fFoo(foo)
00079      , fBar(bar)
00080      , fComment("")
00081      , fAggNo(-1) // leave fAggNo alone
00082     {  LEA_CTOR; }

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

Definition at line 84 of file MCFilePOTInfo.h.

References LEA_CTOR.

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

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

Definition at line 87 of file MCFilePOTInfo.h.

References LEA_DTOR.

00087 { LEA_DTOR; };


Member Function Documentation

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

Reimplemented from DbiTableRow.

Definition at line 90 of file MCFilePOTInfo.h.

00090 { return kTRUE; }

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

Implements DbiTableRow.

Definition at line 98 of file MCFilePOTInfo.h.

00098 { return new MCFilePOTInfo; }

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

Implements DbiTableRow.

Definition at line 153 of file MCFilePOTInfo.cxx.

References DbiRowStream::CurColName(), fBar, MCFilePOTInfoKey::fBlah, fComment, fFoo, fKey, MCFilePOTInfoKey::fVersion, DbiValidityRec::GetAggregateNo(), DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), Msg::kDebug, MSG, DbiRowStream::NumCols(), SetAggregateNo(), and DbiRowStream::TableName().

00154                                                      {
00155 
00156 //
00157 //
00158 //  Purpose:  Fill object from Result Set
00159 //
00160 //  Arguments: 
00161 //    rs           in    Result Set used to fill object
00162 //    vrec         in    Associated validity record (or 0 if filling
00163 //                                                    DbiValidityRec)
00164 //
00165 //  o Fill object from current row of Result Set.
00166 
00167 //  Program Notes:-
00168 //  =============
00169 
00170 //  This method demonstrates both the "dumb" fill method (just
00171 //  load the data as it comes) and the smart method (check column
00172 //  name and load according to column order). 
00173 
00174    // know internally what aggregate number this is
00175    if ( vrec ) { SetAggregateNo(vrec->GetAggregateNo()); }
00176 
00177    if ( rs.TableName() == "MCFILEPOTINFO" ) {
00178       // Dumb method.
00179      rs  >> fKey.fBlah >> fKey.fVersion >> fFoo >> fBar >> fComment;
00180 
00181    } else {      
00182       // Smart method allows for column reordering/addition/deletion
00183       Int_t numCol = rs.NumCols();
00184       //  The first column (SeqNo) has already been processed.
00185       for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00186         string colName = rs.CurColName();
00187         if      ( colName == "BLAH" ) {
00188           rs >> fKey.fBlah;
00189           // one could do derived info here
00190         }
00191         else if ( colName == "VERSION" )     rs >> fKey.fVersion;
00192         else if ( colName == "FOO" )         rs >> fFoo;
00193         else if ( colName == "BAR" )         rs >> fBar;
00194         else if ( colName == "USRCOMMENT" )  rs >> fComment;
00195         else {
00196           MSG("Dbi",Msg::kDebug) 
00197             << "Ignoring column " << curCol << "(" << colName << ")"
00198             << "; not part of MCFilePOTInfo" << endl;
00199           rs.IncrementCurCol();
00200         }
00201       }
00202    }
00203    
00204 }

Int_t MCFilePOTInfo::GetAggregateNo (  )  const [inline, virtual]

Reimplemented from DbiTableRow.

Definition at line 92 of file MCFilePOTInfo.h.

References fAggNo.

00092 { return fAggNo; }

bool MCFilePOTInfo::IsSameAll ( const MCFilePOTInfo other  )  const

Definition at line 230 of file MCFilePOTInfo.cxx.

References AreDoublesSame(), fBar, fFoo, fKey, and MCFilePOTInfoKey::IsSameKey().

00231 {
00232   // return true if _everything_ about the other object is equivalent
00233   // both in the keys and values ... except don't compare comments
00234 
00235   // check the keys using already defined function
00236   if ( ! fKey.IsSameKey(other.fKey) ) return false;
00237 
00238   // now check the non-key values
00239 
00240   // can't directly compare floats/doubles because imprecision on
00241   // extra bits that can come along for the ride; use function
00242   if ( ! AreDoublesSame(fFoo,other.fFoo) ) return false;
00243 
00244   // ints can be directly compared
00245   if ( fBar != other.fBar ) return false;
00246 
00247   return true;
00248 }

void MCFilePOTInfo::Print ( const Option_t *  opt = ""  )  const [virtual]

Definition at line 251 of file MCFilePOTInfo.cxx.

00252 {
00253   std::cout << *this << std::endl;
00254 }

void MCFilePOTInfo::SetAggregateNo ( Int_t  aggNo  )  [inline]

Definition at line 91 of file MCFilePOTInfo.h.

References fAggNo.

Referenced by Fill().

00091 { fAggNo = aggNo; }

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

Reimplemented from DbiTableRow.

Definition at line 208 of file MCFilePOTInfo.cxx.

References fBar, MCFilePOTInfoKey::fBlah, fComment, fFoo, fKey, and MCFilePOTInfoKey::fVersion.

00209                                                                   {
00210   //
00211   //
00212   //  Purpose:  Stream object to output row stream
00213   //
00214   //  Arguments: 
00215   //    ors          in     Output row stream.
00216   //    vrec         in    Associated validity record (or 0 if filling
00217   
00218   // write a row to the stream
00219   // the ordering here must actually match the table column order
00220   ors
00221     // output the key columns
00222     << fKey.fBlah << fKey.fVersion 
00223     // output the value colmns
00224     << fFoo << fBar << fComment;
00225 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const MCFilePOTInfo row 
) [friend]
std::istream& operator>> ( std::istream &  is,
MCFilePOTInfo row 
) [friend]

Member Data Documentation

Int_t MCFilePOTInfo::fAggNo [private]

Definition at line 132 of file MCFilePOTInfo.h.

Referenced by GetAggregateNo(), operator<<(), and SetAggregateNo().

Definition at line 127 of file MCFilePOTInfo.h.

Referenced by Fill(), IsSameAll(), operator<<(), operator>>(), and Store().

Definition at line 128 of file MCFilePOTInfo.h.

Referenced by Fill(), operator<<(), operator>>(), and Store().

Definition at line 123 of file MCFilePOTInfo.h.

Referenced by Fill(), IsSameAll(), operator<<(), operator>>(), and Store().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1