EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairDbSqlValPacket Class Reference

#include <EicRoot/blob/master/dbase/dbInterface/FairDbSqlValPacket.h>

+ Collaboration diagram for FairDbSqlValPacket:

Public Types

enum  ECompResult { kIdentical, kUpdate, kOutOfDate, kConflict }
 
typedef enum
FairDbSqlValPacket::ECompResult 
CompResult_t
 

Public Member Functions

 FairDbSqlValPacket ()
 
 FairDbSqlValPacket (std::ifstream &is)
 
 FairDbSqlValPacket (const FairDbValidityRec &vrec)
 
virtual ~FairDbSqlValPacket ()
 
Bool_t CanBeStored () const
 
CompResult_t Compare (const FairDbSqlValPacket &that, Bool_t log=kFALSE, const Char_t *thisName="this", const Char_t *thatName="that") const
 
Bool_t CreateTable (UInt_t dbNo) const
 
UInt_t GetNumErrors () const
 
UInt_t GetNumSqlStmts () const
 
UInt_t GetSeqNo () const
 
ValTimeStamp GetCreationDate () const
 
string GetStmt (UInt_t stmtNo) const
 
std::vector< string > GetStmtValues (UInt_t stmtNo) const
 
const string & GetTableName () const
 
Bool_t IsEqual (const FairDbSqlValPacket &that, Bool_t log=kFALSE, const Char_t *thisName="this", const Char_t *thatName="that") const
 
Bool_t Fill (std::ifstream &is)
 
Bool_t Store (UInt_t dbNo, Bool_t replace=kFALSE) const
 
Bool_t Write (std::ofstream &ios, Bool_t addMetadata=kFALSE) const
 
void Recreate (const string &tableName, const ValRange &vr, Int_t aggNo, FairDb::Task task=0, ValTimeStamp creationDate=ValTimeStamp())
 
Bool_t AddDataRow (const FairDbTableProxy &tblProxy, const FairDbValidityRec *vrec, const FairDbTableRow &row)
 
void Clear ()
 
void SetCreationDate (ValTimeStamp ts)
 
void SetSeqNo (UInt_t seqno)
 
void Reset ()
 
virtual void Print (Option_t *option="") const
 

Private Member Functions

void AddRow (const string &row)
 
Bool_t AddRow (const FairDbTableProxy &tblProxy, const FairDbValidityRec *vrec, const FairDbTableRow &row)
 
void Report (const char *msg, UInt_t line_num, const string &line)
 
void SetMetaData () const
 
void SetSeqNoOnRow (string &row, const string &seqno)
 
 FairDbSqlValPacket (const FairDbSqlValPacket &)
 

Private Attributes

UInt_t fNumErrors
 Number of error encountered while filling.
 
UInt_t fSeqNo
 Sequence number or 0 if not filled.
 
string fSqlMySqlMetaMain
 MySQL SQL to create main table. May be empty until needed.
 
string fSqlMySqlMetaVal
 As fSqlMySqlMetaMain but for aux. table.
 
std::list< string > fSqlStmts
 Set of SQL statements to generate packet.
 
UInt_t fNumStmts
 Number of statements.
 
string fTableName
 Table name or null if not filled.
 
ValTimeStamp fCreationDate
 Creation date, or object creation date if unfilled.
 

Static Private Attributes

static Bool_t fgLastMetaHadRowCounter
 

Detailed Description

Definition at line 21 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 21 of file FairDbSqlValPacket.h

Member Typedef Documentation

Member Enumeration Documentation

Enumerator:
kIdentical 
kUpdate 
kOutOfDate 
kConflict 

Definition at line 28 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 28 of file FairDbSqlValPacket.h

Constructor & Destructor Documentation

FairDbSqlValPacket::FairDbSqlValPacket ( )

Definition at line 38 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 38 of file FairDbSqlValPacket.cxx

FairDbSqlValPacket::FairDbSqlValPacket ( std::ifstream &  is)

Definition at line 52 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 52 of file FairDbSqlValPacket.cxx

References Fill().

+ Here is the call graph for this function:

FairDbSqlValPacket::FairDbSqlValPacket ( const FairDbValidityRec vrec)

Definition at line 68 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 68 of file FairDbSqlValPacket.cxx

References AddRow(), FairDbResultSet::FetchRow(), FairDbValidityRec::GetDbNo(), FairDbTableProxy::GetDBProxy(), FairDbValidityRec::GetSeqNo(), FairDbValidityRec::GetTableProxy(), FairDbResultSet::IsExhausted(), FairDbProxy::QuerySeqNo(), and FairDbResultSet::RowAsCsv().

+ Here is the call graph for this function:

FairDbSqlValPacket::~FairDbSqlValPacket ( )
virtual

Definition at line 103 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 103 of file FairDbSqlValPacket.cxx

References Clear().

+ Here is the call graph for this function:

FairDbSqlValPacket::FairDbSqlValPacket ( const FairDbSqlValPacket )
private

Member Function Documentation

Bool_t FairDbSqlValPacket::AddDataRow ( const FairDbTableProxy tblProxy,
const FairDbValidityRec vrec,
const FairDbTableRow row 
)

Definition at line 112 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 112 of file FairDbSqlValPacket.cxx

References AddRow(), fNumErrors, and GetNumSqlStmts().

Referenced by FairDbLogEntry::Write().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairDbSqlValPacket::AddRow ( const string &  row)
private

Definition at line 130 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 130 of file FairDbSqlValPacket.cxx

References fNumStmts, fSqlStmts, GetNumSqlStmts(), GetSeqNo(), GetTableName(), and SetSeqNoOnRow().

Referenced by AddDataRow(), AddRow(), FairDbSqlValPacket(), and Recreate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool_t FairDbSqlValPacket::AddRow ( const FairDbTableProxy tblProxy,
const FairDbValidityRec vrec,
const FairDbTableRow row 
)
private

Definition at line 147 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 147 of file FairDbSqlValPacket.cxx

References AddRow(), fNumErrors, fNumStmts, FairDbOutRowStream::GetCSV(), FairDbTableProxy::GetMetaData(), FairDbTableProxy::GetMetaValid(), GetNumSqlStmts(), FairDbTableProxy::GetTableName(), FairDbOutRowStream::HasGoodData(), FairDbRowStream::HasRowCounter(), FairDbOutRowStream::IsComplete(), and FairDbTableRow::Store().

+ Here is the call graph for this function:

Bool_t FairDbSqlValPacket::CanBeStored ( ) const
inline

Definition at line 42 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 42 of file FairDbSqlValPacket.h

References fNumErrors, fSeqNo, and GetNumSqlStmts().

Referenced by CreateTable(), Store(), and Write().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairDbSqlValPacket::Clear ( )
inline

Definition at line 80 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 80 of file FairDbSqlValPacket.h

References fNumErrors, and Reset().

Referenced by Recreate(), and ~FairDbSqlValPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

FairDbSqlValPacket::CompResult_t FairDbSqlValPacket::Compare ( const FairDbSqlValPacket that,
Bool_t  log = kFALSE,
const Char_t *  thisName = "this",
const Char_t *  thatName = "that" 
) const

Definition at line 179 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 179 of file FairDbSqlValPacket.cxx

References fSeqNo, fTableName, GetStmtValues(), IsEqual(), kConflict, kIdentical, kOutOfDate, and kUpdate.

+ Here is the call graph for this function:

Bool_t FairDbSqlValPacket::CreateTable ( UInt_t  dbNo) const

Definition at line 215 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 215 of file FairDbSqlValPacket.cxx

References CanBeStored(), FairDbStatement::ExecuteUpdate(), fSqlMySqlMetaMain, fSqlMySqlMetaVal, fTableName, GetTableName(), FairDbTableProxyRegistry::Instance(), FairDbStatement::PrintExceptions(), and FairDbTableProxyRegistry::RefreshMetaData().

+ Here is the call graph for this function:

Bool_t FairDbSqlValPacket::Fill ( std::ifstream &  is)

Definition at line 250 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 250 of file FairDbSqlValPacket.cxx

References fCreationDate, fgLastMetaHadRowCounter, fNumStmts, fSeqNo, fSqlMySqlMetaMain, fSqlMySqlMetaVal, fSqlStmts, fTableName, getline, GetNumSqlStmts(), GetStmtValues(), FairDb::kMAXTABLENAMELEN, FairDb::MakeTimeStamp(), Report(), Reset(), and FairUtilString::StringTok().

Referenced by FairDbSqlValPacket().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ValTimeStamp FairDbSqlValPacket::GetCreationDate ( ) const
inline

Definition at line 54 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 54 of file FairDbSqlValPacket.h

References fCreationDate.

UInt_t FairDbSqlValPacket::GetNumErrors ( ) const
inline

Definition at line 51 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 51 of file FairDbSqlValPacket.h

References fNumErrors.

UInt_t FairDbSqlValPacket::GetNumSqlStmts ( ) const
inline

Definition at line 52 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 52 of file FairDbSqlValPacket.h

References fNumStmts.

Referenced by AddDataRow(), AddRow(), CanBeStored(), Fill(), GetStmt(), GetStmtValues(), Print(), SetCreationDate(), and SetSeqNo().

+ Here is the caller graph for this function:

UInt_t FairDbSqlValPacket::GetSeqNo ( ) const
inline

Definition at line 53 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 53 of file FairDbSqlValPacket.h

References fSeqNo.

Referenced by AddRow(), and Write().

+ Here is the caller graph for this function:

string FairDbSqlValPacket::GetStmt ( UInt_t  stmtNo) const

Definition at line 415 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 415 of file FairDbSqlValPacket.cxx

References fSqlStmts, and GetNumSqlStmts().

Referenced by GetStmtValues().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector< std::string > FairDbSqlValPacket::GetStmtValues ( UInt_t  stmtNo) const

Definition at line 430 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 430 of file FairDbSqlValPacket.cxx

References GetNumSqlStmts(), GetStmt(), n, pos(), and FairUtilString::StringTok().

Referenced by Compare(), and Fill().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const string& FairDbSqlValPacket::GetTableName ( ) const
inline

Definition at line 57 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 57 of file FairDbSqlValPacket.h

References fTableName.

Referenced by AddRow(), CreateTable(), SetMetaData(), Store(), and Write().

+ Here is the caller graph for this function:

Bool_t FairDbSqlValPacket::IsEqual ( const FairDbSqlValPacket that,
Bool_t  log = kFALSE,
const Char_t *  thisName = "this",
const Char_t *  thatName = "that" 
) const

Definition at line 451 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 451 of file FairDbSqlValPacket.cxx

References compStringPtrs(), fNumStmts, fSeqNo, fSqlStmts, and fTableName.

Referenced by Compare().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairDbSqlValPacket::Print ( Option_t *  option = "") const
virtual

Definition at line 570 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 570 of file FairDbSqlValPacket.cxx

References fCreationDate, fNumErrors, fSeqNo, fSqlMySqlMetaMain, fSqlMySqlMetaVal, fSqlStmts, fTableName, and GetNumSqlStmts().

+ Here is the call graph for this function:

void FairDbSqlValPacket::Recreate ( const string &  tableName,
const ValRange vr,
Int_t  aggNo,
FairDb::Task  task = 0,
ValTimeStamp  creationDate = ValTimeStamp() 
)

Definition at line 605 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 605 of file FairDbSqlValPacket.cxx

References AddRow(), Clear(), fNumErrors, fTableName, FairDbOutRowStream::GetCSV(), FairDbTableProxy::GetMetaValid(), FairDbTableProxyRegistry::GetMultConnector(), FairDbTableProxyRegistry::GetTableProxy(), FairDbTableProxyRegistry::Instance(), SetCreationDate(), FairDbValidityRec::Store(), and FairDbMultConnector::TableExists().

Referenced by FairDbLogEntry::Write().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairDbSqlValPacket::Report ( const char *  msg,
UInt_t  line_num,
const string &  line 
)
private

Definition at line 644 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 644 of file FairDbSqlValPacket.cxx

References fNumErrors, and Reset().

Referenced by Fill().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairDbSqlValPacket::Reset ( )

Definition at line 656 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 656 of file FairDbSqlValPacket.cxx

References fNumStmts, fSeqNo, fSqlMySqlMetaMain, fSqlMySqlMetaVal, fSqlStmts, and fTableName.

Referenced by Clear(), Fill(), and Report().

+ Here is the caller graph for this function:

void FairDbSqlValPacket::SetCreationDate ( ValTimeStamp  ts)

Definition at line 670 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 670 of file FairDbSqlValPacket.cxx

References ValTimeStamp::AsString(), fCreationDate, fSqlStmts, and GetNumSqlStmts().

Referenced by Recreate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairDbSqlValPacket::SetMetaData ( ) const
private

Definition at line 691 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 691 of file FairDbSqlValPacket.cxx

References fSqlMySqlMetaMain, fSqlMySqlMetaVal, FairDbTableProxy::GetMetaData(), FairDbTableProxy::GetMetaValid(), FairDbTableProxyRegistry::GetMultConnector(), FairDbMultConnector::GetTableDbNo(), GetTableName(), FairDbTableProxyRegistry::GetTableProxy(), FairDbTableProxyRegistry::Instance(), and FairDbTableMetaData::Sql().

Referenced by Write().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairDbSqlValPacket::SetSeqNo ( UInt_t  seqno)

Definition at line 715 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 715 of file FairDbSqlValPacket.cxx

References fSeqNo, fSqlStmts, GetNumSqlStmts(), and SetSeqNoOnRow().

Referenced by FairDbLogEntry::Write().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairDbSqlValPacket::SetSeqNoOnRow ( string &  row,
const string &  seqno 
)
private

Definition at line 735 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 735 of file FairDbSqlValPacket.cxx

Referenced by AddRow(), and SetSeqNo().

+ Here is the caller graph for this function:

Bool_t FairDbSqlValPacket::Store ( UInt_t  dbNo,
Bool_t  replace = kFALSE 
) const

Definition at line 749 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 749 of file FairDbSqlValPacket.cxx

References CanBeStored(), FairDbStatement::ExecuteUpdate(), fgLastMetaHadRowCounter, fSqlStmts, FairDbTableProxy::GetDBProxy(), FairDbStatement::GetDBType(), FairDbTableProxy::GetMetaData(), GetTableName(), FairDbTableProxyRegistry::GetTableProxy(), FairDbTableMetaData::HasRowCounter(), FairDbTableProxyRegistry::Instance(), FairDb::kOracle, FairDb::MakeDateTimeString(), FairDbStatement::PrintExceptions(), FairDbProxy::RemoveSeqNo(), and this.

Referenced by FairDbLogEntry::Write().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool_t FairDbSqlValPacket::Write ( std::ofstream &  ios,
Bool_t  addMetadata = kFALSE 
) const

Definition at line 850 of file FairDbSqlValPacket.cxx.

View newest version in sPHENIX GitHub at line 850 of file FairDbSqlValPacket.cxx

References CanBeStored(), fSqlMySqlMetaMain, fSqlMySqlMetaVal, fSqlStmts, GetSeqNo(), GetTableName(), and SetMetaData().

+ Here is the call graph for this function:

Member Data Documentation

ValTimeStamp FairDbSqlValPacket::fCreationDate
private

Creation date, or object creation date if unfilled.

Definition at line 128 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 128 of file FairDbSqlValPacket.h

Referenced by Fill(), GetCreationDate(), Print(), and SetCreationDate().

Bool_t FairDbSqlValPacket::fgLastMetaHadRowCounter
staticprivate

Definition at line 100 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 100 of file FairDbSqlValPacket.h

Referenced by Fill(), and Store().

UInt_t FairDbSqlValPacket::fNumErrors
private

Number of error encountered while filling.

Definition at line 107 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 107 of file FairDbSqlValPacket.h

Referenced by AddDataRow(), AddRow(), CanBeStored(), Clear(), GetNumErrors(), Print(), Recreate(), and Report().

UInt_t FairDbSqlValPacket::fNumStmts
private

Number of statements.

Definition at line 122 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 122 of file FairDbSqlValPacket.h

Referenced by AddRow(), Fill(), GetNumSqlStmts(), IsEqual(), and Reset().

UInt_t FairDbSqlValPacket::fSeqNo
private

Sequence number or 0 if not filled.

Definition at line 110 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 110 of file FairDbSqlValPacket.h

Referenced by CanBeStored(), Compare(), Fill(), GetSeqNo(), IsEqual(), Print(), Reset(), and SetSeqNo().

string FairDbSqlValPacket::fSqlMySqlMetaMain
mutableprivate

MySQL SQL to create main table. May be empty until needed.

Definition at line 113 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 113 of file FairDbSqlValPacket.h

Referenced by CreateTable(), Fill(), Print(), Reset(), SetMetaData(), and Write().

string FairDbSqlValPacket::fSqlMySqlMetaVal
mutableprivate

As fSqlMySqlMetaMain but for aux. table.

Definition at line 116 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 116 of file FairDbSqlValPacket.h

Referenced by CreateTable(), Fill(), Print(), Reset(), SetMetaData(), and Write().

std::list<string> FairDbSqlValPacket::fSqlStmts
private

Set of SQL statements to generate packet.

Definition at line 119 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 119 of file FairDbSqlValPacket.h

Referenced by AddRow(), Fill(), GetStmt(), IsEqual(), Print(), Reset(), SetCreationDate(), SetSeqNo(), Store(), and Write().

string FairDbSqlValPacket::fTableName
private

Table name or null if not filled.

Definition at line 125 of file FairDbSqlValPacket.h.

View newest version in sPHENIX GitHub at line 125 of file FairDbSqlValPacket.h

Referenced by Compare(), CreateTable(), Fill(), GetTableName(), IsEqual(), Print(), Recreate(), and Reset().


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