Concept Templated class of pointers to Writer objects. Writer objects are lightweight and provide type safe write access to a single validity set of a specific table. A TDbiWriter knows about publishing protocols but uses a TDbiSqlValPacket both to hold the data in a type- neutral form and to do the actual I/O. More...
#include <TDbiWriter.hxx>
Public Member Functions | |
TDbiWriter () | |
TDbiWriter (const TVldRange &vr, Int_t aggNo, TDbi::Task task, TVldTimeStamp creationDate, const std::string &dbName, const std::string &logComment="", const std::string &tableName="") | |
TDbiWriter (const TVldRange &vr, Int_t aggNo, TDbi::Task task=0, TVldTimeStamp creationDate=TVldTimeStamp(0, 0), UInt_t dbNo=0, const std::string &logComment="", const std::string &tableName="") | |
TDbiWriter (const TDbiValidityRec &vrec, const std::string &dbName, const std::string &logComment="") | |
TDbiWriter (const TDbiValidityRec &vrec, UInt_t dbNo=0, const std::string &logComment="") | |
virtual | ~TDbiWriter () |
UInt_t | GetEpoch () const |
TDbiTableProxy & | TableProxy () const |
Bool_t | IsOpen (Bool_t reportErrors=kTRUE) const |
Open and ready to receive data. | |
Bool_t | CanOutput (Bool_t reportErrors=kTRUE) const |
Open and ready to receive/output data. | |
void | SetDbNo (UInt_t dbNo) |
void | SetDbName (const string &dbName) |
void | SetEpoch (UInt_t epoch) |
void | SetLogComment (const std::string &reason) |
void | SetRequireGlobalSeqno (Int_t requireGlobal) |
void | SetOverlayCreationDate () |
void | Abort () |
Bool_t | Close (const char *fileSpec=0) |
Bool_t | Open (const TVldRange &vr, Int_t aggNo, TDbi::Task task, TVldTimeStamp creationDate, const string &dbName, const std::string &logComment="") |
Bool_t | Open (const TVldRange &vr, Int_t aggNo, TDbi::Task task=0, TVldTimeStamp creationDate=TVldTimeStamp(), UInt_t dbNo=0, const std::string &logComment="") |
Bool_t | Open (const TDbiValidityRec &vrec, const string &dbName, const std::string &logComment="") |
Bool_t | Open (const TDbiValidityRec &vrec, UInt_t dbNo=0, const std::string &logComment="") |
TDbiWriter< T > & | operator<< (const T &row) |
Private Member Functions | |
Bool_t | NeedsLogEntry () const |
Bool_t | WritingToMaster () const |
TDbiWriter (const TDbiWriter &) | |
TDbiWriter & | operator= (const TDbiWriter &) |
void | CompleteOpen (UInt_t dbNo=0, const std::string &logComment="") |
void | Reset () |
Static Private Member Functions | |
static TDbiTableProxy & | GetTableProxy () |
static TDbiTableProxy & | GetTableProxy (const std::string &tableName) |
Private Attributes | |
Int_t | fAggregateNo |
Aggregate noumber for set. | |
UInt_t | fDbNo |
Database number in cascade. | |
TDbiSqlValPacket * | fPacket |
The assembled record to be output. Never null. | |
Int_t | fRequireGlobalSeqno |
Controls SEQNO type (see TDbiCascader::AllocateSeqNo). | |
TDbiTableProxy * | fTableProxy |
Proxy to associated table. | |
std::string | fTableName |
Associated table name. | |
Bool_t | fUseOverlayCreationDate |
Use overlay creation date if true. | |
TDbiValidityRec * | fValidRec |
Validity record. May be =0 if closed. | |
TDbiLogEntry | fLogEntry |
Associated log entry (if any) for update. |
Concept Templated class of pointers to Writer objects. Writer objects are lightweight and provide type safe write access to a single validity set of a specific table. A TDbiWriter knows about publishing protocols but uses a TDbiSqlValPacket both to hold the data in a type- neutral form and to do the actual I/O.
Purpose Writers are the primary application output interface to the TDbi. Users instantiate Writers with the information necessary define a validity set and then pass all the rows one at a time, to the writer. The user is able to abort the process at any point before the final commit. Contact: A.Finch@lancaster.ac.uk
Definition at line 45 of file TDbiWriter.hxx.
TDbiWriter< T >::TDbiWriter | ( | ) |
TDbiWriter< T >::TDbiWriter | ( | const TVldRange & | vr, | |
Int_t | aggNo, | |||
TDbi::Task | task, | |||
TVldTimeStamp | creationDate, | |||
const std::string & | dbName, | |||
const std::string & | logComment = "" , |
|||
const std::string & | tableName = "" | |||
) |
TDbiWriter< T >::TDbiWriter | ( | const TVldRange & | vr, | |
Int_t | aggNo, | |||
TDbi::Task | task = 0 , |
|||
TVldTimeStamp | creationDate = TVldTimeStamp(0, 0) , |
|||
UInt_t | dbNo = 0 , |
|||
const std::string & | logComment = "" , |
|||
const std::string & | tableName = "" | |||
) |
TDbiWriter< T >::TDbiWriter | ( | const TDbiValidityRec & | vrec, | |
const std::string & | dbName, | |||
const std::string & | logComment = "" | |||
) |
TDbiWriter< T >::TDbiWriter | ( | const TDbiValidityRec & | vrec, | |
UInt_t | dbNo = 0 , |
|||
const std::string & | logComment = "" | |||
) |
virtual TDbiWriter< T >::~TDbiWriter | ( | ) | [virtual] |
TDbiWriter< T >::TDbiWriter | ( | const TDbiWriter< T > & | ) | [private] |
void TDbiWriter< T >::Abort | ( | ) | [inline] |
Definition at line 96 of file TDbiWriter.hxx.
References TDbiWriter< T >::Reset().
00096 { Reset(); }
Bool_t TDbiWriter< T >::CanOutput | ( | Bool_t | reportErrors = kTRUE |
) | const |
Open and ready to receive/output data.
Bool_t TDbiWriter< T >::Close | ( | const char * | fileSpec = 0 |
) |
void TDbiWriter< T >::CompleteOpen | ( | UInt_t | dbNo = 0 , |
|
const std::string & | logComment = "" | |||
) | [private] |
UInt_t TDbiWriter< T >::GetEpoch | ( | ) | const |
static TDbiTableProxy& TDbiWriter< T >::GetTableProxy | ( | const std::string & | tableName | ) | [static, private] |
static TDbiTableProxy& TDbiWriter< T >::GetTableProxy | ( | ) | [static, private] |
Bool_t TDbiWriter< T >::IsOpen | ( | Bool_t | reportErrors = kTRUE |
) | const |
Open and ready to receive data.
Bool_t TDbiWriter< T >::NeedsLogEntry | ( | ) | const [private] |
Bool_t TDbiWriter< T >::Open | ( | const TDbiValidityRec & | vrec, | |
UInt_t | dbNo = 0 , |
|||
const std::string & | logComment = "" | |||
) |
Bool_t TDbiWriter< T >::Open | ( | const TDbiValidityRec & | vrec, | |
const string & | dbName, | |||
const std::string & | logComment = "" | |||
) |
Bool_t TDbiWriter< T >::Open | ( | const TVldRange & | vr, | |
Int_t | aggNo, | |||
TDbi::Task | task = 0 , |
|||
TVldTimeStamp | creationDate = TVldTimeStamp() , |
|||
UInt_t | dbNo = 0 , |
|||
const std::string & | logComment = "" | |||
) |
Bool_t TDbiWriter< T >::Open | ( | const TVldRange & | vr, | |
Int_t | aggNo, | |||
TDbi::Task | task, | |||
TVldTimeStamp | creationDate, | |||
const string & | dbName, | |||
const std::string & | logComment = "" | |||
) |
TDbiWriter<T>& TDbiWriter< T >::operator<< | ( | const T & | row | ) |
TDbiWriter& TDbiWriter< T >::operator= | ( | const TDbiWriter< T > & | ) | [private] |
void TDbiWriter< T >::Reset | ( | ) | [private] |
void TDbiWriter< T >::SetDbName | ( | const string & | dbName | ) |
void TDbiWriter< T >::SetDbNo | ( | UInt_t | dbNo | ) | [inline] |
Definition at line 87 of file TDbiWriter.hxx.
References TDbiWriter< T >::fDbNo.
00087 { fDbNo = dbNo;}
void TDbiWriter< T >::SetEpoch | ( | UInt_t | epoch | ) |
void TDbiWriter< T >::SetLogComment | ( | const std::string & | reason | ) |
void TDbiWriter< T >::SetOverlayCreationDate | ( | ) | [inline] |
Definition at line 93 of file TDbiWriter.hxx.
References TDbiWriter< T >::fUseOverlayCreationDate.
Referenced by TDbiConfigStream::Write().
00093 {fUseOverlayCreationDate = kTRUE;}
void TDbiWriter< T >::SetRequireGlobalSeqno | ( | Int_t | requireGlobal | ) | [inline] |
Definition at line 92 of file TDbiWriter.hxx.
References TDbiWriter< T >::fRequireGlobalSeqno.
Referenced by TDbiConfigStream::Write().
00092 {fRequireGlobalSeqno = requireGlobal;}
TDbiTableProxy& TDbiWriter< T >::TableProxy | ( | ) | const |
Bool_t TDbiWriter< T >::WritingToMaster | ( | ) | const [private] |
Int_t TDbiWriter< T >::fAggregateNo [private] |
Aggregate noumber for set.
Definition at line 141 of file TDbiWriter.hxx.
UInt_t TDbiWriter< T >::fDbNo [private] |
Database number in cascade.
Definition at line 144 of file TDbiWriter.hxx.
Referenced by TDbiWriter< T >::SetDbNo().
TDbiLogEntry TDbiWriter< T >::fLogEntry [private] |
Associated log entry (if any) for update.
Definition at line 165 of file TDbiWriter.hxx.
TDbiSqlValPacket* TDbiWriter< T >::fPacket [private] |
The assembled record to be output. Never null.
Definition at line 147 of file TDbiWriter.hxx.
Int_t TDbiWriter< T >::fRequireGlobalSeqno [private] |
Controls SEQNO type (see TDbiCascader::AllocateSeqNo).
Definition at line 150 of file TDbiWriter.hxx.
Referenced by TDbiWriter< T >::SetRequireGlobalSeqno().
std::string TDbiWriter< T >::fTableName [private] |
Associated table name.
Definition at line 156 of file TDbiWriter.hxx.
TDbiTableProxy* TDbiWriter< T >::fTableProxy [private] |
Proxy to associated table.
Definition at line 153 of file TDbiWriter.hxx.
Bool_t TDbiWriter< T >::fUseOverlayCreationDate [private] |
Use overlay creation date if true.
Definition at line 159 of file TDbiWriter.hxx.
Referenced by TDbiWriter< T >::SetOverlayCreationDate().
TDbiValidityRec* TDbiWriter< T >::fValidRec [private] |
Validity record. May be =0 if closed.
Definition at line 162 of file TDbiWriter.hxx.