Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGenericClassInfo.h
Go to the documentation of this file.
1// @(#)root/meta:$Id$
2// Author: Philippe Canal 23/2/02
3
4/*************************************************************************
5 * Copyright (C) 1995-2002, Rene Brun, Fons Rademakers and al. *
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_Rtypes
13// Include Rtypes.h outside of the code guard to insure the intended
14// ordering of Rtypes.h and TGenericClassInfo.h
15#include "Rtypes.h"
16#endif
17
18#ifndef ROOT_TGenericClassInfo
19#define ROOT_TGenericClassInfo
20
21#include "TSchemaHelper.h"
22#include <vector>
23#include <string>
24#include <unordered_map>
25
26// Forward declarations
28
29
30namespace ROOT {
31
32 namespace Internal {
33 /// Returns a string with the demangled and normalized name for the given type.
34 std::string GetDemangledTypeName(const std::type_info&);
35 }
36
37 namespace Detail {
38 class TCollectionProxyInfo;
39 }
40
41 class TGenericClassInfo {
42 // This class in not inlined because it is used is non time critical
43 // section (the dictionaries) and inline would lead to too much
44 // repetition of the code (once per class!).
45
46 const Internal::TInitBehavior *fAction;
48 const char *fClassName;
49 const char *fDeclFileName;
50 Int_t fDeclFileLine;
52 const std::type_info &fInfo;
53 const char *fImplFileName;
54 Int_t fImplFileLine;
55 TVirtualIsAProxy *fIsA;
56 Int_t fVersion;
57 MergeFunc_t fMerge;
58 ResetAfterMergeFunc_t fResetAfterMerge;
59 NewFunc_t fNew;
60 NewArrFunc_t fNewArray;
61 DelFunc_t fDelete;
62 DelArrFunc_t fDeleteArray;
63 DesFunc_t fDestructor;
64 DirAutoAdd_t fDirAutoAdd;
65 TClassStreamer *fStreamer;
66 ClassStreamerFunc_t fStreamerFunc;
67 ClassConvStreamerFunc_t fConvStreamerFunc;
68 TVirtualCollectionProxy *fCollectionProxy;
69 Int_t fSizeof;
71 Detail::TCollectionProxyInfo *fCollectionProxyInfo;
72 Detail::TCollectionProxyInfo *fCollectionStreamerInfo;
73 std::vector<ROOT::Internal::TSchemaHelper> fReadRules;
74 std::vector<ROOT::Internal::TSchemaHelper> fReadRawRules;
75 std::vector<ROOT::TClassAlt*> fAlternate;
76 std::unordered_map<std::string, TMemberStreamer *> fAdoptedMemberStreamers;
77
78 public:
79 TGenericClassInfo(const char *fullClassname,
80 const char *declFileName, Int_t declFileLine,
81 const std::type_info &info, const Internal::TInitBehavior *action,
84
85 TGenericClassInfo(const char *fullClassname, Int_t version,
86 const char *declFileName, Int_t declFileLine,
87 const std::type_info &info, const Internal::TInitBehavior *action,
90
91 TGenericClassInfo(const char *fullClassname, Int_t version,
92 const char *declFileName, Int_t declFileLine,
93 const Internal::TInitBehavior *action,
95
96 void Init(Int_t pragmabits);
98
99 const Internal::TInitBehavior &GetAction() const;
100 TClass *GetClass();
101 const char *GetClassName() const;
102 Detail::TCollectionProxyInfo *GetCollectionProxyInfo() const;
103 Detail::TCollectionProxyInfo *GetCollectionStreamerInfo() const;
104 const char *GetDeclFileName() const;
105 Int_t GetDeclFileLine() const;
106 DelFunc_t GetDelete() const;
107 DelArrFunc_t GetDeleteArray() const;
108 DesFunc_t GetDestructor() const;
109 DirAutoAdd_t GetDirectoryAutoAdd() const;
110 const char *GetImplFileName();
111 Int_t GetImplFileLine();
112 const std::type_info &GetInfo() const;
113 TVirtualIsAProxy *GetIsA() const;
114 NewFunc_t GetNew() const;
115 NewArrFunc_t GetNewArray() const;
116 const std::vector<ROOT::Internal::TSchemaHelper> &GetReadRawRules() const;
117 const std::vector<ROOT::Internal::TSchemaHelper> &GetReadRules() const;
118 Int_t GetVersion() const;
119
120 TClass *IsA(const void *obj);
121
123 bool AdoptMemberStreamer(const char *name, TMemberStreamer *strm);
124 Short_t AdoptStreamer(TClassStreamer*);
126 void AdoptCollectionProxyInfo(Detail::TCollectionProxyInfo*);
127 void AdoptCollectionStreamerInfo(Detail::TCollectionProxyInfo*);
128 Int_t SetDeclFile(const char *file, Int_t line);
129 void SetDelete(DelFunc_t deleteFunc);
130 void SetDeleteArray(DelArrFunc_t deleteArrayFunc);
131 void SetDestructor(DesFunc_t destructorFunc);
132 void SetDirectoryAutoAdd(DirAutoAdd_t dirAutoAdd);
133 void SetFromTemplate();
134 Int_t SetImplFile(const char *file, Int_t line);
135 void SetMerge(MergeFunc_t);
136 void SetResetAfterMerge(ResetAfterMergeFunc_t);
137 void SetNew(NewFunc_t newFunc);
138 void SetNewArray(NewArrFunc_t newArrayFunc);
139 void SetReadRawRules( const std::vector<ROOT::Internal::TSchemaHelper>& rules );
140 void SetReadRules( const std::vector<ROOT::Internal::TSchemaHelper>& rules );
141 Short_t SetStreamer(ClassStreamerFunc_t);
142 void SetStreamerFunc(ClassStreamerFunc_t);
143 void SetConvStreamerFunc(ClassConvStreamerFunc_t);
144 Short_t SetVersion(Short_t version);
145
146 // protected:
147 private:
148 void CreateRuleSet( std::vector<ROOT::Internal::TSchemaHelper>& vect, Bool_t ProcessReadRules );
149 TGenericClassInfo(const TGenericClassInfo &) = delete;
150 TGenericClassInfo& operator=(const TGenericClassInfo &) = delete;
151
152 private:
153 TGenericClassInfo();
154
155 };
156
157}
158
159#endif
Cppyy::TCppType_t fClass
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
short Short_t
Signed Short integer 2 bytes (short)
Definition RtypesCore.h:53
TClass *(* DictFuncPtr_t)()
Definition Rtypes.h:86
void(* ClassStreamerFunc_t)(TBuffer &, void *)
Definition Rtypes.h:78
void(* ClassConvStreamerFunc_t)(TBuffer &, void *, const TClass *)
Definition Rtypes.h:79
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
char name[80]
Definition TGX11.cxx:110
Binding & operator=(OUT(*fun)(void))
TClass * IsA() const override
Definition TStringLong.h:20
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
Defines a common interface to inspect/change the contents of an object that represents a collection.
TLine * line
std::string GetDemangledTypeName(const std::type_info &t)
void(* DirAutoAdd_t)(void *, TDirectory *)
Definition Rtypes.h:120
void(* ResetAfterMergeFunc_t)(void *, TFileMergeInfo *)
Definition Rtypes.h:122
void(* DesFunc_t)(void *)
Definition Rtypes.h:119
TClass * GetClass(T *)
Definition TClass.h:679
void(* DelFunc_t)(void *)
Definition Rtypes.h:117
void *(* NewArrFunc_t)(Long_t size, void *arena)
Definition Rtypes.h:116
void(* DelArrFunc_t)(void *)
Definition Rtypes.h:118
void *(* NewFunc_t)(void *)
Definition Rtypes.h:115
Long64_t(* MergeFunc_t)(void *, TCollection *, TFileMergeInfo *)
Definition Rtypes.h:121
void Init(TClassEdit::TInterpreterLookupHelper *helper)