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  KVBase* FindObjectByName(const Char_t*) const;
50  KVBase* FindObjectByType(const Char_t*) const;
51  KVBase* FindObjectByLabel(const Char_t*) const;
52  KVBase* FindObject(const Char_t* name,
53  const Char_t* type) const;
54  KVBase* FindObject(KVBase* obj) const;
55  TObject* FindObject(const TObject* obj) const override
56  {
57  return TCollection::FindObject(obj);
58  }
59  TObject* FindObject(const char* obj) const override
60  {
61  return TCollection::FindObject(obj);
62  }
63 
64  virtual void Execute(const char* method, const char* params,
65  Int_t* error = 0) override;
66  void Execute(TMethod* m, TObjArray* o, Int_t* i) override
67  {
68  TObject::Execute(m, o, i);
69  };
70 
71 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
72  void Copy(TObject& obj) const override;
73 #else
74  virtual void Copy(TObject& obj);
75 #endif
76  Int_t GetSize() const override
77  {
78  return GetLast() + 1;
79  };
80  void Print(Option_t* opt = "") const override;
81  void Print(Option_t* option, Int_t recurse) const override
82  {
83  TCollection::Print(option, recurse);
84  };
85  void Print(Option_t* option, const char* wildcard, Int_t recurse = 1) const override
86  {
87  TCollection::Print(option, wildcard, recurse);
88  };
89  void Print(Option_t* option, TPRegexp& regexp, Int_t recurse = 1) const override
90  {
91  TCollection::Print(option, regexp, recurse);
92  };
93 
94  ClassDefOverride(KVRList, 1) //KV wrapper for ROOT TRefArray class
95 };
96 
97 #endif
int Int_t
size_t size(const MatrixT &matrix)
char Char_t
const char Option_t
#define ClassDefOverride(name, id)
Option_t Option_t option
Base class for KaliVeda framework.
Definition: KVBase.h:139
Wrapper for TRefArray adding some functionality.
Definition: KVRList.h:37
virtual void Execute(const char *method, const char *params, Int_t *error=0) override
Definition: KVRList.cpp:185
void Print(Option_t *option, const char *wildcard, Int_t recurse=1) const override
Definition: KVRList.h:85
KVBase * FindObjectByName(const Char_t *) const
Look for object with name "name" in the list.
Definition: KVRList.cpp:31
void Print(Option_t *option, Int_t recurse) const override
Definition: KVRList.h:81
KVRList(Int_t s, TProcessID *pid)
Definition: KVRList.h:45
TObject * FindObject(const TObject *obj) const override
Definition: KVRList.h:55
void Print(Option_t *option, TPRegexp &regexp, Int_t recurse=1) const override
Definition: KVRList.h:89
KVBase * FindObject(const Char_t *name, const Char_t *type) const
Definition: KVRList.cpp:106
void Print(Option_t *opt="") const override
Print description of all objects in list.
Definition: KVRList.cpp:162
KVBase * FindObjectByType(const Char_t *) const
Definition: KVRList.cpp:46
KVRList(Int_t size, Int_t lowerBound=0, TProcessID *pid=0)
Definition: KVRList.h:46
KVBase * FindObjectByLabel(const Char_t *) const
Definition: KVRList.cpp:76
void Copy(TObject &obj) const override
Definition: KVRList.cpp:139
void Execute(TMethod *m, TObjArray *o, Int_t *i) override
Definition: KVRList.h:66
TObject * FindObject(const char *obj) const override
Definition: KVRList.h:59
Int_t GetSize() const override
Definition: KVRList.h:76
KVRList(TProcessID *pid=0)
Definition: KVRList.h:44
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