Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/meta:$Id$
0002 // Author: Fons Rademakers   20/06/96
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 
0013 #ifndef ROOT_TDictionary
0014 #define ROOT_TDictionary
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TDictionary                                                          //
0019 //                                                                      //
0020 // This class defines an abstract interface that must be implemented    //
0021 // by all classes that contain dictionary information.                  //
0022 //                                                                      //
0023 // The dictionary is defined by the followling classes:                 //
0024 // TDataType                              (typedef definitions)         //
0025 // TGlobal                                (global variables)            //
0026 // TFunction                              (global functions)            //
0027 // TClass                                 (classes)                     //
0028 //    TBaseClass                          (base classes)                //
0029 //    TDataMember                         (class datamembers)           //
0030 //    TMethod                             (class methods)               //
0031 //       TMethodArg                       (method arguments)            //
0032 //                                                                      //
0033 // All the above classes implement the TDictionary abstract interface   //
0034 // (note: the indentation shows aggregation not inheritance).           //
0035 // The ROOT dictionary system provides a very extensive RTTI            //
0036 // environment that facilitates a.o. object inspectors, object I/O,     //
0037 // ROOT Trees, etc. Most of the type information is provided by the     //
0038 // CINT C++ interpreter.                                                //
0039 //                                                                      //
0040 // TMethodCall                            (method call environment)     //
0041 //                                                                      //
0042 //////////////////////////////////////////////////////////////////////////
0043 
0044 #include "TNamed.h"
0045 
0046 #include "ESTLType.h"
0047 
0048 // The following are opaque type and are never really declared
0049 // The specific implementation of TInterpreter will cast the
0050 // value of pointer to this types to the correct type (possibly
0051 // distinct from these)
0052 class CallFunc_t;
0053 class ClassInfo_t;
0054 class BaseClassInfo_t;
0055 class DataMemberInfo_t;
0056 class FuncTempInfo_t;
0057 class MethodInfo_t;
0058 class MethodArgInfo_t;
0059 class MethodArgInfo_t;
0060 class TypeInfo_t;
0061 class TypedefInfo_t;
0062 class TDictAttributeMap;
0063 
0064 enum EProperty {
0065    kIsClass         = 0x00000001,
0066    kIsStruct        = 0x00000002,
0067    kIsUnion         = 0x00000004,
0068    kIsEnum          = 0x00000008,
0069    kIsTypedef       = 0x00000010,
0070    kIsFundamental   = 0x00000020,
0071    kIsAbstract      = 0x00000040,
0072    kIsVirtual       = 0x00000080,
0073    kIsPureVirtual   = 0x00000100,
0074    kIsUnionMember   = 0x00000100,
0075    kIsPublic        = 0x00000200,
0076    kIsProtected     = 0x00000400,
0077    kIsPrivate       = 0x00000800,
0078    kIsPointer       = 0x00001000,
0079    kIsArray         = 0x00002000,
0080    kIsStatic        = 0x00004000,
0081    kIsDefault       = 0x00008000,
0082    kIsReference     = 0x00010000,
0083    kIsDirectInherit = 0x00020000,
0084    kIsCCompiled     = 0x00040000,
0085    kIsCPPCompiled   = kIsCCompiled,
0086    kIsCompiled      = kIsCCompiled,
0087    kIsNotReacheable = 0x00080000,   // Indicate that the entity can not be used from the Global Namespace
0088    kIsConstant      = 0x00100000,
0089    kIsVirtualBase   = 0x00200000,
0090    kIsConstPointer  = 0x00400000,
0091    kIsScopedEnum    = 0x00800000,
0092    // 0x01000000 is available
0093    kIsConstexpr     = 0x02000000,
0094    kIsExplicit      = 0x04000000,
0095    kIsNamespace     = 0x08000000,
0096    kIsConstMethod   = 0x10000000,
0097    kIsUsing         = 0x20000000,
0098    kIsDefinedInStd  = 0x40000000
0099    // 0x80000000 is available
0100 };
0101 
0102 enum EFunctionProperty {
0103 /* The following are already defined
0104    in EProperty and 'could' be part of this enums */
0105 /*
0106    kIsAbstract      = 0x00000040,
0107    kIsVirtual       = 0x00000080,
0108    kIsPureVirtual   = 0x00000100,
0109    kIsPublic        = 0x00000200,
0110    kIsProtected     = 0x00000400,
0111    kIsPrivate       = 0x00000800,
0112    kIsStatic        = 0x00004000,
0113    kIsDefault       = 0x00008000,
0114    kIsConstexpr     = 0x02000000
0115    kIsExplicit      = 0x04000000,
0116    kIsConstMethod   = 0x10000000,
0117 */
0118 /* The following are already defined
0119    in EProperty and related to the type of the return value */
0120 /*
0121  kIsConstant      = 0x00100000,
0122  kIsPointer       = 0x00001000,
0123  kIsArray         = 0x00002000,
0124  kIsReference     = 0x00010000,
0125  kIsConstPointer  = 0x00400000,
0126 */
0127    kIsConstructor = 0x00000001,
0128    kIsConversion  = 0x00000002,
0129    kIsDestructor  = 0x00000004,
0130    kIsOperator    = 0x00000008,
0131    kIsInlined     = 0x00000010,
0132    kIsTemplateSpec= 0x00000020
0133 };
0134 
0135 enum EClassProperty {
0136    kClassIsValid         = 0x00000001,
0137    kClassHasExplicitCtor = 0x00000010,
0138    kClassHasImplicitCtor = 0x00000020,
0139    kClassHasCtor         = 0x00000030,
0140    kClassHasDefaultCtor  = 0x00000040,
0141    kClassHasAssignOpr    = 0x00000080,
0142    kClassHasExplicitDtor = 0x00000100,
0143    kClassHasImplicitDtor = 0x00000200,
0144    kClassHasDtor         = 0x00000300,
0145    kClassHasVirtual      = 0x00001000,
0146    kClassIsAbstract      = 0x00002000,
0147    kClassIsAggregate     = 0x00004000
0148 };
0149 
0150 enum ERefTypeValues {
0151    kParaNormal     = 0,     // not used
0152    kParaReference  = 1,
0153    kParaP2P        = 2,     // not used
0154    kParaP2P2P      = 3,     // not used
0155    kParaRef        = 100,
0156    kParaRefP2P     = 102,   // not used
0157    kParaRefP2P2P   = 103    // not used
0158 };
0159 
0160 namespace ROOT {
0161    enum EFunctionMatchMode {
0162       kExactMatch = 0,
0163       kConversionMatch = 1
0164    };
0165 }
0166 
0167 
0168 class TDictionary : public TNamed {
0169 
0170 private:
0171    TDictAttributeMap *fAttributeMap{nullptr};    //pointer to a class attribute map
0172    ULong64_t fUpdatingTransactionCount{0}; //!the Cling ID of the transaction that last updated the object
0173 
0174 protected:
0175    Bool_t              UpdateInterpreterStateMarker();
0176 
0177 public:
0178    TDictionary(): fAttributeMap(nullptr), fUpdatingTransactionCount(0) { }
0179    TDictionary(const char* name): TNamed(name, ""), fAttributeMap(nullptr), fUpdatingTransactionCount(0) { }
0180    TDictionary(const TDictionary& dict);
0181    virtual ~TDictionary();
0182 
0183    TDictionary& operator=(const TDictionary& other);
0184 
0185    void                CreateAttributeMap();
0186    TDictAttributeMap  *GetAttributeMap() const
0187    {
0188       //Get the TDictAttributeMap pointer to be able to add attribute
0189       //pairs key-value to the TClass.
0190 
0191       return fAttributeMap;
0192    }
0193    virtual Long_t      Property() const = 0;
0194    static TDictionary* GetDictionary(const char* name);
0195    static TDictionary* GetDictionary(const std::type_info &typeinfo);
0196 
0197    // Type of STL container (returned by IsSTLContainer).
0198    enum ESTLType {
0199       kNone              = ROOT::kNotSTL,
0200       kVector            = ROOT::kSTLvector,
0201       kList              = ROOT::kSTLlist,
0202       kForwardlist       = ROOT::kSTLforwardlist,
0203       kDeque             = ROOT::kSTLdeque,
0204       kMap               = ROOT::kSTLmap,
0205       kMultimap          = ROOT::kSTLmultimap,
0206       kSet               = ROOT::kSTLset,
0207       kMultiset          = ROOT::kSTLmultiset,
0208       kUnorderedSet      = ROOT::kSTLunorderedset,
0209       kUnorderedMultiset = ROOT::kSTLunorderedmultiset,
0210       kUnorderedMap      = ROOT::kSTLunorderedmap,
0211       kUnorderedMultimap = ROOT::kSTLunorderedmultimap,
0212       kBitset            = ROOT::kSTLbitset
0213    };
0214 
0215    /// Kinds of members to include in lists.
0216    enum class EMemberSelection {
0217       kNoUsingDecls,
0218       kOnlyUsingDecls,
0219       kAlsoUsingDecls
0220    };
0221    static bool WantsRegularMembers(EMemberSelection sel) { return sel != EMemberSelection::kOnlyUsingDecls; }
0222    static bool WantsUsingDecls(EMemberSelection sel) { return sel != EMemberSelection::kNoUsingDecls; }
0223 
0224    typedef const void *DeclId_t;
0225    ClassDefOverride(TDictionary,2)  //Interface to dictionary
0226 };
0227 
0228 #endif