Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TBaseClass.h
Go to the documentation of this file.
1 // @(#)root/meta:$Id$
2 // Author: Fons Rademakers 08/02/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TBaseClass
13 #define ROOT_TBaseClass
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TBaseClass //
19 // //
20 // Description of a base class. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 
25 #include "TDictionary.h"
26 #include "TClassRef.h"
27 
28 #include <atomic>
29 
30 class TBrowser;
31 class TClass;
32 
33 class TBaseClass : public TDictionary {
34 #ifndef __CLING__
35  using AtomicInt_t = std::atomic<Int_t>;
36  static_assert(sizeof(std::atomic<Int_t>) == sizeof(Int_t),
37  "We requiqre atomic<int> and <int> to have the same size but they are not");
38 #else
39  // std::atomic is not yet supported in the I/O, so
40  // we hide them from Cling
41  using AtomicInt_t = Int_t;
42 #endif
43 
44 private:
45  TBaseClass(const TBaseClass &); // Not implemented
46  TBaseClass&operator=(const TBaseClass&); // Not implemented
47 
48 private:
49  BaseClassInfo_t *fInfo; //!pointer to CINT base class info
50  TClassRef fClassPtr; // pointer to the base class TClass
51  TClass *fClass; //!pointer to parent class
52  AtomicInt_t fDelta; // BaseClassInfo_t offset (INT_MAX if unset)
53  mutable AtomicInt_t fProperty; // BaseClassInfo_t's properties
54  Int_t fSTLType; // cache of IsSTLContainer()
55 
56 public:
57  TBaseClass(BaseClassInfo_t *info = 0, TClass *cl = 0);
58  virtual ~TBaseClass();
59  virtual void Browse(TBrowser *b);
60  const char *GetTitle() const;
61  TClass *GetClassPointer(Bool_t load=kTRUE);
62  Int_t GetDelta();
63  Bool_t IsFolder() const {return kTRUE;}
64  ROOT::ESTLType IsSTLContainer();
65  Long_t Property() const;
66  void SetClass(TClass* cl) { fClass = cl; }
67 
68  ClassDef(TBaseClass,2) //Description of a base class
69 };
70 
71 #endif