GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ObjectManager.h
Go to the documentation of this file.
1 // $Id: TGo4ObjectManager.h 1073 2013-12-05 12:21:46Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4OBJECTMANAGER_H
15 #define TGO4OBJECTMANAGER_H
16 
17 #include "TGo4Slot.h"
18 #include "TGo4AccessWrapper.h"
19 
20 #include "TObjArray.h"
21 
22 class TFile;
23 class TDirectory;
24 class TTree;
25 class TFolder;
26 class TGo4Access;
27 
29  friend class TGo4Access;
30 
31  public:
33 
34  TGo4ObjectManager(const char* name, const char* title);
35 
36  virtual ~TGo4ObjectManager();
37 
38  virtual void ProduceFullName(TString& name, TGo4Slot* toparent = 0);
39  virtual TGo4ObjectManager* GetOM() const;
40 
41  void MakeFolder(const char* pathname);
42 
43  TGo4Slot* Add(const char* pathname, TObject* obj, Bool_t owner = kFALSE, Bool_t canrename = kFALSE);
44 
45  TGo4Slot* MakeObjSlot(const char* foldername, const char* name = 0, const char* title = 0);
46 
47  TGo4Slot* AddLink(TGo4Slot* source, const char* pathname, const char* linkname, const char* linktitle);
48 
49  TGo4Slot* AddLink(TGo4Slot* source, const char* pathname);
50 
51  TGo4Slot* AddLink(const char* sourcename, const char* pathname);
52 
53  TGo4Slot* GetLinked(TGo4Slot* link);
54 
55  void AddFile(const char* pathname, const char* filename);
56 
57  void CloseFiles(const char* pathname);
58 
59  void AddDir(const char* pathname, TDirectory* dir, Bool_t owner = kFALSE, Bool_t readright = kFALSE);
60 
61  void AddTree(const char* pathname, TTree* tree, Bool_t owner = kFALSE);
62 
63  void AddFolder(const char* pathname, TFolder* folder, Bool_t owner = kFALSE);
64 
65  void AddROOTFolder(const char* pathname, const char* foldername);
66 
67  void AddROOTFolders(const char* pathname, Bool_t selected = kTRUE);
68 
69  void AddProxy(const char* pathname, TGo4Proxy* cont, const char* name, const char* title = "title");
70  TGo4Proxy* GetProxy(const char* name);
71 
72  void DeleteSlot(const char* pathname);
73 
74  void SaveDataToFile(TFile* f, Bool_t onlyobjs = kFALSE, TGo4Slot* startslot = 0);
75 
76  void ReadDataFromFile(TFile* f);
77 
78  void RegisterLink(TGo4Slot* source, TGo4Slot* target, Bool_t exapndchilds = kFALSE);
79  void UnregisterLink(TGo4Slot* target);
80 
81  virtual TGo4Access* ProvideAccess(const char* name = 0)
82  { return ProvideSlotAccess(name); }
83 
84  virtual void Event(TGo4Slot* source, Int_t id, void* param = 0);
85  void RetranslateEvent(TGo4Slot* source, Int_t id, void* param = 0);
86  void RegisterObjectWith(TObject* obj, TGo4Slot* slot);
87  void UnregisterObject(TObject* obj, TGo4Slot* slot);
88 
89  void PrintSlots();
90 
91  Int_t IterateSlots();
92 
93  Int_t RequestObject(const char* source, const char* targetslot, Int_t waittime_millisec = 0);
94 
95  virtual void RecursiveRemove(TObject* obj);
96 
97  protected:
98 
99  virtual Bool_t AssignObject(const char* path, TObject* obj, Bool_t ownership);
100 
101  void RemoveFromLinks(const TGo4Slot* slot);
102 
103  TObjArray fLinks;
104 
105  TObjArray fCleanups;
106 
107  ClassDef(TGo4ObjectManager,1); // Object manager of all Go4 GUI objects
108 };
109 
110 #endif
void UnregisterObject(TObject *obj, TGo4Slot *slot)
ClassDef(TGo4ObjectManager, 1)
list of registered cleanups
Int_t RequestObject(const char *source, const char *targetslot, Int_t waittime_millisec=0)
void AddFile(const char *pathname, const char *filename)
void UnregisterLink(TGo4Slot *target)
TGo4Proxy * GetProxy() const
Definition: TGo4Slot.h:93
void MakeFolder(const char *pathname)
void AddROOTFolder(const char *pathname, const char *foldername)
void RegisterLink(TGo4Slot *source, TGo4Slot *target, Bool_t exapndchilds=kFALSE)
void RetranslateEvent(TGo4Slot *source, Int_t id, void *param=0)
virtual TGo4ObjectManager * GetOM() const
void RegisterObjectWith(TObject *obj, TGo4Slot *slot)
void DeleteSlot(const char *pathname)
void AddFolder(const char *pathname, TFolder *folder, Bool_t owner=kFALSE)
virtual void ProduceFullName(TString &name, TGo4Slot *toparent=0)
TGo4Slot * MakeObjSlot(const char *foldername, const char *name=0, const char *title=0)
void AddTree(const char *pathname, TTree *tree, Bool_t owner=kFALSE)
void SaveDataToFile(TFile *f, Bool_t onlyobjs=kFALSE, TGo4Slot *startslot=0)
void AddROOTFolders(const char *pathname, Bool_t selected=kTRUE)
virtual Bool_t AssignObject(const char *path, TObject *obj, Bool_t ownership)
void AddDir(const char *pathname, TDirectory *dir, Bool_t owner=kFALSE, Bool_t readright=kFALSE)
void AddProxy(const char *pathname, TGo4Proxy *cont, const char *name, const char *title="title")
virtual void Event(TGo4Slot *source, Int_t id, void *param=0)
void CloseFiles(const char *pathname)
virtual void RecursiveRemove(TObject *obj)
virtual TGo4Access * ProvideAccess(const char *name=0)
TGo4Slot * GetLinked(TGo4Slot *link)
TGo4Access * ProvideSlotAccess(const char *name)
Definition: TGo4Slot.cxx:413
void RemoveFromLinks(const TGo4Slot *slot)
TObjArray fCleanups
list of links between slots
TGo4Slot * Add(const char *pathname, TObject *obj, Bool_t owner=kFALSE, Bool_t canrename=kFALSE)
void ReadDataFromFile(TFile *f)
TGo4Slot * AddLink(TGo4Slot *source, const char *pathname, const char *linkname, const char *linktitle)