Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
30class TBrowser;
31class TClass;
32
33class 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
44private:
45 TBaseClass(const TBaseClass &) = delete;
46 TBaseClass&operator=(const TBaseClass &) = delete;
47
48private:
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
56public:
57 TBaseClass(BaseClassInfo_t *info = nullptr, TClass *cl = nullptr);
58 virtual ~TBaseClass();
59 virtual void Browse(TBrowser *b);
60 const char *GetTitle() const;
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
#define b(i)
Definition RSha256.hxx:100
int Int_t
Definition RtypesCore.h:45
long Long_t
Definition RtypesCore.h:54
const Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassDef(name, id)
Definition Rtypes.h:325
Each class (see TClass) has a linked list of its base class(es).
Definition TBaseClass.h:33
Int_t GetDelta()
Get offset from "this" to part of base class.
ROOT::ESTLType IsSTLContainer()
Return which type (if any) of STL container the data member is.
const char * GetTitle() const
Get base class description (comment).
TBaseClass & operator=(const TBaseClass &)=delete
virtual ~TBaseClass()
TBaseClass dtor deletes adopted CINT BaseClassInfo object.
TBaseClass(const TBaseClass &)=delete
virtual void Browse(TBrowser *b)
Called by the browser, to browse a baseclass.
TClassRef fClassPtr
pointer to CINT base class info
Definition TBaseClass.h:50
AtomicInt_t fDelta
pointer to parent class
Definition TBaseClass.h:52
TClass * fClass
Definition TBaseClass.h:51
Int_t fSTLType
Definition TBaseClass.h:54
AtomicInt_t fProperty
Definition TBaseClass.h:53
void SetClass(TClass *cl)
Definition TBaseClass.h:66
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition TBaseClass.h:63
BaseClassInfo_t * fInfo
Definition TBaseClass.h:49
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
std::atomic< Int_t > AtomicInt_t
Definition TBaseClass.h:35
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
TClassRef is used to implement a permanent reference to a TClass object.
Definition TClassRef.h:28
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:80
This class defines an abstract interface that must be implemented by all classes that contain diction...
ESTLType
Definition ESTLType.h:28