Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:31

0001 // @(#)root/meta:$Id$
0002 // Author: Fons Rademakers   08/02/95
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TBaseClass
0013 #define ROOT_TBaseClass
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TBaseClass                                                           //
0019 //                                                                      //
0020 // Description of a base class.                                         //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 
0025 #include "TDictionary.h"
0026 #include "TClassRef.h"
0027 
0028 #include <atomic>
0029 
0030 class TBrowser;
0031 class TClass;
0032 
0033 class TBaseClass : public TDictionary {
0034 #ifndef __CLING__
0035    using AtomicInt_t = std::atomic<Int_t>;
0036    static_assert(sizeof(std::atomic<Int_t>) == sizeof(Int_t),
0037                  "We requiqre atomic<int> and <int> to have the same size but they are not");
0038 #else
0039    // std::atomic is not yet supported in the I/O, so
0040    // we hide them from Cling
0041    using AtomicInt_t = Int_t;
0042 #endif
0043 
0044 private:
0045    TBaseClass(const TBaseClass &) = delete;
0046    TBaseClass&operator=(const TBaseClass &) = delete;
0047 
0048 private:
0049    BaseClassInfo_t    *fInfo;      //!pointer to CINT base class info
0050    TClassRef           fClassPtr;  // pointer to the base class TClass
0051    TClass             *fClass;     //!pointer to parent class
0052    AtomicInt_t         fDelta;     // BaseClassInfo_t offset (INT_MAX if unset)
0053    mutable AtomicInt_t fProperty;  // BaseClassInfo_t's properties
0054    Int_t               fSTLType;   // cache of IsSTLContainer()
0055 
0056 public:
0057    TBaseClass(BaseClassInfo_t *info = nullptr, TClass *cl = nullptr);
0058    virtual ~TBaseClass();
0059 
0060    void           Browse(TBrowser *b) override;
0061    const char    *GetTitle() const override;
0062    TClass        *GetClassPointer(Bool_t load=kTRUE);
0063    Int_t          GetDelta();
0064    Bool_t         IsFolder() const override {return kTRUE;}
0065    ROOT::ESTLType IsSTLContainer();
0066    Long_t         Property() const override;
0067    void           SetClass(TClass* cl) { fClass = cl; }
0068 
0069    ClassDefOverride(TBaseClass,2)  //Description of a base class
0070 };
0071 
0072 #endif