GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4Proxy.h
Go to the documentation of this file.
1// $Id$
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 fuer 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#include <memory>
19#include "RVersion.h"
20
21#if ROOT_VERSION_CODE < ROOT_VERSION(6,26,0)
22#include "ROOT/RMakeUnique.hxx"
23#endif
24
25class TGo4Slot;
26class TDirectory;
28
29//*********************************************************
30
32 public:
33 enum {
34 kndNone = -1,
35 kndObject = 0, // normal object
36 kndFolder = 1, // folder with sub-items
37 kndTreeBranch = 2, // tree brunch
38 kndTreeLeaf = 3, // tree leaf
39 kndGo4Param = 4, // go4 parameter
40 kndDataMember = 5, // object data member
41 kndEventElement = 6, // event object
42 kndMoreFolder = 7, // remote folder with potentially more items
43 kndRootCommand = 8 // command registered in ROOT http server
44 };
45
46 virtual ~TGo4Access() {}
47
49 virtual Bool_t IsRemote() const { return kFALSE; }
50
52 virtual Bool_t CanGetObject() const { return kFALSE; }
53
54 virtual Bool_t GetObject(TObject *&obj, Bool_t &owner) const;
55 virtual TClass *GetObjectClass() const;
56 virtual const char *GetObjectName() const;
57 virtual const char *GetObjectClassName() const;
58
63 virtual Int_t AssignObjectTo(TGo4ObjectManager *rcv, const char *path);
64
67 Int_t AssignObjectToSlot(TGo4Slot *slot);
68
69 protected:
71 const char *path,
72 TObject *obj,
73 Bool_t owner);
74};
75
76// ************************************************************
77
78class TGo4LevelIter : public TObject {
79 public:
80 TGo4LevelIter() : TObject() {}
81 virtual ~TGo4LevelIter() {}
82
83 virtual Bool_t next() { return kFALSE; }
84 virtual Bool_t isfolder() { return kFALSE; }
85 virtual Bool_t isslotsfolder() { return kFALSE; }
86 virtual Int_t getflag(const char *) { return -1; }
87 virtual TGo4LevelIter *subiterator() { return nullptr; }
88 virtual TGo4Slot *getslot() { return nullptr; }
89 virtual const char *name() { return nullptr; }
90 virtual const char *info() { return nullptr; }
91 virtual Int_t sizeinfo() { return 0; }
92
93 virtual Int_t GetKind() { return -1; }
94 virtual const char *GetClassName() { return nullptr; }
95};
96
97// *************************************************************
98
99class TGo4Proxy : public TObject {
100 public:
101 TGo4Proxy() : TObject() {}
102 virtual ~TGo4Proxy() {}
103
104 virtual void Initialize(TGo4Slot *) {}
105 virtual void Finalize(TGo4Slot *) {}
106 virtual Bool_t RemoveRegisteredObject(TObject *) { return kFALSE; }
107
108 virtual Bool_t Use() const { return kTRUE; }
109
110 virtual Bool_t HasSublevels() const { return kFALSE; }
111 virtual std::unique_ptr<TGo4Access> ProvideAccess(const char *) { return nullptr; }
112 virtual TGo4LevelIter *MakeIter() { return nullptr; }
113
114 virtual Int_t GetObjectKind() const { return TGo4Access::kndNone; }
115 virtual const char *GetContainedClassName() const { return nullptr; }
116 virtual const char *GetContainedObjectInfo() { return nullptr; }
117 virtual Int_t GetObjectSizeInfo() const { return -1; }
118
119 virtual void WriteData(TGo4Slot *, TDirectory *, Bool_t) {}
120 virtual void ReadData(TGo4Slot *, TDirectory *) {}
121
122 virtual Bool_t IsAcceptObject(TClass *) const { return kFALSE; }
123 virtual Bool_t AssignObject(TGo4Slot *, TObject *, Bool_t) { return kFALSE; }
124 virtual TObject *GetAssignedObject() { return nullptr; }
125 virtual void Update(TGo4Slot *, Bool_t) {}
126
127 virtual Bool_t ProcessEvent(TGo4Slot *slot, TGo4Slot *source, Int_t id, void *param) { return kTRUE; }
128
129 static TClass *GetClass(const char *classname, Bool_t load = kFALSE);
130
132};
133
134#endif
virtual Bool_t GetObject(TObject *&obj, Bool_t &owner) const
Definition TGo4Proxy.cxx:21
virtual Int_t AssignObjectTo(TGo4ObjectManager *rcv, const char *path)
Have to assign object to provided receiver.
Definition TGo4Proxy.cxx:44
void DoObjectAssignement(TGo4ObjectManager *rcv, const char *path, TObject *obj, Bool_t owner)
Definition TGo4Proxy.cxx:63
virtual Bool_t IsRemote() const
Indicate if object is remote.
Definition TGo4Proxy.h:49
virtual Bool_t CanGetObject() const
Returns kTRUE, when object can be directly obtained with GetObject() method.
Definition TGo4Proxy.h:52
@ kndRootCommand
Definition TGo4Proxy.h:43
@ kndTreeBranch
Definition TGo4Proxy.h:37
@ kndEventElement
Definition TGo4Proxy.h:41
@ kndMoreFolder
Definition TGo4Proxy.h:42
@ kndDataMember
Definition TGo4Proxy.h:40
virtual ~TGo4Access()
Definition TGo4Proxy.h:46
virtual const char * GetObjectName() const
Definition TGo4Proxy.cxx:29
Int_t AssignObjectToSlot(TGo4Slot *slot)
Made for convenience - extracts OM and slot path and calls AssignObjectTo method.
Definition TGo4Proxy.cxx:54
virtual const char * GetObjectClassName() const
Definition TGo4Proxy.cxx:39
virtual TClass * GetObjectClass() const
Definition TGo4Proxy.cxx:34
virtual TGo4LevelIter * subiterator()
Definition TGo4Proxy.h:87
virtual Bool_t isslotsfolder()
Definition TGo4Proxy.h:85
virtual const char * GetClassName()
Definition TGo4Proxy.h:94
virtual Int_t getflag(const char *)
Definition TGo4Proxy.h:86
virtual TGo4Slot * getslot()
Definition TGo4Proxy.h:88
virtual ~TGo4LevelIter()
Definition TGo4Proxy.h:81
virtual Int_t sizeinfo()
Definition TGo4Proxy.h:91
virtual const char * info()
Definition TGo4Proxy.h:90
virtual Bool_t next()
Definition TGo4Proxy.h:83
virtual Bool_t isfolder()
Definition TGo4Proxy.h:84
virtual Int_t GetKind()
Definition TGo4Proxy.h:93
virtual const char * name()
Definition TGo4Proxy.h:89
virtual Bool_t ProcessEvent(TGo4Slot *slot, TGo4Slot *source, Int_t id, void *param)
Definition TGo4Proxy.h:127
virtual void ReadData(TGo4Slot *, TDirectory *)
Definition TGo4Proxy.h:120
virtual std::unique_ptr< TGo4Access > ProvideAccess(const char *)
Definition TGo4Proxy.h:111
virtual const char * GetContainedObjectInfo()
Definition TGo4Proxy.h:116
virtual Int_t GetObjectKind() const
Definition TGo4Proxy.h:114
virtual void WriteData(TGo4Slot *, TDirectory *, Bool_t)
Definition TGo4Proxy.h:119
virtual TGo4LevelIter * MakeIter()
Definition TGo4Proxy.h:112
virtual const char * GetContainedClassName() const
Definition TGo4Proxy.h:115
virtual Bool_t IsAcceptObject(TClass *) const
Definition TGo4Proxy.h:122
virtual Bool_t RemoveRegisteredObject(TObject *)
Definition TGo4Proxy.h:106
virtual void Initialize(TGo4Slot *)
Definition TGo4Proxy.h:104
ClassDefOverride(TGo4Proxy, 0)
virtual ~TGo4Proxy()
Definition TGo4Proxy.h:102
virtual Bool_t AssignObject(TGo4Slot *, TObject *, Bool_t)
Definition TGo4Proxy.h:123
virtual TObject * GetAssignedObject()
Definition TGo4Proxy.h:124
virtual Bool_t HasSublevels() const
Definition TGo4Proxy.h:110
virtual void Update(TGo4Slot *, Bool_t)
Definition TGo4Proxy.h:125
virtual Bool_t Use() const
Definition TGo4Proxy.h:108
static TClass * GetClass(const char *classname, Bool_t load=kFALSE)
Definition TGo4Proxy.cxx:73
virtual Int_t GetObjectSizeInfo() const
Definition TGo4Proxy.h:117
virtual void Finalize(TGo4Slot *)
Definition TGo4Proxy.h:105