KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVDBRecord.h
Go to the documentation of this file.
1 /***************************************************************************
2 $Id: KVDBRecord.h,v 1.19 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 
19 #ifndef __KVDBRECORD_H
20 #define __KVDBRECORD_H
21 
22 #include "TFolder.h"
23 #include "TList.h"
24 #include "TRef.h"
25 #include "KVRList.h"
26 
27 class KVDBKey;
28 class KVDBTable;
29 
42 class KVDBRecord: public TFolder {
43 
44 protected:
45 
48 
49 public:
50 
51  KVDBRecord();
52  KVDBRecord(const Char_t* name, const Char_t* title = "");
53  virtual ~ KVDBRecord();
54 
55  virtual KVDBKey* GetKey(const Char_t* key) const;
56  virtual TList* GetKeys() const;
57  virtual Bool_t AddLink(const Char_t* key_name, KVDBRecord* rec,
58  Bool_t linkback = kTRUE);
59  virtual void RemoveLink(const Char_t* key_name, KVDBRecord* rec,
60  Bool_t linkback = kTRUE);
61  virtual Bool_t AddKey(KVDBKey* key, Bool_t check = kTRUE);
62  virtual KVDBKey* AddKey(const Char_t* name, const Char_t* title,
63  Bool_t check = kTRUE);
64  virtual KVDBRecord* GetLink(const Char_t* key,
65  const Char_t* link) const;
66  virtual KVRList* GetLinks(const Char_t* key) const;
67  virtual void RemoveAllLinks(const Char_t* key);
68  virtual KVDBTable* GetTable() const;
69  virtual void SetTable(const KVDBTable* table);
70  virtual void Print(Option_t* option = "") const;
71  virtual void ls(Option_t* option = "*") const;
72  virtual Int_t GetNumber() const
73  {
74  return fNumber;
75  };
76  virtual void SetNumber(Int_t n)
77  {
78  fNumber = n;
79  };
80  virtual Int_t Compare(const TObject* obj) const;
81 
82  ClassDef(KVDBRecord, 3)//Base Class for a record
83 };
84 
85 #endif
int Int_t
char Char_t
bool Bool_t
const char Option_t
#define ClassDef(name, id)
Cross-reference in a KVDataBase.
Definition: KVDBKey.h:37
Record folder for the database.
Definition: KVDBRecord.h:42
virtual void SetNumber(Int_t n)
Definition: KVDBRecord.h:76
virtual void SetTable(const KVDBTable *table)
Definition: KVDBRecord.cpp:280
virtual void Print(Option_t *option="") const
Definition: KVDBRecord.cpp:222
virtual KVDBKey * GetKey(const Char_t *key) const
Definition: KVDBRecord.cpp:290
virtual void ls(Option_t *option="*") const
Definition: KVDBRecord.cpp:243
virtual Bool_t AddKey(KVDBKey *key, Bool_t check=kTRUE)
Definition: KVDBRecord.cpp:65
virtual KVDBRecord * GetLink(const Char_t *key, const Char_t *link) const
Returns the record named "link" in the table named "key".
Definition: KVDBRecord.cpp:186
virtual Int_t Compare(const TObject *obj) const
Definition: KVDBRecord.cpp:256
TString fFullPathTable
full path to parent table in folder structure
Definition: KVDBRecord.h:46
virtual Bool_t AddLink(const Char_t *key_name, KVDBRecord *rec, Bool_t linkback=kTRUE)
Definition: KVDBRecord.cpp:122
virtual void RemoveLink(const Char_t *key_name, KVDBRecord *rec, Bool_t linkback=kTRUE)
Remove the link between this record and the record "rec" in the DB table"key_name".
Definition: KVDBRecord.cpp:145
virtual KVRList * GetLinks(const Char_t *key) const
Returns the list of records linked to this record in table "key".
Definition: KVDBRecord.cpp:206
virtual void RemoveAllLinks(const Char_t *key)
Remove all links between this record and the records in the DB table"key_name".
Definition: KVDBRecord.cpp:166
Int_t fNumber
number which can be used to identify/sort record
Definition: KVDBRecord.h:47
virtual Int_t GetNumber() const
Definition: KVDBRecord.h:72
virtual TList * GetKeys() const
Definition: KVDBRecord.cpp:301
virtual KVDBTable * GetTable() const
Definition: KVDBRecord.cpp:271
virtual ~ KVDBRecord()
Table in a database.
Definition: KVDBTable.h:33
Wrapper for TRefArray adding some functionality.
Definition: KVRList.h:36
const Int_t n