Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TGO4OBJECTMANAGER_H
00015 #define TGO4OBJECTMANAGER_H
00016
00017 #include "TGo4Slot.h"
00018 #include "TGo4AccessWrapper.h"
00019
00020 #include "TObjArray.h"
00021
00022 class TFile;
00023 class TDirectory;
00024 class TTree;
00025 class TFolder;
00026 class TGo4Access;
00027
00028 class TGo4ObjectManager : public TGo4Slot, public TGo4AccessWrapper {
00029 friend class TGo4Access;
00030
00031 public:
00032 TGo4ObjectManager();
00033
00034 TGo4ObjectManager(const char* name, const char* title);
00035
00036 virtual ~TGo4ObjectManager();
00037
00038 virtual void ProduceFullName(TString& name, TGo4Slot* toparent = 0);
00039 virtual TGo4ObjectManager* GetOM() const;
00040
00041 void MakeFolder(const char* pathname);
00042
00043 TGo4Slot* Add(const char* pathname, TObject* obj, Bool_t owner = kFALSE, Bool_t canrename = kFALSE);
00044
00045 TGo4Slot* MakeObjSlot(const char* foldername, const char* name = 0, const char* title = 0);
00046
00047 TGo4Slot* AddLink(TGo4Slot* source, const char* pathname, const char* linkname, const char* linktitle);
00048
00049 TGo4Slot* AddLink(TGo4Slot* source, const char* pathname);
00050
00051 TGo4Slot* AddLink(const char* sourcename, const char* pathname);
00052
00053 TGo4Slot* GetLinked(TGo4Slot* link);
00054
00055 void AddFile(const char* pathname, const char* filename);
00056
00057 void CloseFiles(const char* pathname);
00058
00059 void AddDir(const char* pathname, TDirectory* dir, Bool_t owner = kFALSE, Bool_t readright = kFALSE);
00060
00061 void AddTree(const char* pathname, TTree* tree, Bool_t owner = kFALSE);
00062
00063 void AddFolder(const char* pathname, TFolder* folder, Bool_t owner = kFALSE);
00064
00065 void AddROOTFolder(const char* pathname, const char* foldername);
00066
00067 void AddROOTFolders(const char* pathname, Bool_t selected = kTRUE);
00068
00069 void AddProxy(const char* pathname, TGo4Proxy* cont, const char* name, const char* title = "title");
00070 TGo4Proxy* GetProxy(const char* name);
00071
00072 void DeleteSlot(const char* pathname);
00073
00074 void SaveDataToFile(TFile* f, Bool_t onlyobjs = kFALSE, TGo4Slot* startslot = 0);
00075
00076 void ReadDataFromFile(TFile* f);
00077
00078 void RegisterLink(TGo4Slot* source, TGo4Slot* target, Bool_t exapndchilds = kFALSE);
00079 void UnregisterLink(TGo4Slot* target);
00080
00081 virtual TGo4Access* ProvideAccess(const char* name = 0)
00082 { return ProvideSlotAccess(name); }
00083
00084 virtual void Event(TGo4Slot* source, Int_t id, void* param = 0);
00085 void RetranslateEvent(TGo4Slot* source, Int_t id, void* param = 0);
00086 void RegisterObjectWith(TObject* obj, TGo4Slot* slot);
00087 void UnregisterObject(TObject* obj, TGo4Slot* slot);
00088
00089 void PrintSlots();
00090
00091 Int_t IterateSlots();
00092
00093 Int_t RequestObject(const char* source, const char* targetslot, Int_t waittime_millisec = 0);
00094
00095 virtual void RecursiveRemove(TObject* obj);
00096
00097 protected:
00098
00099 virtual Bool_t AssignObject(const char* path, TObject* obj, Bool_t ownership);
00100
00101 void RemoveFromLinks(const TGo4Slot* slot);
00102
00103 TObjArray fLinks;
00104
00105 TObjArray fCleanups;
00106
00107 ClassDef(TGo4ObjectManager,1);
00108 };
00109
00110 #endif