KaliVeda
Toolkit for HIC analysis
KVDBTable Class Reference

Detailed Description

Table in a database.

Definition at line 34 of file KVDBTable.h.

#include <KVDBTable.h>

Inheritance diagram for KVDBTable:

Public Member Functions

 KVDBTable ()
 
 KVDBTable (const Char_t *name, const Char_t *title="", Bool_t unique=kFALSE)
 
virtual ~ KVDBTable ()
 
virtual Bool_t AddRecord (KVDBRecord *add)
 
virtual const Char_t * GetFullPath () const
 
virtual KVDBRecord * GetRecord (const Char_t *rec_name) const
 
virtual KVDBRecord * GetRecord (Int_t n) const
 
virtual KVSeqCollection * GetRecords () const
 
Bool_t HasDefaultFormat () const
 
void ls (Option_t *option="*") const override
 
void Rehash (void)
 
virtual void RemoveRecord (KVDBRecord *add)
 Remove a KVDBRecord from the list of available records. More...
 
void SetDefaultFormat (const TString &)
 
virtual void SetFullPath (const Char_t *path)
 

Constructor & Destructor Documentation

◆ KVDBTable() [1/2]

KVDBTable::KVDBTable ( )

Definition at line 33 of file KVDBTable.cpp.

◆ KVDBTable() [2/2]

KVDBTable::KVDBTable ( const Char_t *  name,
const Char_t *  title = "",
Bool_t  unique = kFALSE 
)

Definition at line 43 of file KVDBTable.cpp.

◆ ~ KVDBTable()

virtual KVDBTable::~ KVDBTable ( )
virtual

Member Function Documentation

◆ AddRecord()

Bool_t KVDBTable::AddRecord ( KVDBRecord *  rec)
virtual

Add a KVDBRecord to the list of available records and return kTRUE

If a default formatting string for names of numbered records has been set (see SetDefaultFormat(const TString&)) the name of the record will be automatically set here according to the format and its number.

Definition at line 75 of file KVDBTable.cpp.

◆ GetFullPath()

virtual const Char_t* KVDBTable::GetFullPath ( ) const
inlinevirtual

Definition at line 75 of file KVDBTable.h.

◆ GetRecord() [1/2]

virtual KVDBRecord* KVDBTable::GetRecord ( const Char_t *  rec_name) const
inlinevirtual

Definition at line 58 of file KVDBTable.h.

◆ GetRecord() [2/2]

KVDBRecord * KVDBTable::GetRecord ( Int_t  num) const
virtual

Sequential search for record using its number. To keep things simple, we only search in the top level of the folder structure.

NOTE: if there are many records, this sequential search can be long. If a default format for the record name using its number has been defined (see SetDefaultFormat(const TString&)) the search will be performed using the resulting formatted object name, which is fast (hash list).

Definition at line 148 of file KVDBTable.cpp.

◆ GetRecords()

virtual KVSeqCollection* KVDBTable::GetRecords ( ) const
inlinevirtual

Definition at line 63 of file KVDBTable.h.

◆ HasDefaultFormat()

Bool_t KVDBTable::HasDefaultFormat ( ) const
inline

Definition at line 81 of file KVDBTable.h.

◆ ls()

void KVDBTable::ls ( Option_t *  option = "*") const
override

Definition at line 108 of file KVDBTable.cpp.

◆ Rehash()

void KVDBTable::Rehash ( void  )

The list of records is a KVHashList or KVUniqueNameList Call this method if the names of the records change after having been added to the table, otherwise GetRecord(const char*) will not work.

Definition at line 174 of file KVDBTable.cpp.

◆ RemoveRecord()

void KVDBTable::RemoveRecord ( KVDBRecord *  add)
virtual

Remove a KVDBRecord from the list of available records.

Definition at line 95 of file KVDBTable.cpp.

◆ SetDefaultFormat()

void KVDBTable::SetDefaultFormat ( const TString &  fmt)

Set a default formatting string for names of numbered records. e.g. if fmt="Rec#%d", each record which is added to the table will have its name automatically set to "Rec#1", "Rec#2", etc., according to the record number. This allows to replace a slow sequential scan for a record based on number (GetRecord(Int_t)) with a fast hash-based look-up

Definition at line 124 of file KVDBTable.cpp.

◆ SetFullPath()

virtual void KVDBTable::SetFullPath ( const Char_t *  path)
inlinevirtual

Definition at line 71 of file KVDBTable.h.