Logo ROOT   6.10/09
Reference Guide
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 implemenation 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 = 0x00080000,
85  kIsCompiled = 0x000C0000,
86  kIsConstant = 0x00100000,
87  kIsVirtualBase = 0x00200000,
88  kIsConstPointer = 0x00400000,
89  kIsExplicit = 0x04000000,
90  kIsNamespace = 0x08000000,
91  kIsConstMethod = 0x10000000,
92  kIsUsingVariable = 0x20000000,
93  kIsDefinedInStd = 0x40000000
94 };
95 
97 /* The following are already defined
98  in EProperty and 'could' be part of this enums */
99 /*
100  kIsAbstract = 0x00000040,
101  kIsVirtual = 0x00000080,
102  kIsPureVirtual = 0x00000100,
103  kIsPublic = 0x00000200,
104  kIsProtected = 0x00000400,
105  kIsPrivate = 0x00000800,
106  kIsStatic = 0x00004000,
107  kIsDefault = 0x00008000,
108  kIsExplicit = 0x04000000,
109  kIsConstMethod = 0x10000000,
110 */
111 /* The following are already defined
112  in EProperty and related to the type of the return value */
113 /*
114  kIsConstant = 0x00100000,
115  kIsPointer = 0x00001000,
116  kIsArray = 0x00002000,
117  kIsReference = 0x00010000,
118  kIsConstPointer = 0x00400000,
119 */
120  kIsConstructor = 0x00000001,
121  kIsConversion = 0x00000002,
122  kIsDestructor = 0x00000004,
123  kIsOperator = 0x00000008
124 };
125 
127  kClassIsValid = 0x00000001,
128  kClassHasExplicitCtor = 0x00000010,
129  kClassHasImplicitCtor = 0x00000020,
130  kClassHasCtor = 0x00000030,
131  kClassHasDefaultCtor = 0x00000040,
132  kClassHasAssignOpr = 0x00000080,
133  kClassHasExplicitDtor = 0x00000100,
134  kClassHasImplicitDtor = 0x00000200,
135  kClassHasDtor = 0x00000300,
136  kClassHasVirtual = 0x00001000,
137  kClassIsAbstract = 0x00002000
138 };
139 
141  kParaNormal = 0, // not used
143  kParaP2P = 2, // not used
144  kParaP2P2P = 3, // not used
145  kParaRef = 100,
146  kParaRefP2P = 102, // not used
147  kParaRefP2P2P = 103 // not used
148 };
149 
150 namespace ROOT {
154  };
155 }
156 
157 
158 class TDictionary : public TNamed {
159 
160 private:
161  TDictAttributeMap *fAttributeMap; //pointer to a class attribute map
162  ULong64_t fUpdatingTransactionCount; //!the Cling ID of the transaction that last updated the object
163 
164 protected:
165  Bool_t UpdateInterpreterStateMarker();
166 
167 public:
168  TDictionary(): fAttributeMap(0), fUpdatingTransactionCount(0) { }
169  TDictionary(const char* name): TNamed(name, ""), fAttributeMap(0), fUpdatingTransactionCount(0) { }
170  TDictionary(const TDictionary& dict);
171  virtual ~TDictionary();
172 
173  TDictionary& operator=(const TDictionary& other);
174 
175  void CreateAttributeMap();
177  {
178  //Get the TDictAttributeMap pointer to be able to add attribute
179  //pairs key-value to the TClass.
180 
181  return fAttributeMap;
182  }
183  virtual Long_t Property() const = 0;
184  static TDictionary* GetDictionary(const char* name);
185  static TDictionary* GetDictionary(const std::type_info &typeinfo);
186 
187  // Type of STL container (returned by IsSTLContainer).
188  enum ESTLType {
189  kNone = ROOT::kNotSTL,
190  kVector = ROOT::kSTLvector,
191  kList = ROOT::kSTLlist,
192  kForwardlist = ROOT::kSTLforwardlist,
193  kDeque = ROOT::kSTLdeque,
194  kMap = ROOT::kSTLmap,
195  kMultimap = ROOT::kSTLmultimap,
196  kSet = ROOT::kSTLset,
197  kMultiset = ROOT::kSTLmultiset,
198  kUnorderedSet = ROOT::kSTLunorderedset,
199  kUnorderedMultiset = ROOT::kSTLunorderedmultiset,
200  kUnorderedMap = ROOT::kSTLunorderedmap,
201  kUnorderedMultimap = ROOT::kSTLunorderedmultimap,
202  kBitset = ROOT::kSTLbitset
203  };
204 
205  typedef const void *DeclId_t;
206  ClassDef(TDictionary,2) //Interface to dictionary
207 };
208 
209 #endif
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
bool Bool_t
Definition: RtypesCore.h:59
const void * DeclId_t
Definition: TDictionary.h:205
ULong64_t fUpdatingTransactionCount
Definition: TDictionary.h:162
#define ClassDef(name, id)
Definition: Rtypes.h:297
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
EFunctionMatchMode
Definition: TDictionary.h:151
EProperty
Definition: TDictionary.h:64
EClassProperty
Definition: TDictionary.h:126
This class defines an abstract interface that must be implemented by all classes that contain diction...
Definition: TDictionary.h:158
ERefTypeValues
Definition: TDictionary.h:140
TDictionary(const char *name)
Definition: TDictionary.h:169
TDictAttributeMap * fAttributeMap
Definition: TDictionary.h:161
long Long_t
Definition: RtypesCore.h:50
The ROOT object has a list of properties which are stored and retrieved using TDictAttributeMap.
unsigned long long ULong64_t
Definition: RtypesCore.h:70
TDictAttributeMap * GetAttributeMap() const
Definition: TDictionary.h:176
EFunctionProperty
Definition: TDictionary.h:96
Binding & operator=(OUT(*fun)(void))