KaliVeda
Toolkit for HIC analysis
KVDBKey.h
1 /***************************************************************************
2 $Id: KVDBKey.h,v 1.22 2009/03/11 14:19:50 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 __KVDBKEY_H
19 #define __KVDBKEY_H
20 
21 #include "KVBase.h"
22 #include "KVRList.h"
23 #include "TRef.h"
24 
25 class KVDBRecord;
26 
38 class KVDBKey: public KVBase {
39 
40 protected:
41 
46 
47  virtual void AddLink(KVDBRecord* rec);
48 
49  virtual void RemoveLink(KVDBRecord* rec);
50 
51 public:
52 
53  KVDBKey();
54  KVDBKey(const Char_t* name, const Char_t* title =
55  "", KVDBRecord* parent = 0);
56  virtual ~ KVDBKey();
57 
58  virtual Bool_t LinkTo(KVDBRecord* rec, Bool_t linkback = kTRUE);
59  virtual void Unlink(KVDBRecord* rec, Bool_t linkback = kTRUE);
60  virtual void UnlinkAll();
61 
62  virtual KVDBRecord* GetLink(const Char_t* link) const;
63 
65  virtual KVRList* GetLinks() const
66  {
67  return fLinks;
68  }
69  virtual KVDBRecord* GetParent();
70  virtual KVDBRecord* GetRecord();
71  virtual void SetParent(KVDBRecord* parent);
72  virtual void SetRecord(KVDBRecord* parent);
73  virtual void SetUniqueStatus(Bool_t unique)
74  {
75  fIsUnique = unique;
76  }
77 
78  virtual void SetSingleStatus(Bool_t single)
79  {
80  fSingle = single;
81  }
82  ClassDef(KVDBKey, 1) // Key in a Record
83 };
84 
85 #endif
bool Bool_t
char Char_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:142
Cross-reference in a KVDataBase.
Definition: KVDBKey.h:38
virtual void SetParent(KVDBRecord *parent)
Definition: KVDBKey.cpp:226
virtual KVDBRecord * GetParent()
Definition: KVDBKey.cpp:217
virtual void SetUniqueStatus(Bool_t unique)
Definition: KVDBKey.h:73
virtual void RemoveLink(KVDBRecord *rec)
Remove a link from the list of links.
Definition: KVDBKey.cpp:197
virtual void SetSingleStatus(Bool_t single)
Definition: KVDBKey.h:78
virtual void SetRecord(KVDBRecord *parent)
Definition: KVDBKey.cpp:235
virtual KVRList * GetLinks() const
return the list of cross-referenced objects
Definition: KVDBKey.h:65
KVDBKey()
Definition: KVDBKey.cpp:32
KVRList * fLinks
list of cross-referenced records
Definition: KVDBKey.h:45
virtual ~ KVDBKey()
virtual KVDBRecord * GetLink(const Char_t *link) const
Definition: KVDBKey.cpp:208
virtual void UnlinkAll()
Definition: KVDBKey.cpp:165
virtual void Unlink(KVDBRecord *rec, Bool_t linkback=kTRUE)
Definition: KVDBKey.cpp:135
virtual KVDBRecord * GetRecord()
Definition: KVDBKey.cpp:245
Bool_t fIsUnique
Can the list contains more than 1 object the same name.
Definition: KVDBKey.h:42
TRef fRecord
direct pointer to parent record
Definition: KVDBKey.h:44
Bool_t fSingle
Can the list contain more than 1 object in the list.
Definition: KVDBKey.h:43
virtual void AddLink(KVDBRecord *rec)
Add a link to the list of links.
Definition: KVDBKey.cpp:185
virtual Bool_t LinkTo(KVDBRecord *rec, Bool_t linkback=kTRUE)
Definition: KVDBKey.cpp:81
Record folder for the database.
Definition: KVDBRecord.h:43
Wrapper for TRefArray adding some functionality.
Definition: KVRList.h:37