GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4DirProxy.h
Go to the documentation of this file.
1 // $Id: TGo4DirProxy.h 2627 2019-10-01 08:02:45Z 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 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 TGO4DIRPROXY_H
15 #define TGO4DIRPROXY_H
16 
17 #include "TGo4Proxy.h"
18 
19 class TFile;
20 class TDirectory;
21 
22 class TGo4DirProxy : public TGo4Proxy {
23  protected:
24  TDirectory* fDir;
25  Bool_t fOwner;
26  Bool_t fReadRight;
28 
29  void SetDir(TDirectory* dir, Bool_t readright, Bool_t owner);
30  void ClearDir();
31 
32  public:
33  TGo4DirProxy();
34  TGo4DirProxy(TDirectory* dir, Bool_t readright, Bool_t owner);
35  virtual ~TGo4DirProxy();
36 
37  virtual void Initialize(TGo4Slot* slot) { fxParentSlot = slot; }
38  virtual void Finalize(TGo4Slot* slot) {}
39 
40  virtual Bool_t HasSublevels() const { return fDir!=0; }
41 
43  { return (fDir==0) ? 0 : ProduceIter(fDir, fReadRight); }
44 
45  virtual TGo4Access* ProvideAccess(const char* name)
46  { return CreateAccess(fDir, fReadRight, name, fxParentSlot); }
47 
48  virtual void WriteData(TGo4Slot* slot, TDirectory* dir, Bool_t onlyobjs);
49  virtual void ReadData(TGo4Slot* slot, TDirectory* dir);
50 
51  virtual Int_t GetObjectKind();
52  virtual const char* GetContainedClassName();
53  virtual const char* GetContainedObjectInfo();
54  virtual Int_t GetObjectSizeInfo();
55 
56  static TGo4Access* CreateAccess(TDirectory* dir, Bool_t readright, const char* name, TGo4Slot* browser_slot = 0);
57  static TGo4LevelIter* ProduceIter(TDirectory* dir, Bool_t readright);
58 
59  Bool_t UpdateObjectInFile(const char* filepath, TObject* obj);
60 
61  Bool_t IsFile() const;
62  const char* GetFileName() const;
63 
65 };
66 
67 #endif
virtual void Initialize(TGo4Slot *slot)
Definition: TGo4DirProxy.h:37
virtual Int_t GetObjectSizeInfo()
Bool_t fReadRight
Definition: TGo4DirProxy.h:26
virtual void ReadData(TGo4Slot *slot, TDirectory *dir)
Bool_t IsFile() const
virtual void Finalize(TGo4Slot *slot)
Definition: TGo4DirProxy.h:38
virtual const char * GetContainedClassName()
virtual TGo4LevelIter * MakeIter()
Definition: TGo4DirProxy.h:42
TGo4Slot * fxParentSlot
Definition: TGo4DirProxy.h:27
static TGo4LevelIter * ProduceIter(TDirectory *dir, Bool_t readright)
virtual Int_t GetObjectKind()
virtual ~TGo4DirProxy()
TDirectory * fDir
Definition: TGo4DirProxy.h:24
ClassDef(TGo4DirProxy, 1)
Bool_t UpdateObjectInFile(const char *filepath, TObject *obj)
const char * GetFileName() const
Bool_t fOwner
Definition: TGo4DirProxy.h:25
virtual Bool_t HasSublevels() const
Definition: TGo4DirProxy.h:40
void SetDir(TDirectory *dir, Bool_t readright, Bool_t owner)
virtual TGo4Access * ProvideAccess(const char *name)
Definition: TGo4DirProxy.h:45
virtual const char * GetContainedObjectInfo()
virtual void WriteData(TGo4Slot *slot, TDirectory *dir, Bool_t onlyobjs)
static TGo4Access * CreateAccess(TDirectory *dir, Bool_t readright, const char *name, TGo4Slot *browser_slot=0)