EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <EicRoot/blob/master/dbase/dbInterface/FairDbSqlValPacket.h>
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 |
Definition at line 21 of file FairDbSqlValPacket.h.
View newest version in sPHENIX GitHub at line 21 of file FairDbSqlValPacket.h
Definition at line 28 of file FairDbSqlValPacket.h.
View newest version in sPHENIX GitHub at line 28 of file FairDbSqlValPacket.h
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().
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().
|
virtual |
Definition at line 103 of file FairDbSqlValPacket.cxx.
View newest version in sPHENIX GitHub at line 103 of file FairDbSqlValPacket.cxx
References Clear().
|
private |
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().
|
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().
|
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().
|
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().
|
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().
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.
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().
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().
|
inline |
Definition at line 54 of file FairDbSqlValPacket.h.
View newest version in sPHENIX GitHub at line 54 of file FairDbSqlValPacket.h
References fCreationDate.
|
inline |
Definition at line 51 of file FairDbSqlValPacket.h.
View newest version in sPHENIX GitHub at line 51 of file FairDbSqlValPacket.h
References fNumErrors.
|
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().
|
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().
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().
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().
|
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().
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().
|
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().
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().
|
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().
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().
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().
|
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().
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().
|
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().
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().
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().
|
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().
|
staticprivate |
Definition at line 100 of file FairDbSqlValPacket.h.
View newest version in sPHENIX GitHub at line 100 of file FairDbSqlValPacket.h
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().