GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4AccessWrapper.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 TGO4ACCESSWRAPPER_H
15 #define TGO4ACCESSWRAPPER_H
16 
17 #include "TGo4Proxy.h"
18 
20  public:
22  virtual ~TGo4AccessWrapper() {}
23 
24  TObject *GetObject(const char *name = nullptr)
25  {
26  auto proxy = ProvideAccess(name);
27  TObject *res = nullptr;
28  Bool_t owner = kFALSE;
29  if (proxy) proxy->GetObject(res, owner);
30  return res;
31  }
32 
33  TClass *GetObjectClass(const char *name = nullptr)
34  {
35  auto proxy = ProvideAccess(name);
36  TClass *res = proxy ? proxy->GetObjectClass() : nullptr;
37  return res;
38  }
39 
40  const char *GetObjectClassName(const char *name = nullptr)
41  {
42  auto proxy = ProvideAccess(name);
43  const char *res = proxy ? proxy->GetObjectClassName() : nullptr;
44  return res;
45  }
46 
47  virtual std::unique_ptr<TGo4Access> ProvideAccess(const char *name = nullptr) { return nullptr; }
48 
50 };
51 
52 #endif
ClassDef(TGo4AccessWrapper, 1)
virtual ~TGo4AccessWrapper()
virtual std::unique_ptr< TGo4Access > ProvideAccess(const char *name=nullptr)
TClass * GetObjectClass(const char *name=nullptr)
TObject * GetObject(const char *name=nullptr)
const char * GetObjectClassName(const char *name=nullptr)