00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TGO4PROXY_H
00017 #define TGO4PROXY_H
00018
00019 #include "TObject.h"
00020
00021 class TGo4Slot;
00022 class TDirectory;
00023
00024 class TGo4ObjectReceiver {
00025 friend class TGo4Access;
00026 public:
00027 virtual ~TGo4ObjectReceiver() {}
00028 protected:
00029 virtual Bool_t AssignObject(const char* path, TObject* obj, Bool_t ownership) = 0;
00030 };
00031
00032
00033
00034 class TGo4Access {
00035 public:
00036 enum { kndNone = -1,
00037 kndObject = 0,
00038 kndFolder = 1,
00039 kndTreeBranch = 2,
00040 kndTreeLeaf = 3,
00041 kndGo4Param = 4,
00042 kndDataMember = 5,
00043 kndEventElement = 6 };
00044
00045 virtual ~TGo4Access() {}
00046
00047 virtual Bool_t IsRemote() const { return kFALSE; }
00048 virtual Bool_t CanGetObject() const;
00049 virtual Bool_t GetObject(TObject* &obj, Bool_t &owner) const;
00050 virtual TClass* GetObjectClass() const;
00051 virtual const char* GetObjectName() const;
00052 virtual const char* GetObjectClassName() const;
00057 virtual Int_t AssignObjectTo(TGo4ObjectReceiver* rcv, const char* path);
00058
00059 protected:
00060 void DoObjectAssignement(TGo4ObjectReceiver* rcv,
00061 const char* path,
00062 TObject* obj,
00063 Bool_t owner)
00064 {
00065 rcv->AssignObject(path, obj, owner);
00066 }
00067 };
00068
00069
00070
00071 class TGo4LevelIter : public TObject {
00072 public:
00073 TGo4LevelIter() : TObject() {}
00074 virtual ~TGo4LevelIter() {}
00075
00076 virtual Bool_t next() { return kFALSE; }
00077 virtual Bool_t isfolder() { return kFALSE; }
00078 virtual Bool_t isslotsfolder() { return kFALSE; }
00079 virtual Int_t getflag(const char*) { return -1; }
00080 virtual TGo4LevelIter* subiterator() { return 0; }
00081 virtual TGo4Slot* getslot() { return 0; }
00082 virtual const char* name() { return 0; }
00083 virtual const char* info() { return 0; }
00084 virtual Int_t sizeinfo() { return 0; }
00085
00086 virtual Int_t GetKind() { return -1; }
00087 virtual const char* GetClassName() { return 0; }
00088 };
00089
00090
00091
00092 class TGo4Proxy : public TObject {
00093 public:
00094 TGo4Proxy() : TObject() {}
00095 virtual ~TGo4Proxy() {}
00096
00097 virtual void Initialize(TGo4Slot* slot) {}
00098 virtual void Finalize(TGo4Slot* slot) {}
00099 virtual Bool_t RemoveRegisteredObject(TObject* obj) { return kFALSE; }
00100
00101 virtual Bool_t Use() const { return kTRUE; }
00102
00103 virtual Bool_t HasSublevels() const { return kFALSE; }
00104 virtual TGo4Access* MakeProxy(const char*) { return 0; }
00105 virtual TGo4LevelIter* MakeIter() { return 0; }
00106
00107 virtual Int_t GetObjectKind() { return TGo4Access::kndNone; }
00108 virtual const char* GetContainedClassName() { return 0; }
00109 virtual const char* GetContainedObjectInfo() { return 0; }
00110 virtual Int_t GetObjectSizeInfo() { return -1; }
00111
00112 virtual void WriteData(TGo4Slot* slot, TDirectory* dir, Bool_t onlyobjs) {}
00113 virtual void ReadData(TGo4Slot* slot, TDirectory* dir) {}
00114
00115 virtual Bool_t IsAcceptObject(TClass* cl) { return kFALSE; }
00116 virtual Bool_t AssignObject(TGo4Slot* slot, TObject* obj, Bool_t owner) { return kFALSE; }
00117 virtual TObject* GetAssignedObject() { return 0; }
00118 virtual void Update(TGo4Slot* slot, Bool_t strong) {}
00119
00120 virtual Bool_t ProcessEvent(TGo4Slot* slot, TGo4Slot* source, Int_t id, void* param) { return kTRUE; }
00121
00122 protected:
00123
00124
00125 ClassDef(TGo4Proxy, 1);
00126 };
00127
00128 #endif
00129
00130