TObjectCollection.h
Go to the documentation of this file.
1 #ifndef _SdCalibPlotterOG_TObjectCollection_h_
2 #define _SdCalibPlotterOG_TObjectCollection_h_
3 
4 #include <vector>
5 #include <TObject.h>
6 
7 
8 namespace SdCalibPlotterOG {
9 
10 
12  private:
13  typedef std::vector<TObject*> ObjectCollection;
14 
15  public:
17 
19  {
20  for (ObjectCollection::iterator it = fObjects.begin();
21  it != fObjects.end(); ++it)
22  delete *it;
23  }
24 
25  protected:
26  template<class DerivedTObjectType>
27  DerivedTObjectType&
28  Add(DerivedTObjectType* const obj)
29  {
30  fObjects.push_back(obj);
31  return *obj;
32  }
33 
34  private:
37 
38  std::vector<TObject*> fObjects;
39  };
40 
41 
42 }
43 
44 
45 #endif
std::vector< TObject * > ObjectCollection
TObjectCollection & operator=(const TObjectCollection &)
std::vector< TObject * > fObjects
DerivedTObjectType & Add(DerivedTObjectType *const obj)

, generated on Tue Sep 26 2023.