KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVUniqueNameList.h
Go to the documentation of this file.
1 
4 #ifndef __KVUNIQUENAMELIST_H
5 #define __KVUNIQUENAMELIST_H
6 
7 #include "KVHashList.h"
8 
99 class KVUniqueNameList : public KVHashList {
102 
104 
105 public:
106  KVUniqueNameList(Bool_t R = kFALSE);
107  virtual ~KVUniqueNameList();
108  virtual void AddFirst(TObject* obj)
109  {
112 
114  };
115  virtual void AddLast(TObject* obj)
116  {
119 
120  if ((fLastCheck = checkObjInList(obj))) KVHashList::AddLast(obj);
121  };
122  virtual void AddAt(TObject* obj, Int_t idx)
123  {
126 
127  if ((fLastCheck = checkObjInList(obj))) KVHashList::AddAt(obj, idx);
128  };
129  virtual void AddAfter(const TObject* after, TObject* obj)
130  {
133 
134  if ((fLastCheck = checkObjInList(obj))) KVHashList::AddAfter(after, obj);
135  };
136  virtual void AddBefore(const TObject* before, TObject* obj)
137  {
140 
141  if ((fLastCheck = checkObjInList(obj))) KVHashList::AddBefore(before, obj);
142  };
143  virtual void Add(TObject* obj)
144  {
147 
148  if ((fLastCheck = checkObjInList(obj))) KVHashList::Add(obj);
149  };
150 
152  {
155 
156  Bool_t save = fLastCheck;
157  fLastCheck = kFALSE;
158  return save;
159  }
160  void ReplaceObjects(Bool_t yes = kTRUE)
161  {
162  fReplace = yes;
163  }
164 
165  ClassDef(KVUniqueNameList, 2) //Optimised list in which objects with the same name can only be placed once
166 };
167 
168 #endif
int Int_t
const Bool_t kFALSE
bool Bool_t
#define ClassDef(name, id)
Extended version of ROOT THashList.
Definition: KVHashList.h:28
virtual void AddLast(TObject *obj)
virtual void AddBefore(const TObject *before, TObject *obj)
virtual void AddAfter(const TObject *after, TObject *obj)
virtual void Add(TObject *obj)
virtual void AddAt(TObject *obj, Int_t idx)
virtual void AddFirst(TObject *obj)
Optimised list in which named objects can only be placed once.
Bool_t ObjectAdded() const
virtual void Add(TObject *obj)
Bool_t checkObjInList(TObject *obj)
Bool_t fLastCheck
return value of last call to checkobj
void ReplaceObjects(Bool_t yes=kTRUE)
virtual void AddAfter(const TObject *after, TObject *obj)
virtual void AddFirst(TObject *obj)
KVUniqueNameList(Bool_t R=kFALSE)
Default constructor.
virtual ~KVUniqueNameList()
Destructor.
virtual void AddLast(TObject *obj)
virtual void AddBefore(const TObject *before, TObject *obj)
virtual void AddAt(TObject *obj, Int_t idx)
Bool_t fReplace
if kTRUE, objects with same name are replaced