TDbiWriter< T > Class Template Reference

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>

Collaboration diagram for TDbiWriter< T >:
Collaboration graph
[legend]

List of all members.

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
TDbiTableProxyTableProxy () 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 &)
TDbiWriteroperator= (const TDbiWriter &)
void CompleteOpen (UInt_t dbNo=0, const std::string &logComment="")
void Reset ()

Static Private Member Functions

static TDbiTableProxyGetTableProxy ()
static TDbiTableProxyGetTableProxy (const std::string &tableName)

Private Attributes

Int_t fAggregateNo
 Aggregate noumber for set.
UInt_t fDbNo
 Database number in cascade.
TDbiSqlValPacketfPacket
 The assembled record to be output. Never null.
Int_t fRequireGlobalSeqno
 Controls SEQNO type (see TDbiCascader::AllocateSeqNo).
TDbiTableProxyfTableProxy
 Proxy to associated table.
std::string fTableName
 Associated table name.
Bool_t fUseOverlayCreationDate
 Use overlay creation date if true.
TDbiValidityRecfValidRec
 Validity record. May be =0 if closed.
TDbiLogEntry fLogEntry
 Associated log entry (if any) for update.

Detailed Description

template<class T>
class TDbiWriter< T >

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.

Id
TDbiWriter.hxx,v 1.1 2011/01/18 05:49:20 finch Exp

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.


Constructor & Destructor Documentation

template<class T>
TDbiWriter< T >::TDbiWriter (  ) 
template<class T>
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 = "" 
)
template<class T>
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 = "" 
)
template<class T>
TDbiWriter< T >::TDbiWriter ( const TDbiValidityRec vrec,
const std::string &  dbName,
const std::string &  logComment = "" 
)
template<class T>
TDbiWriter< T >::TDbiWriter ( const TDbiValidityRec vrec,
UInt_t  dbNo = 0,
const std::string &  logComment = "" 
)
template<class T>
virtual TDbiWriter< T >::~TDbiWriter (  )  [virtual]
template<class T>
TDbiWriter< T >::TDbiWriter ( const TDbiWriter< T > &   )  [private]

Member Function Documentation

template<class T>
void TDbiWriter< T >::Abort (  )  [inline]

Definition at line 96 of file TDbiWriter.hxx.

References TDbiWriter< T >::Reset().

00096 { Reset(); }

Here is the call graph for this function:

template<class T>
Bool_t TDbiWriter< T >::CanOutput ( Bool_t  reportErrors = kTRUE  )  const

Open and ready to receive/output data.

template<class T>
Bool_t TDbiWriter< T >::Close ( const char *  fileSpec = 0  ) 

Referenced by TDbiConfigStream::Write().

Here is the caller graph for this function:

template<class T>
void TDbiWriter< T >::CompleteOpen ( UInt_t  dbNo = 0,
const std::string &  logComment = "" 
) [private]
template<class T>
UInt_t TDbiWriter< T >::GetEpoch (  )  const
template<class T>
static TDbiTableProxy& TDbiWriter< T >::GetTableProxy ( const std::string &  tableName  )  [static, private]
template<class T>
static TDbiTableProxy& TDbiWriter< T >::GetTableProxy (  )  [static, private]
template<class T>
Bool_t TDbiWriter< T >::IsOpen ( Bool_t  reportErrors = kTRUE  )  const

Open and ready to receive data.

template<class T>
Bool_t TDbiWriter< T >::NeedsLogEntry (  )  const [private]
template<class T>
Bool_t TDbiWriter< T >::Open ( const TDbiValidityRec vrec,
UInt_t  dbNo = 0,
const std::string &  logComment = "" 
)
template<class T>
Bool_t TDbiWriter< T >::Open ( const TDbiValidityRec vrec,
const string &  dbName,
const std::string &  logComment = "" 
)
template<class T>
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 = "" 
)
template<class T>
Bool_t TDbiWriter< T >::Open ( const TVldRange vr,
Int_t  aggNo,
TDbi::Task  task,
TVldTimeStamp  creationDate,
const string &  dbName,
const std::string &  logComment = "" 
)
template<class T>
TDbiWriter<T>& TDbiWriter< T >::operator<< ( const T &  row  ) 
template<class T>
TDbiWriter& TDbiWriter< T >::operator= ( const TDbiWriter< T > &   )  [private]
template<class T>
void TDbiWriter< T >::Reset (  )  [private]

Referenced by TDbiWriter< T >::Abort().

Here is the caller graph for this function:

template<class T>
void TDbiWriter< T >::SetDbName ( const string &  dbName  ) 
template<class T>
void TDbiWriter< T >::SetDbNo ( UInt_t  dbNo  )  [inline]

Definition at line 87 of file TDbiWriter.hxx.

References TDbiWriter< T >::fDbNo.

00087 { fDbNo = dbNo;}

template<class T>
void TDbiWriter< T >::SetEpoch ( UInt_t  epoch  ) 
template<class T>
void TDbiWriter< T >::SetLogComment ( const std::string &  reason  ) 
template<class T>
void TDbiWriter< T >::SetOverlayCreationDate (  )  [inline]

Definition at line 93 of file TDbiWriter.hxx.

References TDbiWriter< T >::fUseOverlayCreationDate.

Referenced by TDbiConfigStream::Write().

00093 {fUseOverlayCreationDate = kTRUE;}

Here is the caller graph for this function:

template<class T>
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;}

Here is the caller graph for this function:

template<class T>
TDbiTableProxy& TDbiWriter< T >::TableProxy (  )  const
template<class T>
Bool_t TDbiWriter< T >::WritingToMaster (  )  const [private]

Member Data Documentation

template<class T>
Int_t TDbiWriter< T >::fAggregateNo [private]

Aggregate noumber for set.

Definition at line 141 of file TDbiWriter.hxx.

template<class T>
UInt_t TDbiWriter< T >::fDbNo [private]

Database number in cascade.

Definition at line 144 of file TDbiWriter.hxx.

Referenced by TDbiWriter< T >::SetDbNo().

template<class T>
TDbiLogEntry TDbiWriter< T >::fLogEntry [private]

Associated log entry (if any) for update.

Definition at line 165 of file TDbiWriter.hxx.

template<class T>
TDbiSqlValPacket* TDbiWriter< T >::fPacket [private]

The assembled record to be output. Never null.

Definition at line 147 of file TDbiWriter.hxx.

template<class T>
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().

template<class T>
std::string TDbiWriter< T >::fTableName [private]

Associated table name.

Definition at line 156 of file TDbiWriter.hxx.

template<class T>
TDbiTableProxy* TDbiWriter< T >::fTableProxy [private]

Proxy to associated table.

Definition at line 153 of file TDbiWriter.hxx.

template<class T>
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().

template<class T>
TDbiValidityRec* TDbiWriter< T >::fValidRec [private]

Validity record. May be =0 if closed.

Definition at line 162 of file TDbiWriter.hxx.


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

Generated on 11 Aug 2013 for SKDatabase by  doxygen 1.6.1