KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVRList.h
Go to the documentation of this file.
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 
36 class KVRList: public TRefArray {
37 
38 public:
39 #ifdef __WITH_OLD_TREFARRAY
40  KVRList() : TRefArray() {};
41  KVRList(Int_t size, Int_t lowerBound = 0) : TRefArray(size, lowerBound) {};
42 #else
43  KVRList(TProcessID* pid = 0) : TRefArray(pid) {};
44  KVRList(Int_t s, TProcessID* pid) : TRefArray(s, pid) {};
45  KVRList(Int_t size, Int_t lowerBound = 0, TProcessID* pid = 0) : TRefArray(size, lowerBound, pid) {};
46 #endif
47 
48  virtual ~ KVRList() {};
49  virtual KVBase* FindObjectByName(const Char_t*) const;
50  virtual KVBase* FindObjectByType(const Char_t*) const;
51  virtual KVBase* FindObjectByLabel(const Char_t*) const;
52  virtual KVBase* FindObject(const Char_t* name,
53  const Char_t* type) const;
54  virtual KVBase* FindObject(KVBase* obj) const;
55  virtual TObject* FindObject(const TObject* obj) const
56  {
57  return TCollection::FindObject(obj);
58  };
59  virtual TObject* FindObject(const char* obj) const
60  {
61  return TCollection::FindObject(obj);
62  };
63 
64  virtual void Execute(const char* method, const char* params,
65  Int_t* error = 0);
66  virtual void Execute(TMethod* m, TObjArray* o, Int_t* i)
67  {
68  TObject::Execute(m, o, i);
69  };
70 
71 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
72  virtual void Copy(TObject& obj) const;
73 #else
74  virtual void Copy(TObject& obj);
75 #endif
76  virtual Int_t GetSize() const
77  {
78  return GetLast() + 1;
79  };
80  virtual void Print(Option_t* opt = "") const;
81 #ifdef __WITH_NEW_TCOLLECTION_PRINT
82  virtual void Print(Option_t* option, Int_t recurse) const
83  {
84  TCollection::Print(option, recurse);
85  };
86  virtual void Print(Option_t* option, const char* wildcard, Int_t recurse = 1) const
87  {
88  TCollection::Print(option, wildcard, recurse);
89  };
90  virtual void Print(Option_t* option, TPRegexp& regexp, Int_t recurse = 1) const
91  {
92  TCollection::Print(option, regexp, recurse);
93  };
94 #else
95 #ifdef __WITH_TCOLLECTION_PRINT_WILDCARD
96  virtual void Print(Option_t* wildcard, Option_t* opt) const
97  {
98  TCollection::Print(wildcard, opt);
99  };
100 #endif
101 #endif
102 
103  ClassDef(KVRList, 1) //KV wrapper for ROOT TRefArray class
104 };
105 
106 #endif
int Int_t
size_t size(const MatrixT &matrix)
char Char_t
const char Option_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:135
Wrapper for TRefArray adding some functionality.
Definition: KVRList.h:36
virtual Int_t GetSize() const
Definition: KVRList.h:76
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:44
virtual TObject * FindObject(const TObject *obj) const
Definition: KVRList.h:55
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:45
virtual void Execute(TMethod *m, TObjArray *o, Int_t *i)
Definition: KVRList.h:66
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:59
KVRList(TProcessID *pid=0)
Definition: KVRList.h:43
virtual ~ KVRList()
Definition: KVRList.h:48
virtual TObject * FindObject(const char *name) const
virtual void Print(Option_t *option, const char *wildcard, Int_t recurse=1) const
virtual void Execute(const char *method, const char *params, Int_t *error=0)
Int_t GetLast() const
TRefArray(const TRefArray &a)
const long double s
Definition: KVUnits.h:94
const long double m
Definition: KVUnits.h:70