GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4Proxy.h
Go to the documentation of this file.
1 // $Id: TGo4Proxy.h 1544 2015-06-15 12:06:13Z 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 TGO4PROXY_H
15 #define TGO4PROXY_H
16 
17 #include "TObject.h"
18 
19 class TGo4Slot;
20 class TDirectory;
21 class TGo4ObjectManager;
22 
23 //*********************************************************
24 
25 class TGo4Access {
26  public:
27  enum {
28  kndNone = -1,
29  kndObject = 0, // normal object
30  kndFolder = 1, // folder with sub-items
31  kndTreeBranch = 2, // tree brunch
32  kndTreeLeaf = 3, // tree leaf
33  kndGo4Param = 4, // go4 parameter
34  kndDataMember = 5, // object data member
35  kndEventElement = 6, // event object
36  kndMoreFolder = 7, // remote folder with potentially more items
37  kndRootCommand = 8 // command registered in ROOT http server
38  };
39 
40  virtual ~TGo4Access() {}
41 
43  virtual Bool_t IsRemote() const { return kFALSE; }
44 
46  virtual Bool_t CanGetObject() const { return kFALSE; }
47 
48  virtual Bool_t GetObject(TObject* &obj, Bool_t &owner) const;
49  virtual TClass* GetObjectClass() const;
50  virtual const char* GetObjectName() const;
51  virtual const char* GetObjectClassName() const;
52 
57  virtual Int_t AssignObjectTo(TGo4ObjectManager* rcv, const char* path);
58 
61  Int_t AssignObjectToSlot(TGo4Slot* slot);
62 
63  protected:
65  const char* path,
66  TObject* obj,
67  Bool_t owner);
68 };
69 
70 // ************************************************************
71 
72 class TGo4LevelIter : public TObject {
73  public:
74  TGo4LevelIter() : TObject() {}
75  virtual ~TGo4LevelIter() {}
76 
77  virtual Bool_t next() { return kFALSE; }
78  virtual Bool_t isfolder() { return kFALSE; }
79  virtual Bool_t isslotsfolder() { return kFALSE; }
80  virtual Int_t getflag(const char*) { return -1; }
81  virtual TGo4LevelIter* subiterator() { return 0; }
82  virtual TGo4Slot* getslot() { return 0; }
83  virtual const char* name() { return 0; }
84  virtual const char* info() { return 0; }
85  virtual Int_t sizeinfo() { return 0; }
86 
87  virtual Int_t GetKind() { return -1; }
88  virtual const char* GetClassName() { return 0; }
89 };
90 
91 // *************************************************************
92 
93 class TGo4Proxy : public TObject {
94  public:
95  TGo4Proxy() : TObject() {}
96  virtual ~TGo4Proxy() {}
97 
98  virtual void Initialize(TGo4Slot* slot) {}
99  virtual void Finalize(TGo4Slot* slot) {}
100  virtual Bool_t RemoveRegisteredObject(TObject* obj) { return kFALSE; }
101 
102  virtual Bool_t Use() const { return kTRUE; }
103 
104  virtual Bool_t HasSublevels() const { return kFALSE; }
105  virtual TGo4Access* ProvideAccess(const char*) { return 0; }
106  virtual TGo4LevelIter* MakeIter() { return 0; }
107 
108  virtual Int_t GetObjectKind() { return TGo4Access::kndNone; }
109  virtual const char* GetContainedClassName() { return 0; }
110  virtual const char* GetContainedObjectInfo() { return 0; }
111  virtual Int_t GetObjectSizeInfo() { return -1; }
112 
113  virtual void WriteData(TGo4Slot* slot, TDirectory* dir, Bool_t onlyobjs) {}
114  virtual void ReadData(TGo4Slot* slot, TDirectory* dir) {}
115 
116  virtual Bool_t IsAcceptObject(TClass* cl) { return kFALSE; }
117  virtual Bool_t AssignObject(TGo4Slot* slot, TObject* obj, Bool_t owner) { return kFALSE; }
118  virtual TObject* GetAssignedObject() { return 0; }
119  virtual void Update(TGo4Slot* slot, Bool_t strong) {}
120 
121  virtual Bool_t ProcessEvent(TGo4Slot* slot, TGo4Slot* source, Int_t id, void* param) { return kTRUE; }
122 
123  static TClass* GetClass(const char* classname, Bool_t load = kFALSE);
124 
125  ClassDef(TGo4Proxy, 1);
126 };
127 
128 
129 #endif
virtual const char * GetClassName()
Definition: TGo4Proxy.h:88
virtual Int_t sizeinfo()
Definition: TGo4Proxy.h:85
static TClass * GetClass(const char *classname, Bool_t load=kFALSE)
Definition: TGo4Proxy.cxx:75
virtual void WriteData(TGo4Slot *slot, TDirectory *dir, Bool_t onlyobjs)
Definition: TGo4Proxy.h:113
virtual TGo4Access * ProvideAccess(const char *)
Definition: TGo4Proxy.h:105
TGo4Proxy()
Definition: TGo4Proxy.h:95
virtual const char * GetObjectName() const
Definition: TGo4Proxy.cxx:31
virtual Bool_t isslotsfolder()
Definition: TGo4Proxy.h:79
ClassDef(TGo4Proxy, 1)
virtual const char * GetContainedClassName()
Definition: TGo4Proxy.h:109
virtual TGo4LevelIter * MakeIter()
Definition: TGo4Proxy.h:106
virtual Bool_t RemoveRegisteredObject(TObject *obj)
Definition: TGo4Proxy.h:100
virtual Bool_t CanGetObject() const
Definition: TGo4Proxy.h:46
virtual Bool_t next()
Definition: TGo4Proxy.h:77
void DoObjectAssignement(TGo4ObjectManager *rcv, const char *path, TObject *obj, Bool_t owner)
Definition: TGo4Proxy.cxx:65
virtual Int_t getflag(const char *)
Definition: TGo4Proxy.h:80
virtual const char * name()
Definition: TGo4Proxy.h:83
virtual ~TGo4Proxy()
Definition: TGo4Proxy.h:96
virtual void Finalize(TGo4Slot *slot)
Definition: TGo4Proxy.h:99
virtual Bool_t HasSublevels() const
Definition: TGo4Proxy.h:104
virtual const char * GetContainedObjectInfo()
Definition: TGo4Proxy.h:110
virtual void Initialize(TGo4Slot *slot)
Definition: TGo4Proxy.h:98
virtual TClass * GetObjectClass() const
Definition: TGo4Proxy.cxx:36
virtual Bool_t IsAcceptObject(TClass *cl)
Definition: TGo4Proxy.h:116
virtual ~TGo4LevelIter()
Definition: TGo4Proxy.h:75
virtual Int_t GetObjectKind()
Definition: TGo4Proxy.h:108
virtual const char * GetObjectClassName() const
Definition: TGo4Proxy.cxx:41
virtual TGo4LevelIter * subiterator()
Definition: TGo4Proxy.h:81
virtual const char * info()
Definition: TGo4Proxy.h:84
virtual void ReadData(TGo4Slot *slot, TDirectory *dir)
Definition: TGo4Proxy.h:114
virtual Int_t GetKind()
Definition: TGo4Proxy.h:87
virtual Bool_t isfolder()
Definition: TGo4Proxy.h:78
virtual Int_t AssignObjectTo(TGo4ObjectManager *rcv, const char *path)
Definition: TGo4Proxy.cxx:46
virtual Bool_t AssignObject(TGo4Slot *slot, TObject *obj, Bool_t owner)
Definition: TGo4Proxy.h:117
virtual TGo4Slot * getslot()
Definition: TGo4Proxy.h:82
virtual TObject * GetAssignedObject()
Definition: TGo4Proxy.h:118
virtual void Update(TGo4Slot *slot, Bool_t strong)
Definition: TGo4Proxy.h:119
virtual ~TGo4Access()
Definition: TGo4Proxy.h:40
Int_t AssignObjectToSlot(TGo4Slot *slot)
Definition: TGo4Proxy.cxx:56
virtual Int_t GetObjectSizeInfo()
Definition: TGo4Proxy.h:111
virtual Bool_t Use() const
Definition: TGo4Proxy.h:102
virtual Bool_t IsRemote() const
Definition: TGo4Proxy.h:43
virtual Bool_t GetObject(TObject *&obj, Bool_t &owner) const
Definition: TGo4Proxy.cxx:23
virtual Bool_t ProcessEvent(TGo4Slot *slot, TGo4Slot *source, Int_t id, void *param)
Definition: TGo4Proxy.h:121