Logo ROOT   6.12/07
Reference Guide
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;
62  Int_t GetDelta();
63  Bool_t IsFolder() const {return kTRUE;}
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
std::atomic< Int_t > AtomicInt_t
Definition: TBaseClass.h:35
ESTLType
Definition: ESTLType.h:28
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
Definition: TBaseClass.cxx:63
void SetClass(TClass *cl)
Definition: TBaseClass.h:66
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:320
Int_t GetDelta()
Get offset from "this" to part of base class.
Definition: TBaseClass.cxx:75
TClassRef fClassPtr
pointer to CINT base class info
Definition: TBaseClass.h:50
AtomicInt_t fProperty
Definition: TBaseClass.h:53
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
TClass * fClass
Definition: TBaseClass.h:51
This class defines an abstract interface that must be implemented by all classes that contain diction...
Definition: TDictionary.h:158
const char * GetTitle() const
Get base class description (comment).
Definition: TBaseClass.cxx:92
TBaseClass & operator=(const TBaseClass &)
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:75
AtomicInt_t fDelta
pointer to parent class
Definition: TBaseClass.h:52
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TBaseClass.h:63
TBaseClass(const TBaseClass &)
Each class (see TClass) has a linked list of its base class(es).
Definition: TBaseClass.h:33
long Long_t
Definition: RtypesCore.h:50
BaseClassInfo_t * fInfo
Definition: TBaseClass.h:49
virtual ~TBaseClass()
TBaseClass dtor deletes adopted CINT BaseClassInfo object.
Definition: TBaseClass.cxx:46
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
Definition: TBaseClass.cxx:134
TClassRef is used to implement a permanent reference to a TClass object.
Definition: TClassRef.h:29
ROOT::ESTLType IsSTLContainer()
Return which type (if any) of STL container the data member is.
Definition: TBaseClass.cxx:101
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
const Bool_t kTRUE
Definition: RtypesCore.h:87
virtual void Browse(TBrowser *b)
Called by the browser, to browse a baseclass.
Definition: TBaseClass.cxx:54
Int_t fSTLType
Definition: TBaseClass.h:54