![]() |
KaliVeda
Toolkit for HIC analysis
|
Modified copy of TSQLiteStatement.
The Process() method is modified so that if the database is locked by another process/thread, we try again a maximum of 4 times with a sleep of 50 ms between each attempt.
Definition at line 34 of file KVSQLiteStatement.h.
#include <KVSQLiteStatement.h>

Public Member Functions | |
| KVSQLiteStatement (SQLite3_Stmt_t *stmt, Bool_t errout=kTRUE) | |
| virtual | ~KVSQLiteStatement () |
| Destructor. More... | |
| ClassDefOverride (KVSQLiteStatement, 0) | |
| void | Close (Option_t *="") final |
| Close statement. More... | |
| Bool_t | GetBinary (Int_t npar, void *&mem, Long_t &size) final |
| Int_t | GetBufferLength () const final |
| Bool_t | GetDate (Int_t npar, Int_t &year, Int_t &month, Int_t &day) final |
| Return field value as date. More... | |
| Bool_t | GetDatime (Int_t npar, Int_t &year, Int_t &month, Int_t &day, Int_t &hour, Int_t &min, Int_t &sec) final |
| Return field value as date & time. More... | |
| Double_t | GetDouble (Int_t npar) final |
| Return field value as double. More... | |
| const char * | GetFieldName (Int_t nfield) final |
| Returns field name in result set. More... | |
| Int_t | GetInt (Int_t npar) final |
| Get integer. More... | |
| Long_t | GetLong (Int_t npar) final |
| Get long. More... | |
| Long64_t | GetLong64 (Int_t npar) final |
| Get long64. More... | |
| Int_t | GetNumAffectedRows () final |
| Int_t | GetNumFields () final |
| Return number of fields in result set. More... | |
| Int_t | GetNumParameters () final |
| Return number of statement parameters. More... | |
| const char * | GetString (Int_t npar) final |
| Return field value as string. More... | |
| Bool_t | GetTime (Int_t npar, Int_t &hour, Int_t &min, Int_t &sec) final |
| Return field as time. More... | |
| Bool_t | GetTimestamp (Int_t npar, Int_t &year, Int_t &month, Int_t &day, Int_t &hour, Int_t &min, Int_t &sec, Int_t &) final |
| TDatime | GetTimestamp (Int_t) |
| virtual Bool_t | GetTimestamp (Int_t, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &, Int_t &) |
| virtual Bool_t | GetTimestamp (Int_t, TTimeStamp &) |
| UInt_t | GetUInt (Int_t npar) final |
| Get unsigned integer. More... | |
| ULong64_t | GetULong64 (Int_t npar) final |
| Return field value as unsigned 64-bit integer. More... | |
| Bool_t | IsNull (Int_t npar) final |
| Checks if field value is null. More... | |
| Bool_t | NextIteration () final |
| Bool_t | NextResultRow () final |
| Shift cursor to next row in result set. More... | |
| Bool_t | Process () final |
| Process statement. More... | |
| Bool_t | SetBinary (Int_t npar, void *mem, Long_t size, Long_t maxsize=0x1000) final |
| Bool_t | SetDate (Int_t npar, Int_t year, Int_t month, Int_t day) final |
| Set parameter value as date. More... | |
| Bool_t | SetDatime (Int_t npar, Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec) final |
| Set parameter value as date & time. More... | |
| Bool_t | SetDouble (Int_t npar, Double_t value) final |
| Set parameter value as double value. More... | |
| Bool_t | SetInt (Int_t npar, Int_t value) final |
| Set parameter value as integer. More... | |
| Bool_t | SetLong (Int_t npar, Long_t value) final |
| Set parameter value as long. More... | |
| Bool_t | SetLong64 (Int_t npar, Long64_t value) final |
| Set parameter value as 64-bit integer. More... | |
| Bool_t | SetNull (Int_t npar) final |
| Set NULL as parameter value. More... | |
| Bool_t | SetString (Int_t npar, const char *value, Int_t maxsize=256) final |
| Set parameter value as string. More... | |
| Bool_t | SetTime (Int_t npar, Int_t hour, Int_t min, Int_t sec) final |
| Set parameter value as time. More... | |
| Bool_t | SetTimestamp (Int_t npar, Int_t year, Int_t month, Int_t day, Int_t hour, Int_t min, Int_t sec, Int_t frac=0) final |
| Bool_t | SetTimestamp (Int_t, const TDatime &) |
| virtual Bool_t | SetTimestamp (Int_t, const TTimeStamp &) |
| virtual Bool_t | SetTimestamp (Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t=0) |
| Bool_t | SetUInt (Int_t npar, UInt_t value) final |
| Bool_t | SetULong64 (Int_t npar, ULong64_t value) final |
| Bool_t | StoreResult () final |
Public Member Functions inherited from TSQLStatement | |
| virtual | ~TSQLStatement ()=default |
| virtual void | EnableErrorOutput (Bool_t on=kTRUE) |
| TDatime | GetDatime (Int_t) |
| Int_t | GetDay (Int_t) |
| virtual Int_t | GetErrorCode () const |
| virtual const char * | GetErrorMsg () const |
| Int_t | GetHour (Int_t) |
| virtual Bool_t | GetLargeObject (Int_t col, void *&mem, Long_t &size) |
| Int_t | GetMinute (Int_t) |
| Int_t | GetMonth (Int_t) |
| Int_t | GetSecond (Int_t) |
| Int_t | GetSecondsFraction (Int_t) |
| TDatime | GetTimestamp (Int_t) |
| virtual Bool_t | GetTimestamp (Int_t, TTimeStamp &) |
| virtual Bool_t | GetVDouble (Int_t, std::vector< Double_t > &) |
| virtual Bool_t | GetVInt (Int_t, std::vector< Int_t > &) |
| virtual Bool_t | GetVLong (Int_t, std::vector< Long_t > &) |
| virtual Bool_t | GetVLong64 (Int_t, std::vector< Long64_t > &) |
| virtual Bool_t | GetVUInt (Int_t, std::vector< UInt_t > &) |
| virtual Bool_t | GetVULong64 (Int_t, std::vector< ULong64_t > &) |
| Int_t | GetYear (Int_t) |
| TClass * | IsA () const override |
| virtual Bool_t | IsError () const |
| Bool_t | SetDate (Int_t, const TDatime &) |
| Bool_t | SetDatime (Int_t, const TDatime &) |
| virtual Bool_t | SetLargeObject (Int_t col, void *mem, Long_t size, Long_t maxsize=0x1000) |
| virtual Bool_t | SetMaxFieldSize (Int_t, Long_t) |
| Bool_t | SetTime (Int_t, const TDatime &) |
| virtual void | SetTimeFormating (const char *) |
| Bool_t | SetTimestamp (Int_t, const TDatime &) |
| virtual Bool_t | SetTimestamp (Int_t, const TTimeStamp &) |
| virtual Bool_t | SetVDouble (Int_t, const std::vector< Double_t >, const char *, const char *) |
| virtual Bool_t | SetVInt (Int_t, const std::vector< Int_t >, const char *, const char *) |
| virtual Bool_t | SetVLong (Int_t, const std::vector< Long_t >, const char *, const char *) |
| virtual Bool_t | SetVLong64 (Int_t, const std::vector< Long64_t >, const char *, const char *) |
| virtual Bool_t | SetVUInt (Int_t, const std::vector< UInt_t >, const char *, const char *) |
| virtual Bool_t | SetVULong64 (Int_t, const std::vector< ULong64_t >, const char *, const char *) |
| void | Streamer (TBuffer &) override |
| void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Public Member Functions inherited from TObject | |
| TObject () | |
| TObject (const TObject &object) | |
| virtual | ~TObject () |
| void | AbstractMethod (const char *method) const |
| virtual void | AppendPad (Option_t *option="") |
| virtual void | Browse (TBrowser *b) |
| ULong_t | CheckedHash () |
| virtual const char * | ClassName () const |
| virtual void | Clear (Option_t *="") |
| virtual TObject * | Clone (const char *newname="") const |
| virtual Int_t | Compare (const TObject *obj) const |
| virtual void | Copy (TObject &object) const |
| virtual void | Delete (Option_t *option="") |
| virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
| virtual void | Draw (Option_t *option="") |
| virtual void | DrawClass () const |
| virtual TObject * | DrawClone (Option_t *option="") const |
| virtual void | Dump () const |
| virtual void | Error (const char *method, const char *msgfmt,...) const |
| virtual void | Execute (const char *method, const char *params, Int_t *error=nullptr) |
| virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr) |
| virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
| virtual void | Fatal (const char *method, const char *msgfmt,...) const |
| virtual TObject * | FindObject (const char *name) const |
| virtual TObject * | FindObject (const TObject *obj) const |
| virtual Option_t * | GetDrawOption () const |
| virtual const char * | GetIconName () const |
| virtual const char * | GetName () const |
| virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
| virtual Option_t * | GetOption () const |
| virtual const char * | GetTitle () const |
| virtual UInt_t | GetUniqueID () const |
| virtual Bool_t | HandleTimer (TTimer *timer) |
| virtual ULong_t | Hash () const |
| Bool_t | HasInconsistentHash () const |
| virtual void | Info (const char *method, const char *msgfmt,...) const |
| virtual Bool_t | InheritsFrom (const char *classname) const |
| virtual Bool_t | InheritsFrom (const TClass *cl) const |
| virtual void | Inspect () const |
| void | InvertBit (UInt_t f) |
| Bool_t | IsDestructed () const |
| virtual Bool_t | IsEqual (const TObject *obj) const |
| virtual Bool_t | IsFolder () const |
| R__ALWAYS_INLINE Bool_t | IsOnHeap () const |
| virtual Bool_t | IsSortable () const |
| R__ALWAYS_INLINE Bool_t | IsZombie () const |
| virtual void | ls (Option_t *option="") const |
| void | MayNotUse (const char *method) const |
| virtual Bool_t | Notify () |
| void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
| void | operator delete (void *ptr) |
| void | operator delete (void *ptr, void *vp) |
| void | operator delete[] (void *ptr) |
| void | operator delete[] (void *ptr, void *vp) |
| void * | operator new (size_t sz) |
| void * | operator new (size_t sz, void *vp) |
| void * | operator new[] (size_t sz) |
| void * | operator new[] (size_t sz, void *vp) |
| TObject & | operator= (const TObject &rhs) |
| virtual void | Paint (Option_t *option="") |
| virtual void | Pop () |
| virtual void | Print (Option_t *option="") const |
| virtual Int_t | Read (const char *name) |
| virtual void | RecursiveRemove (TObject *obj) |
| void | ResetBit (UInt_t f) |
| virtual void | SaveAs (const char *filename="", Option_t *option="") const |
| virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
| void | SetBit (UInt_t f) |
| void | SetBit (UInt_t f, Bool_t set) |
| virtual void | SetDrawOption (Option_t *option="") |
| virtual void | SetUniqueID (UInt_t uid) |
| void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
| virtual void | SysError (const char *method, const char *msgfmt,...) const |
| R__ALWAYS_INLINE Bool_t | TestBit (UInt_t f) const |
| Int_t | TestBits (UInt_t f) const |
| virtual void | UseCurrentStyle () |
| virtual void | Warning (const char *method, const char *msgfmt,...) const |
| virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) |
| virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const |
Private Member Functions | |
| Bool_t | CheckBindError (const char *method, int res) |
| long double | ConvertToNumeric (Int_t npar) |
| Convert field to numeric. More... | |
| const char * | ConvertToString (Int_t npar) |
| Convert field value to string. More... | |
| Bool_t | IsResultSetMode () const |
| Bool_t | IsSetParsMode () const |
| Iteration count. More... | |
| Bool_t | SetSQLParamType (Int_t npar, int sqltype, bool sig, int sqlsize=0) |
Private Attributes | |
| Int_t | fIterationCount {0} |
| Number of bindable / gettable parameters. More... | |
| Int_t | fNumPars {0} |
| 1 - setting parameters, 2 - retrieving results More... | |
| SQLite3_Stmt_t * | fStmt {nullptr} |
| Int_t | fWorkingMode {0} |
| executed statement More... | |
Additional Inherited Members | |
Public Types inherited from TObject | |
| enum | EDeprecatedStatusBits |
| enum | EStatusBits |
Static Public Member Functions inherited from TSQLStatement | |
| static TClass * | Class () |
| static const char * | Class_Name () |
| static constexpr Version_t | Class_Version () |
| static const char * | DeclFileName () |
Static Public Member Functions inherited from TObject | |
| static TClass * | Class () |
| static const char * | Class_Name () |
| static constexpr Version_t | Class_Version () |
| static const char * | DeclFileName () |
| static Longptr_t | GetDtorOnly () |
| static Bool_t | GetObjectStat () |
| static void | SetDtorOnly (void *obj) |
| static void | SetObjectStat (Bool_t stat) |
Public Attributes inherited from TObject | |
| kBitMask | |
| kCanDelete | |
| kCannotPick | |
| kHasUUID | |
| kInconsistent | |
| kInvalidObject | |
| kIsOnHeap | |
| kIsReferenced | |
| kMustCleanup | |
| kNoContextMenu | |
| kNotDeleted | |
| kObjInCanvas | |
| kOverwrite | |
| kSingleKey | |
| kWriteDelete | |
| kZombie | |
Protected Member Functions inherited from TSQLStatement | |
| TSQLStatement (Bool_t errout=kTRUE) | |
| void | ClearError () |
| void | SetError (Int_t code, const char *msg, const char *method=nullptr) |
Protected Member Functions inherited from TObject | |
| virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
| void | MakeZombie () |
Protected Attributes inherited from TSQLStatement | |
| Int_t | fErrorCode |
| TString | fErrorMsg |
| Bool_t | fErrorOut |
Protected Attributes inherited from TObject | |
| kOnlyPrepStep | |
| KVSQLiteStatement::KVSQLiteStatement | ( | SQLite3_Stmt_t * | stmt, |
| Bool_t | errout = kTRUE |
||
| ) |
Normal constructor. Checks if statement contains parameters tags.
Definition at line 42 of file KVSQLiteStatement.cxx.
|
virtual |
Destructor.
Definition at line 68 of file KVSQLiteStatement.cxx.
|
private |
Definition at line 143 of file KVSQLiteStatement.cxx.
| KVSQLiteStatement::ClassDefOverride | ( | KVSQLiteStatement | , |
| 0 | |||
| ) |
Close statement.
Reimplemented from TSQLStatement.
Definition at line 80 of file KVSQLiteStatement.cxx.
|
private |
Convert field to numeric.
Definition at line 374 of file KVSQLiteStatement.cxx.
|
private |
Convert field value to string.
Definition at line 360 of file KVSQLiteStatement.cxx.
Return field value as binary array. Memory at 'mem' will be reallocated and size updated to fit the data if not large enough.
Reimplemented from TSQLStatement.
Definition at line 502 of file KVSQLiteStatement.cxx.
|
inlinefinalvirtual |
Implements TSQLStatement.
Definition at line 64 of file KVSQLiteStatement.h.
|
finalvirtual |
Return field value as date.
Reimplemented from TSQLStatement.
Definition at line 528 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Return field value as date & time.
Reimplemented from TSQLStatement.
Definition at line 568 of file KVSQLiteStatement.cxx.
Return field value as double.
Reimplemented from TSQLStatement.
Definition at line 472 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Returns field name in result set.
Implements TSQLStatement.
Definition at line 289 of file KVSQLiteStatement.cxx.
Get integer.
Reimplemented from TSQLStatement.
Definition at line 402 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Return number of affected rows after statement is processed. Indirect changes e.g. by triggers are not counted, only direct changes from last completed statement are taken into account.
Reimplemented from TSQLStatement.
Definition at line 227 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Return number of fields in result set.
Implements TSQLStatement.
Definition at line 277 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Return number of statement parameters.
Implements TSQLStatement.
Definition at line 241 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Return field value as string.
Reimplemented from TSQLStatement.
Definition at line 486 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Return field as time.
Reimplemented from TSQLStatement.
Definition at line 548 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Return field as timestamp. Second fraction is in milliseconds, which is also the precision all date and time functions of sqlite use.
Reimplemented from TSQLStatement.
Definition at line 592 of file KVSQLiteStatement.cxx.
| TDatime TSQLStatement::GetTimestamp |
| virtual Bool_t TSQLStatement::GetTimestamp |
| virtual Bool_t TSQLStatement::GetTimestamp |
Get unsigned integer.
Reimplemented from TSQLStatement.
Definition at line 416 of file KVSQLiteStatement.cxx.
Return field value as unsigned 64-bit integer.
Reimplemented from TSQLStatement.
Definition at line 458 of file KVSQLiteStatement.cxx.
Checks if field value is null.
Reimplemented from TSQLStatement.
Definition at line 388 of file KVSQLiteStatement.cxx.
|
inlineprivate |
Definition at line 46 of file KVSQLiteStatement.h.
|
inlineprivate |
Iteration count.
Definition at line 42 of file KVSQLiteStatement.h.
|
finalvirtual |
Increment iteration counter for statement, where parameter can be set. Statement with parameters of previous iteration automatically will be applied to database. Actually a NO-OP for SQLite, as parameters stay bound when step-ping.
Implements TSQLStatement.
Definition at line 331 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Shift cursor to next row in result set.
Implements TSQLStatement.
Definition at line 304 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Set parameter value as binary data. Maxsize is ignored for SQLite, we directly insert BLOB of size 'size'. Negative size would cause undefined behaviour, so we refuse that.
Reimplemented from TSQLStatement.
Definition at line 738 of file KVSQLiteStatement.cxx.
Set parameter value as date.
Reimplemented from TSQLStatement.
Definition at line 757 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Set parameter value as date & time.
Reimplemented from TSQLStatement.
Definition at line 788 of file KVSQLiteStatement.cxx.
Set parameter value as double value.
Reimplemented from TSQLStatement.
Definition at line 708 of file KVSQLiteStatement.cxx.
Set parameter value as integer.
Reimplemented from TSQLStatement.
Definition at line 636 of file KVSQLiteStatement.cxx.
Set parameter value as long.
Reimplemented from TSQLStatement.
Definition at line 665 of file KVSQLiteStatement.cxx.
Set parameter value as 64-bit integer.
Reimplemented from TSQLStatement.
Definition at line 679 of file KVSQLiteStatement.cxx.
Set NULL as parameter value.
Reimplemented from TSQLStatement.
Definition at line 622 of file KVSQLiteStatement.cxx.
|
private |
|
finalvirtual |
Set parameter value as string.
Reimplemented from TSQLStatement.
Definition at line 722 of file KVSQLiteStatement.cxx.
Set parameter value as time.
Reimplemented from TSQLStatement.
Definition at line 772 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Set parameter value as timestamp. The second fraction has to be in milliseconds, as all SQLite functions for date and time assume 3 significant digits.
Reimplemented from TSQLStatement.
Definition at line 806 of file KVSQLiteStatement.cxx.
| Bool_t TSQLStatement::SetTimestamp |
| virtual Bool_t TSQLStatement::SetTimestamp |
| virtual Bool_t TSQLStatement::SetTimestamp |
Set parameter value as unsigned integer. Actually casted to signed integer, has to be re-casted upon read!
Reimplemented from TSQLStatement.
Definition at line 651 of file KVSQLiteStatement.cxx.
Set parameter value as unsigned 64-bit integer. Actually casted to signed integer, has to be re-casted upon read!
Reimplemented from TSQLStatement.
Definition at line 694 of file KVSQLiteStatement.cxx.
|
finalvirtual |
Store result of statement processing to access them via GetInt(), GetDouble() and so on methods. For SQLite, this is a NO-OP.
Implements TSQLStatement.
Definition at line 261 of file KVSQLiteStatement.cxx.
|
private |
Number of bindable / gettable parameters.
Definition at line 40 of file KVSQLiteStatement.h.
|
private |
1 - setting parameters, 2 - retrieving results
Definition at line 39 of file KVSQLiteStatement.h.
|
private |
Definition at line 37 of file KVSQLiteStatement.h.
|
private |
executed statement
Definition at line 38 of file KVSQLiteStatement.h.