Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TDictionary.h
Go to the documentation of this file.
1 // @(#)root/meta:$Id$
2 // Author: Fons Rademakers 20/06/96
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 
13 #ifndef ROOT_TDictionary
14 #define ROOT_TDictionary
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TDictionary //
19 // //
20 // This class defines an abstract interface that must be implemented //
21 // by all classes that contain dictionary information. //
22 // //
23 // The dictionary is defined by the followling classes: //
24 // TDataType (typedef definitions) //
25 // TGlobal (global variables) //
26 // TFunction (global functions) //
27 // TClass (classes) //
28 // TBaseClass (base classes) //
29 // TDataMember (class datamembers) //
30 // TMethod (class methods) //
31 // TMethodArg (method arguments) //
32 // //
33 // All the above classes implement the TDictionary abstract interface //
34 // (note: the indentation shows aggregation not inheritance). //
35 // The ROOT dictionary system provides a very extensive RTTI //
36 // environment that facilitates a.o. object inspectors, object I/O, //
37 // ROOT Trees, etc. Most of the type information is provided by the //
38 // CINT C++ interpreter. //
39 // //
40 // TMethodCall (method call environment) //
41 // //
42 //////////////////////////////////////////////////////////////////////////
43 
44 #include "TNamed.h"
45 
46 #include "ESTLType.h"
47 
48 // The following are opaque type and are never really declared
49 // The specific implementation of TInterpreter will cast the
50 // value of pointer to this types to the correct type (possibly
51 // distinct from these)
52 class CallFunc_t;
53 class ClassInfo_t;
54 class BaseClassInfo_t;
55 class DataMemberInfo_t;
56 class FuncTempInfo_t;
57 class MethodInfo_t;
58 class MethodArgInfo_t;
59 class MethodArgInfo_t;
60 class TypeInfo_t;
61 class TypedefInfo_t;
62 class TDictAttributeMap;
63 
64 enum EProperty {
65  kIsClass = 0x00000001,
66  kIsStruct = 0x00000002,
67  kIsUnion = 0x00000004,
68  kIsEnum = 0x00000008,
69  kIsTypedef = 0x00000010,
70  kIsFundamental = 0x00000020,
71  kIsAbstract = 0x00000040,
72  kIsVirtual = 0x00000080,
73  kIsPureVirtual = 0x00000100,
74  kIsPublic = 0x00000200,
75  kIsProtected = 0x00000400,
76  kIsPrivate = 0x00000800,
77  kIsPointer = 0x00001000,
78  kIsArray = 0x00002000,
79  kIsStatic = 0x00004000,
80  kIsDefault = 0x00008000,
81  kIsReference = 0x00010000,
82  kIsDirectInherit = 0x00020000,
83  kIsCCompiled = 0x00040000,
84  kIsCPPCompiled = kIsCCompiled,
85  kIsCompiled = kIsCCompiled,
86  kIsConstant = 0x00100000,
87  kIsVirtualBase = 0x00200000,
88  kIsConstPointer = 0x00400000,
89  kIsScopedEnum = 0x00800000,
90  kIsConstexpr = 0x02000000,
91  kIsExplicit = 0x04000000,
92  kIsNamespace = 0x08000000,
93  kIsConstMethod = 0x10000000,
94  kIsUsingVariable = 0x20000000,
95  kIsDefinedInStd = 0x40000000
96 };
97 
98 enum EFunctionProperty {
99 /* The following are already defined
100  in EProperty and 'could' be part of this enums */
101 /*
102  kIsAbstract = 0x00000040,
103  kIsVirtual = 0x00000080,
104  kIsPureVirtual = 0x00000100,
105  kIsPublic = 0x00000200,
106  kIsProtected = 0x00000400,
107  kIsPrivate = 0x00000800,
108  kIsStatic = 0x00004000,
109  kIsDefault = 0x00008000,
110  kIsConstexpr = 0x02000000
111  kIsExplicit = 0x04000000,
112  kIsConstMethod = 0x10000000,
113 */
114 /* The following are already defined
115  in EProperty and related to the type of the return value */
116 /*
117  kIsConstant = 0x00100000,
118  kIsPointer = 0x00001000,
119  kIsArray = 0x00002000,
120  kIsReference = 0x00010000,
121  kIsConstPointer = 0x00400000,
122 */
123  kIsConstructor = 0x00000001,
124  kIsConversion = 0x00000002,
125  kIsDestructor = 0x00000004,
126  kIsOperator = 0x00000008,
127  kIsInlined = 0x00000010
128 };
129 
130 enum EClassProperty {
131  kClassIsValid = 0x00000001,
132  kClassHasExplicitCtor = 0x00000010,
133  kClassHasImplicitCtor = 0x00000020,
134  kClassHasCtor = 0x00000030,
135  kClassHasDefaultCtor = 0x00000040,
136  kClassHasAssignOpr = 0x00000080,
137  kClassHasExplicitDtor = 0x00000100,
138  kClassHasImplicitDtor = 0x00000200,
139  kClassHasDtor = 0x00000300,
140  kClassHasVirtual = 0x00001000,
141  kClassIsAbstract = 0x00002000
142 };
143 
144 enum ERefTypeValues {
145  kParaNormal = 0, // not used
146  kParaReference = 1,
147  kParaP2P = 2, // not used
148  kParaP2P2P = 3, // not used
149  kParaRef = 100,
150  kParaRefP2P = 102, // not used
151  kParaRefP2P2P = 103 // not used
152 };
153 
154 namespace ROOT {
155  enum EFunctionMatchMode {
156  kExactMatch = 0,
157  kConversionMatch = 1
158  };
159 }
160 
161 
162 class TDictionary : public TNamed {
163 
164 private:
165  TDictAttributeMap *fAttributeMap; //pointer to a class attribute map
166  ULong64_t fUpdatingTransactionCount; //!the Cling ID of the transaction that last updated the object
167 
168 protected:
169  Bool_t UpdateInterpreterStateMarker();
170 
171 public:
172  TDictionary(): fAttributeMap(0), fUpdatingTransactionCount(0) { }
173  TDictionary(const char* name): TNamed(name, ""), fAttributeMap(0), fUpdatingTransactionCount(0) { }
174  TDictionary(const TDictionary& dict);
175  virtual ~TDictionary();
176 
177  TDictionary& operator=(const TDictionary& other);
178 
179  void CreateAttributeMap();
180  TDictAttributeMap *GetAttributeMap() const
181  {
182  //Get the TDictAttributeMap pointer to be able to add attribute
183  //pairs key-value to the TClass.
184 
185  return fAttributeMap;
186  }
187  virtual Long_t Property() const = 0;
188  static TDictionary* GetDictionary(const char* name);
189  static TDictionary* GetDictionary(const std::type_info &typeinfo);
190 
191  // Type of STL container (returned by IsSTLContainer).
192  enum ESTLType {
193  kNone = ROOT::kNotSTL,
194  kVector = ROOT::kSTLvector,
195  kList = ROOT::kSTLlist,
196  kForwardlist = ROOT::kSTLforwardlist,
197  kDeque = ROOT::kSTLdeque,
198  kMap = ROOT::kSTLmap,
199  kMultimap = ROOT::kSTLmultimap,
200  kSet = ROOT::kSTLset,
201  kMultiset = ROOT::kSTLmultiset,
202  kUnorderedSet = ROOT::kSTLunorderedset,
203  kUnorderedMultiset = ROOT::kSTLunorderedmultiset,
204  kUnorderedMap = ROOT::kSTLunorderedmap,
205  kUnorderedMultimap = ROOT::kSTLunorderedmultimap,
206  kBitset = ROOT::kSTLbitset
207  };
208 
209  typedef const void *DeclId_t;
210  ClassDef(TDictionary,2) //Interface to dictionary
211 };
212 
213 #endif