KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVDBKey.h
Go to the documentation of this file.
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 
37 class KVDBKey: public KVBase {
38 
39 protected:
40 
45 
46  virtual void AddLink(KVDBRecord* rec);
47 
48  virtual void RemoveLink(KVDBRecord* rec);
49 
50 public:
51 
52  KVDBKey();
53  KVDBKey(const Char_t* name, const Char_t* title =
54  "", KVDBRecord* parent = 0);
55  virtual ~ KVDBKey();
56 
57  virtual Bool_t LinkTo(KVDBRecord* rec, Bool_t linkback = kTRUE);
58  virtual void Unlink(KVDBRecord* rec, Bool_t linkback = kTRUE);
59  virtual void UnlinkAll();
60 
61  virtual KVDBRecord* GetLink(const Char_t* link) const;
62 
64  virtual KVRList* GetLinks() const
65  {
66  return fLinks;
67  }
68  virtual KVDBRecord* GetParent();
69  virtual KVDBRecord* GetRecord();
70  virtual void SetParent(KVDBRecord* parent);
71  virtual void SetRecord(KVDBRecord* parent);
72  virtual void SetUniqueStatus(Bool_t unique)
73  {
74  fIsUnique = unique;
75  }
76 
77  virtual void SetSingleStatus(Bool_t single)
78  {
79  fSingle = single;
80  }
81  ClassDef(KVDBKey, 1) // Key in a Record
82 };
83 
84 #endif
char Char_t
bool Bool_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:135
Cross-reference in a KVDataBase.
Definition: KVDBKey.h:37
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:72
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:77
virtual void SetRecord(KVDBRecord *parent)
Definition: KVDBKey.cpp:235
virtual KVRList * GetLinks() const
return the list of cross-referenced objects
Definition: KVDBKey.h:64
KVDBKey()
Definition: KVDBKey.cpp:32
KVRList * fLinks
list of cross-referenced records
Definition: KVDBKey.h:44
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:41
TRef fRecord
direct pointer to parent record
Definition: KVDBKey.h:43
Bool_t fSingle
Can the list contain more than 1 object in the list.
Definition: KVDBKey.h:42
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:42
Wrapper for TRefArray adding some functionality.
Definition: KVRList.h:36