KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVDBTable.h
Go to the documentation of this file.
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 
33 class KVDBTable: public TFolder {
34 
35 private:
36  TObject* FindObject(const Char_t*) const
37  {
38  return nullptr; // do not use
39  }
40  TObject* FindObject(const TObject*) const
41  {
42  return nullptr; // do not use
43  }
44 
45 protected:
46 
50 
51 public:
52 
53  KVDBTable();
54  KVDBTable(const Char_t* name, const Char_t* title = "", Bool_t unique = kFALSE);
55  virtual ~ KVDBTable();
56 
57  virtual KVDBRecord* GetRecord(const Char_t* rec_name) const
58  {
59  return (KVDBRecord*) GetRecords()->FindObject(rec_name);
60  }
61  virtual KVDBRecord* GetRecord(Int_t n) const;
62  virtual KVSeqCollection* GetRecords() const
63  {
65  }
66  virtual Bool_t AddRecord(KVDBRecord* add);
67  virtual void RemoveRecord(KVDBRecord* add);
68  virtual void ls(Option_t* option = "*") const;
69 
70  virtual void SetFullPath(const Char_t* path)
71  {
72  fFullPath = path;
73  };
74  virtual const Char_t* GetFullPath() const
75  {
76  return fFullPath.Data();
77  };
78 
79  void SetDefaultFormat(const TString&);
81  {
82  return fDefFormatNumRec != "";
83  }
84  void Rehash(void);
85 
86  ClassDef(KVDBTable, 3) //Table object for database
87 };
88 
89 #endif
int Int_t
char Char_t
bool Bool_t
const char Option_t
#define ClassDef(name, id)
Record folder for the database.
Definition: KVDBRecord.h:42
Table in a database.
Definition: KVDBTable.h:33
TObject * FindObject(const TObject *) const
Definition: KVDBTable.h:40
virtual void SetFullPath(const Char_t *path)
Definition: KVDBTable.h:70
TString fDefFormatNumRec
default formatting for names of numbered records
Definition: KVDBTable.h:49
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:74
Bool_t HasDefaultFormat() const
Definition: KVDBTable.h:80
void SetDefaultFormat(const TString &)
Definition: KVDBTable.cpp:122
TString fFullPath
full path to table in folder structure
Definition: KVDBTable.h:48
Bool_t fIsUnique
Must each record name be unique ?
Definition: KVDBTable.h:47
virtual KVDBRecord * GetRecord(const Char_t *rec_name) const
Definition: KVDBTable.h:57
TObject * FindObject(const Char_t *) const
Definition: KVDBTable.h:36
virtual KVSeqCollection * GetRecords() const
Definition: KVDBTable.h:62
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