DbuDaqConfigFilesText Class Reference

#include <DbuDaqConfigFilesText.h>

Inheritance diagram for DbuDaqConfigFilesText:
DbiTableRow

List of all members.

Public Member Functions

 DbuDaqConfigFilesText ()
 DbuDaqConfigFilesText (string text)
virtual ~DbuDaqConfigFilesText ()
virtual Int_t GetAggregateNo () const
virtual DbiTableRowCreateTableRow () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const
Int_t GetSeqNo () const
Int_t LookupSeqNo (DbiStatement *stmt) const
std::string & CalcMD5 ()

Static Public Member Functions

static const char * GetTableDescr ()

Public Attributes

std::string fText
std::string fMD5
Int_t fSeqNo

Static Public Attributes

static const std::string kNoText = "<<No ConfigFileText>>"
static const std::string kNoMD5 = "<<No MD5 value>>"

Private Member Functions

 DbuDaqConfigFilesText (const DbuDaqConfigFilesText &from)

Friends

class DbuRunSummary
class DbuDaqFileModule

Detailed Description

Definition at line 31 of file DbuDaqConfigFilesText.h.


Constructor & Destructor Documentation

DbuDaqConfigFilesText::DbuDaqConfigFilesText (  )  [inline]

Definition at line 41 of file DbuDaqConfigFilesText.h.

References LEA_CTOR.

00041                            :
00042      fText(kNoText), fMD5(kNoMD5), fSeqNo(0)
00043      { LEA_CTOR; }

DbuDaqConfigFilesText::DbuDaqConfigFilesText ( string  text  )  [inline]

Definition at line 45 of file DbuDaqConfigFilesText.h.

References LEA_CTOR.

00045                                       :
00046      fText(text), fMD5(kNoMD5), fSeqNo(0)
00047      { LEA_CTOR; }

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

Definition at line 49 of file DbuDaqConfigFilesText.h.

References LEA_DTOR.

00049 { LEA_DTOR; };

DbuDaqConfigFilesText::DbuDaqConfigFilesText ( const DbuDaqConfigFilesText from  )  [inline, private]

Definition at line 85 of file DbuDaqConfigFilesText.h.

References LEA_CTOR.

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


Member Function Documentation

std::string & DbuDaqConfigFilesText::CalcMD5 (  ) 

Definition at line 170 of file DbuDaqConfigFilesText.cxx.

References fMD5, and fText.

Referenced by DbuDaqFileModule::CommitDbuDaqConfigFilesText().

00171 {
00172 //
00173 //
00174 //  Purpose:  Calculate and record MD5 value
00175 //
00176 //  Return:   nothing
00177 //
00178 //  Contact:   R. Hatcher
00179 //
00180 //  Specification:-
00181 //  =============
00182 //
00183 
00184 //  Program Notes:-
00185 //  =============
00186 
00187 //  None.
00188 
00189   TMD5 md5;
00190   md5.Update((const UChar_t*)fText.c_str(),(UInt_t)fText.size());
00191   md5.Final();
00192   fMD5 = md5.AsString();
00193   return fMD5;
00194 }

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

Implements DbiTableRow.

Definition at line 57 of file DbuDaqConfigFilesText.h.

00057 { return new DbuDaqConfigFilesText; }

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

Implements DbiTableRow.

Definition at line 71 of file DbuDaqConfigFilesText.cxx.

References fMD5, fSeqNo, fText, and DbiValidityRec::GetSeqNo().

00072                                                           {
00073 //
00074 //
00075 //  Purpose:  Fill object from Result Set
00076 //
00077 //  Arguments: 
00078 //    rs           in    Result Set used to fill object
00079 //    vrec         in    Associated validity record (or 0 if filling
00080 //                                                    DbiValidityRec)
00081 //
00082 //  Return:    
00083 //
00084 //  Contact:   R. Hatcher
00085 //
00086 //  Specification:-
00087 //  =============
00088 //
00089 //  o Fill object from current row of Result Set.
00090 
00091 //  Program Notes:-
00092 //  =============
00093 
00094 //  None.
00095 
00096    rs >> fMD5
00097       >> fText;
00098 
00099    fSeqNo = ((vrec) ? vrec->GetSeqNo() : 0 );
00100 }

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

Reimplemented from DbiTableRow.

Definition at line 53 of file DbuDaqConfigFilesText.h.

00053 { return -1; }

Int_t DbuDaqConfigFilesText::GetSeqNo (  )  const [inline]

Definition at line 66 of file DbuDaqConfigFilesText.h.

References fSeqNo.

00066 { return fSeqNo; }

const char * DbuDaqConfigFilesText::GetTableDescr (  )  [static]

Definition at line 243 of file DbuDaqConfigFilesText.cxx.

00244 {
00245 //
00246 //
00247 //  Purpose:  Return a string describing rows in the table
00248 //            Used in creating temporary tables
00249 //
00250 //  Return:   const char* to parenthesized comma separated list
00251 //            of column name and type pairs
00252 //
00253 //  Contact:   R. Hatcher
00254 //
00255 //  Specification:-
00256 //  =============
00257 //
00258 
00259 //  Program Notes:-
00260 //  =============
00261 
00262 //  None.
00263 
00264    const char* const_tabledescr = "( \
00265        SEQNO             int,        \
00266        ROW_COUNTER       int,        \
00267        CONFIGFILES_MD5   char(32),   \
00268        CONFIGFILES_TEXT  mediumtext, \
00269        primary key (SEQNO,ROW_COUNTER) \
00270        )";
00271 
00272    return const_tabledescr;
00273 }

Int_t DbuDaqConfigFilesText::LookupSeqNo ( DbiStatement stmt  )  const

Definition at line 197 of file DbuDaqConfigFilesText.cxx.

References DbiStatement::ExecuteQuery(), fMD5, Form(), Msg::kWarning, and MSG.

Referenced by DbuDaqFileModule::CommitDbuDaqConfigFilesText().

00198 {
00199 //
00200 //
00201 //  Purpose:  Lookup the SeqNo for this MD5
00202 //
00203 //  Return:   the SEQNO (or 0 if no match exists)
00204 //
00205 //  Contact:   R. Hatcher
00206 //
00207 //  Specification:-
00208 //  =============
00209 //
00210 
00211 //  Program Notes:-
00212 //  =============
00213 
00214 //  None.
00215 
00216   // ensure MD5 is up-to-date
00217   // CalcMD5(); ... not const
00218   const char* sqlbase = 
00219     "select SEQNO from DBUDAQCONFIGFILESTEXT where CONFIGFILES_MD5='%s';\0";
00220   TString sqlquery = Form(sqlbase,fMD5.c_str());
00221 
00222   TSQLStatement* tsqlstmt = stmt->ExecuteQuery(sqlquery);
00223   
00224   Int_t nrows = 0, seqno = 0;
00225   while ( 1 ) {
00226     if ( ! tsqlstmt->NextResultRow() ) break;
00227     nrows++;
00228     seqno = tsqlstmt->GetInt(0);
00229   }
00230   // accept the last one
00231   
00232   if (nrows>1) {
00233     MSG("Dbu",Msg::kWarning) 
00234       << "DbuDaqConfigFilesText saw " << nrows << " that statisfied '"
00235       << sqlquery
00236       << "'" << endl;
00237   }
00238   return seqno;
00239 }

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

Reimplemented from DbiTableRow.

Definition at line 104 of file DbuDaqConfigFilesText.cxx.

References fMD5, and fText.

00105                                                                      {
00106 //
00107 //
00108 //  Purpose:  Stream object to output row stream
00109 //
00110 //  Arguments: 
00111 //    ors          in     Output row stream.
00112 //    vrec         in     Associated validity record (or 0 if filling
00113 //                                                    DbiValidityRec)
00114 //
00115 //  Return:    
00116 //
00117 //  Contact:   R. Hatcher
00118 //
00119 //  Specification:-
00120 //  =============
00121 //
00122 //  o  Stream object to output row stream.
00123 
00124 //  Program Notes:-
00125 //  =============
00126 
00127 //  None.
00128 
00129    ors << fMD5
00130        << fText;
00131    
00132 }


Friends And Related Function Documentation

friend class DbuDaqFileModule [friend]

Definition at line 83 of file DbuDaqConfigFilesText.h.

friend class DbuRunSummary [friend]

Definition at line 82 of file DbuDaqConfigFilesText.h.


Member Data Documentation

Definition at line 93 of file DbuDaqConfigFilesText.h.

Referenced by CalcMD5(), Fill(), LookupSeqNo(), operator<<(), and Store().

Definition at line 94 of file DbuDaqConfigFilesText.h.

Referenced by Fill(), GetSeqNo(), and operator<<().

const std::string DbuDaqConfigFilesText::kNoMD5 = "<<No MD5 value>>" [static]

Definition at line 37 of file DbuDaqConfigFilesText.h.

Referenced by DbuDaqFileModule::CommitDbuRunSummary().

const std::string DbuDaqConfigFilesText::kNoText = "<<No ConfigFileText>>" [static]

Definition at line 36 of file DbuDaqConfigFilesText.h.

Referenced by DbuDaqFileModule::HandleConfigFilesBlock().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1