Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TGO4SLOT_H
00015 #define TGO4SLOT_H
00016
00017 #include "TNamed.h"
00018 #include "TObjArray.h"
00019 #include "TGo4Proxy.h"
00020
00021 class TClass;
00022 class TDirectory;
00023 class TGo4ObjectManager;
00024
00025 class TGo4Slot : public TNamed {
00026 protected:
00027
00028 enum ESlotBits {
00029 kStartDelete = BIT(23)
00030 };
00031
00032 void CleanProxy();
00033
00034 void AddChild(TGo4Slot* child);
00035 void RemoveChild(TGo4Slot* child);
00036
00037 TGo4Slot* fParent;
00038 TObjArray* fChilds;
00039 TObjArray fPars;
00040 TGo4Proxy* fProxy;
00041 Int_t fAssignFlag;
00042
00043 public:
00044 enum { evDelete = 0,
00045 evCreate = 1,
00046 evObjAssigned = 2,
00047 evContAssigned = 3,
00048 evObjUpdated = 4,
00049 evSubslotUpdated = 5,
00050 evObjDeleted = 6 };
00051
00052 TGo4Slot();
00053 TGo4Slot(TGo4Slot* parent);
00054 TGo4Slot(TGo4Slot* parent, const char* name, const char* title);
00055 virtual ~TGo4Slot();
00056
00057 TGo4Slot* GetParent() const { return fParent; }
00058 void SetParent(TGo4Slot* parent) { fParent = parent; }
00059 Bool_t IsParent(const TGo4Slot* slot) const;
00060
00061 virtual void ProduceFullName(TString& name, TGo4Slot* toparent = 0);
00062 TString GetFullName(TGo4Slot* toparent = 0);
00063 virtual TGo4ObjectManager* GetOM() const;
00064
00065 const char* GetInfo();
00066 Int_t GetSizeInfo();
00067
00068 void SetPar(const char* name, const char* value);
00069 const char* GetPar(const char* name) const;
00070 void RemovePar(const char* name);
00071 void SetIntPar(const char* name, Int_t value);
00072 Bool_t GetIntPar(const char* name, Int_t& value);
00073 void PrintPars(Int_t level = 3);
00074
00075 Int_t NumChilds() const { return (fChilds!=0) ? fChilds->GetLast()+1 : 0; }
00076 TGo4Slot* GetChild(Int_t n) const { return (fChilds!=0) ? (TGo4Slot*) fChilds->At(n) : 0; }
00077 TGo4Slot* FindChild(const char* name);
00078 Int_t GetIndexOf(TGo4Slot* child);
00079 TGo4Slot* GetNextChild(TGo4Slot* child);
00080 TGo4Slot* GetNext();
00081 void DeleteChild(const char* name);
00082 void DeleteChilds(const char* startedwith = 0);
00083 virtual void Delete(Option_t *opt = "");
00084
00085 TGo4Slot* DefineSubSlot(const char* name, const char* &subname) const;
00086 TGo4Slot* GetSlot(const char* name, Bool_t force = kFALSE);
00087 TGo4Slot* FindSlot(const char* fullpath, const char** subname = 0);
00088 Bool_t ShiftSlotBefore(TGo4Slot* slot, TGo4Slot* before);
00089 Bool_t ShiftSlotAfter(TGo4Slot* slot, TGo4Slot* after);
00090
00091 void SetProxy(TGo4Proxy* cont);
00092 TGo4Proxy* GetProxy() const { return fProxy; }
00093
00094 Int_t GetSlotKind() const;
00095 const char* GetSlotClassName() const;
00096
00097 Bool_t IsAcceptObject(TClass* cl);
00098 Bool_t AssignObject(TObject* obj, Bool_t owner);
00099 TObject* GetAssignedObject();
00100 virtual void Update(Bool_t strong = kFALSE);
00101 Int_t GetAssignFlag() const { return fAssignFlag; }
00102 void ResetAssignFlag() { fAssignFlag = -1; }
00103
00104 Bool_t HasSubLevels() const;
00105 Bool_t HasSlotsSubLevels() const;
00106 TGo4LevelIter* MakeLevelIter() const;
00107 TGo4Access* ProvideSlotAccess(const char* name);
00108
00109 void SaveData(TDirectory* dir, Bool_t onlyobjs = kFALSE);
00110 void ReadData(TDirectory* dir);
00111
00112
00113 virtual void Event(TGo4Slot* source, Int_t id, void* param = 0);
00114 void ForwardEvent(TGo4Slot* source, Int_t id, void* param = 0);
00115
00116 virtual void RecursiveRemove(TObject* obj);
00117
00118 virtual void Print(Option_t* option) const;
00119
00120 static const char* FindFolderSeparator(const char* name);
00121 static void ProduceFolderAndName(const char* fullname, TString& foldername, TString& objectname);
00122
00123 Bool_t DoingDelete() const { return TestBit(kStartDelete); }
00124
00125 ClassDef(TGo4Slot, 1);
00126 };
00127
00128
00129 #endif
00130