GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4DirProxy.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 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{nullptr};
25  Bool_t fOwner{kFALSE};
26  Bool_t fReadRight{kFALSE};
27  TGo4Slot *fxParentSlot{nullptr};
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  void Initialize(TGo4Slot *slot) override { fxParentSlot = slot; }
38  void Finalize(TGo4Slot *slot) override {}
39 
40  Bool_t HasSublevels() const override { return fDir; }
41 
42  TGo4LevelIter *MakeIter() override
43  { return fDir ? ProduceIter(fDir, fReadRight) : nullptr; }
44 
45  std::unique_ptr<TGo4Access> ProvideAccess(const char *name) override
46  { return CreateAccess(fDir, fReadRight, name, fxParentSlot); }
47 
48  void WriteData(TGo4Slot *slot, TDirectory *dir, Bool_t onlyobjs) override;
49  void ReadData(TGo4Slot *slot, TDirectory *dir) override;
50 
51  Int_t GetObjectKind() const override;
52  const char *GetContainedClassName() const override;
53  const char *GetContainedObjectInfo() override;
54  Int_t GetObjectSizeInfo() const override;
55 
56  static std::unique_ptr<TGo4Access> CreateAccess(TDirectory *dir, Bool_t readright, const char *name, TGo4Slot *browser_slot = nullptr);
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
TGo4LevelIter * MakeIter() override
Definition: TGo4DirProxy.h:42
ClassDefOverride(TGo4DirProxy, 1)
std::unique_ptr< TGo4Access > ProvideAccess(const char *name) override
Definition: TGo4DirProxy.h:45
Bool_t IsFile() const
Bool_t fReadRight
Definition: TGo4DirProxy.h:26
const char * GetContainedObjectInfo() override
Int_t GetObjectKind() const override
const char * GetFileName() const
void Initialize(TGo4Slot *slot) override
Definition: TGo4DirProxy.h:37
TGo4Slot * fxParentSlot
Definition: TGo4DirProxy.h:27
static TGo4LevelIter * ProduceIter(TDirectory *dir, Bool_t readright)
const char * GetContainedClassName() const override
virtual ~TGo4DirProxy()
TDirectory * fDir
Definition: TGo4DirProxy.h:24
Bool_t UpdateObjectInFile(const char *filepath, TObject *obj)
Bool_t fOwner
Definition: TGo4DirProxy.h:25
void WriteData(TGo4Slot *slot, TDirectory *dir, Bool_t onlyobjs) override
void Finalize(TGo4Slot *slot) override
Definition: TGo4DirProxy.h:38
Bool_t HasSublevels() const override
Definition: TGo4DirProxy.h:40
void SetDir(TDirectory *dir, Bool_t readright, Bool_t owner)
void ReadData(TGo4Slot *slot, TDirectory *dir) override
Int_t GetObjectSizeInfo() const override
static std::unique_ptr< TGo4Access > CreateAccess(TDirectory *dir, Bool_t readright, const char *name, TGo4Slot *browser_slot=nullptr)