ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Garbage.h
Go to the documentation of this file.
1 /*
2  * Garbage.h
3  *
4  * Created on: Sep 29, 2014
5  * Author: michael
6  *
7  * Last modified $Id§
8  */
9 
10 #ifndef GARBAGE_H_
11 #define GARBAGE_H_
12 
13 #include <RQ_OBJECT.h>
14 #include <TObject.h>
15 //#include <TTimer.h>
16 
17 #include <iostream>
18 #include <list>
19 
20 class TTimer;
21 
30 class Garbage : public TObject {
31 
32  //to get signal/slots, because do not derive from TGMainFrame
33  RQ_OBJECT("Garbage")
34 
35 private:
36 
37  // private constructor and destructor
38  Garbage();
39  ~Garbage();
40  // make non cpopyable
41  Garbage(const Garbage &);
42  const Garbage & operator= (const Garbage &);
43 
44  // list of object to delete
45  std::list<TObject*> list_object;
46  typedef std::list<TObject*>::iterator it_l;
47 
48 public:
49  static Garbage & getInstance();
50  //static Garbage* getInstance();
52  void Add( TObject *);
54  virtual Bool_t HandleTimer(TTimer *);
55 
56  ClassDef(Garbage,0)
57 };
58 
59 #endif /* GARBAGE_H_ */
void Add(TObject *)
Add a TOBject to be deleted.
Definition: Garbage.cxx:39
virtual Bool_t HandleTimer(TTimer *)
called by a TTImer and delete all objects in the list
Definition: Garbage.cxx:47
~Garbage()
Definition: Garbage.cxx:33
Garbage collector for ROOT TObjects.
Definition: Garbage.h:30
const Garbage & operator=(const Garbage &)
static Garbage & getInstance()
Definition: Garbage.cxx:19
std::list< TObject * >::iterator it_l
Definition: Garbage.h:46
std::list< TObject * > list_object
Definition: Garbage.h:45