KaliVeda
Toolkit for HIC analysis
KVRList.h
1 /***************************************************************************
2  kvrlist.h - description
3  -------------------
4  begin : Thu Mar 13 2003
5  copyright : (C) 2003 by J.D Frankland & Alexis Mignon
6  email : frankland@ganil.fr, mignon@ganil.fr
7 
8 $Id: KVRList.h,v 1.15 2009/01/19 12:03:10 franklan Exp $
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  ***************************************************************************/
19 
20 #ifndef KVRLIST_H
21 #define KVRLIST_H
22 
23 #define KVRLIST_NOT_WITH_THIS_TYPE "No object found with type %s"
24 #define KVRLIST_NOT_WITH_THIS_NAME_AND_TYPE "No object found with name %s and type %s"
25 
26 #include "KVBase.h"
27 #include "RVersion.h"
28 #include "TRefArray.h"
29 #include "KVConfig.h"
30 
37 class KVRList: public TRefArray {
38 
39 public:
40 #ifdef __WITH_OLD_TREFARRAY
41  KVRList() : TRefArray() {};
42  KVRList(Int_t size, Int_t lowerBound = 0) : TRefArray(size, lowerBound) {};
43 #else
44  KVRList(TProcessID* pid = 0) : TRefArray(pid) {};
45  KVRList(Int_t s, TProcessID* pid) : TRefArray(s, pid) {};
46  KVRList(Int_t size, Int_t lowerBound = 0, TProcessID* pid = 0) : TRefArray(size, lowerBound, pid) {};
47 #endif
48 
49  virtual ~ KVRList() {};
50  virtual KVBase* FindObjectByName(const Char_t*) const;
51  virtual KVBase* FindObjectByType(const Char_t*) const;
52  virtual KVBase* FindObjectByLabel(const Char_t*) const;
53  virtual KVBase* FindObject(const Char_t* name,
54  const Char_t* type) const;
55  virtual KVBase* FindObject(KVBase* obj) const;
56  virtual TObject* FindObject(const TObject* obj) const
57  {
58  return TCollection::FindObject(obj);
59  };
60  virtual TObject* FindObject(const char* obj) const
61  {
62  return TCollection::FindObject(obj);
63  };
64 
65  virtual void Execute(const char* method, const char* params,
66  Int_t* error = 0);
67  virtual void Execute(TMethod* m, TObjArray* o, Int_t* i)
68  {
69  TObject::Execute(m, o, i);
70  };
71 
72 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
73  virtual void Copy(TObject& obj) const;
74 #else
75  virtual void Copy(TObject& obj);
76 #endif
77  virtual Int_t GetSize() const
78  {
79  return GetLast() + 1;
80  };
81  virtual void Print(Option_t* opt = "") const;
82 #ifdef __WITH_NEW_TCOLLECTION_PRINT
83  virtual void Print(Option_t* option, Int_t recurse) const
84  {
85  TCollection::Print(option, recurse);
86  };
87  virtual void Print(Option_t* option, const char* wildcard, Int_t recurse = 1) const
88  {
89  TCollection::Print(option, wildcard, recurse);
90  };
91  virtual void Print(Option_t* option, TPRegexp& regexp, Int_t recurse = 1) const
92  {
93  TCollection::Print(option, regexp, recurse);
94  };
95 #else
96 #ifdef __WITH_TCOLLECTION_PRINT_WILDCARD
97  virtual void Print(Option_t* wildcard, Option_t* opt) const
98  {
99  TCollection::Print(wildcard, opt);
100  };
101 #endif
102 #endif
103 
104  ClassDef(KVRList, 1) //KV wrapper for ROOT TRefArray class
105 };
106 
107 #endif
int Int_t
size_t size(const MatrixT &matrix)
char Char_t
const char Option_t
#define ClassDef(name, id)
Option_t Option_t option
Base class for KaliVeda framework.
Definition: KVBase.h:142
Wrapper for TRefArray adding some functionality.
Definition: KVRList.h:37
virtual Int_t GetSize() const
Definition: KVRList.h:77
virtual void Print(Option_t *option, Int_t recurse) const
Definition: KVRList.h:83
virtual KVBase * FindObjectByName(const Char_t *) const
Look for object with name "name" in the list.
Definition: KVRList.cpp:31
KVRList(Int_t s, TProcessID *pid)
Definition: KVRList.h:45
virtual TObject * FindObject(const TObject *obj) const
Definition: KVRList.h:56
virtual KVBase * FindObject(const Char_t *name, const Char_t *type) const
Definition: KVRList.cpp:106
virtual KVBase * FindObjectByType(const Char_t *) const
Definition: KVRList.cpp:46
virtual void Execute(const char *method, const char *params, Int_t *error=0)
Definition: KVRList.cpp:185
KVRList(Int_t size, Int_t lowerBound=0, TProcessID *pid=0)
Definition: KVRList.h:46
virtual void Execute(TMethod *m, TObjArray *o, Int_t *i)
Definition: KVRList.h:67
virtual KVBase * FindObjectByLabel(const Char_t *) const
Definition: KVRList.cpp:76
virtual void Print(Option_t *opt="") const
Print description of all objects in list.
Definition: KVRList.cpp:162
virtual void Copy(TObject &obj) const
Definition: KVRList.cpp:139
virtual TObject * FindObject(const char *obj) const
Definition: KVRList.h:60
KVRList(TProcessID *pid=0)
Definition: KVRList.h:44
virtual void Print(Option_t *option, TPRegexp &regexp, Int_t recurse=1) const
Definition: KVRList.h:91
virtual void Print(Option_t *option, const char *wildcard, Int_t recurse=1) const
Definition: KVRList.h:87
virtual ~ KVRList()
Definition: KVRList.h:49
virtual void Print(Option_t *option, const char *wildcard, Int_t recurse=1) const
TObject * FindObject(const char *name) const override
virtual void Execute(const char *method, const char *params, Int_t *error=nullptr)
Int_t GetLast() const override
TRefArray(const TRefArray &a)
TMarker m