KaliVeda
Toolkit for HIC analysis
KVDBTable.h
1 /***************************************************************************
2 $Id: KVDBTable.h,v 1.18 2007/05/31 09:59:22 franklan Exp $
3  KVDataBase.h - description
4  -------------------
5  begin : jeu fév 6 2003
6  copyright : (C) 2003 by Alexis Mignon
7  email : mignon@ganil.fr
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 #ifndef __KVDBTABLE_H
19 #define __KVDBTABLE_H
20 
21 #include "TFolder.h"
22 
23 #include <KVSeqCollection.h>
24 
25 class KVDBRecord;
26 
34 class KVDBTable: public TFolder {
35 
36 private:
37  TObject* FindObject(const Char_t*) const
38  {
39  return nullptr; // do not use
40  }
41  TObject* FindObject(const TObject*) const
42  {
43  return nullptr; // do not use
44  }
45 
46 protected:
47 
51 
52 public:
53 
54  KVDBTable();
55  KVDBTable(const Char_t* name, const Char_t* title = "", Bool_t unique = kFALSE);
56  virtual ~ KVDBTable();
57 
58  virtual KVDBRecord* GetRecord(const Char_t* rec_name) const
59  {
60  return (KVDBRecord*) GetRecords()->FindObject(rec_name);
61  }
62  virtual KVDBRecord* GetRecord(Int_t n) const;
63  virtual KVSeqCollection* GetRecords() const
64  {
66  }
67  virtual Bool_t AddRecord(KVDBRecord* add);
68  virtual void RemoveRecord(KVDBRecord* add);
69  virtual void ls(Option_t* option = "*") const;
70 
71  virtual void SetFullPath(const Char_t* path)
72  {
73  fFullPath = path;
74  };
75  virtual const Char_t* GetFullPath() const
76  {
77  return fFullPath.Data();
78  };
79 
80  void SetDefaultFormat(const TString&);
82  {
83  return fDefFormatNumRec != "";
84  }
85  void Rehash(void);
86 
87  ClassDef(KVDBTable, 3) //Table object for database
88 };
89 
90 #endif
int Int_t
bool Bool_t
char Char_t
const char Option_t
#define ClassDef(name, id)
Record folder for the database.
Definition: KVDBRecord.h:43
Table in a database.
Definition: KVDBTable.h:34
TObject * FindObject(const TObject *) const
Definition: KVDBTable.h:41
virtual void SetFullPath(const Char_t *path)
Definition: KVDBTable.h:71
TString fDefFormatNumRec
default formatting for names of numbered records
Definition: KVDBTable.h:50
virtual Bool_t AddRecord(KVDBRecord *add)
Definition: KVDBTable.cpp:74
void Rehash(void)
Definition: KVDBTable.cpp:172
virtual ~ KVDBTable()
virtual void RemoveRecord(KVDBRecord *add)
Remove a KVDBRecord from the list of available records.
Definition: KVDBTable.cpp:93
virtual const Char_t * GetFullPath() const
Definition: KVDBTable.h:75
Bool_t HasDefaultFormat() const
Definition: KVDBTable.h:81
void SetDefaultFormat(const TString &)
Definition: KVDBTable.cpp:122
TString fFullPath
full path to table in folder structure
Definition: KVDBTable.h:49
Bool_t fIsUnique
Must each record name be unique ?
Definition: KVDBTable.h:48
virtual KVDBRecord * GetRecord(const Char_t *rec_name) const
Definition: KVDBTable.h:58
TObject * FindObject(const Char_t *) const
Definition: KVDBTable.h:37
virtual KVSeqCollection * GetRecords() const
Definition: KVDBTable.h:63
virtual void ls(Option_t *option="*") const
Definition: KVDBTable.cpp:106
KaliVeda extensions to ROOT collection classes.
virtual TObject * FindObject(const char *name) const
TCollection * GetListOfFolders() const
const char * Data() const