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 std::string fRNTupleSoARecord;
72 Detail::TCollectionProxyInfo *fCollectionProxyInfo;
73 Detail::TCollectionProxyInfo *fCollectionStreamerInfo;
74 std::vector<ROOT::Internal::TSchemaHelper> fReadRules;
75 std::vector<ROOT::Internal::TSchemaHelper> fReadRawRules;
76 std::vector<ROOT::TClassAlt*> fAlternate;
77 std::unordered_map<std::string, TMemberStreamer *> fAdoptedMemberStreamers;
78
79 public:
80 TGenericClassInfo(const char *fullClassname,
81 const char *declFileName, Int_t declFileLine,
82 const std::type_info &info, const Internal::TInitBehavior *action,
85
86 TGenericClassInfo(const char *fullClassname, Int_t version,
87 const char *declFileName, Int_t declFileLine,
88 const std::type_info &info, const Internal::TInitBehavior *action,
91
92 TGenericClassInfo(const char *fullClassname, Int_t version,
93 const char *declFileName, Int_t declFileLine,
94 const Internal::TInitBehavior *action,
96
97 void Init(Int_t pragmabits);
99
100 const Internal::TInitBehavior &GetAction() const;
101 TClass *GetClass();
102 const char *GetClassName() const;
103 Detail::TCollectionProxyInfo *GetCollectionProxyInfo() const;
104 Detail::TCollectionProxyInfo *GetCollectionStreamerInfo() const;
105 const char *GetDeclFileName() const;
106 Int_t GetDeclFileLine() const;
107 DelFunc_t GetDelete() const;
108 DelArrFunc_t GetDeleteArray() const;
109 DesFunc_t GetDestructor() const;
110 DirAutoAdd_t GetDirectoryAutoAdd() const;
111 const char *GetImplFileName();
112 Int_t GetImplFileLine();
113 const std::type_info &GetInfo() const;
114 TVirtualIsAProxy *GetIsA() const;
115 NewFunc_t GetNew() const;
116 NewArrFunc_t GetNewArray() const;
117 const std::vector<ROOT::Internal::TSchemaHelper> &GetReadRawRules() const;
118 const std::vector<ROOT::Internal::TSchemaHelper> &GetReadRules() const;
119 Int_t GetVersion() const;
120
121 TClass *IsA(const void *obj);
122
124 bool AdoptMemberStreamer(const char *name, TMemberStreamer *strm);
125 Short_t AdoptStreamer(TClassStreamer*);
127 void AdoptCollectionProxyInfo(Detail::TCollectionProxyInfo*);
128 void AdoptCollectionStreamerInfo(Detail::TCollectionProxyInfo*);
129 Int_t SetDeclFile(const char *file, Int_t line);
130 void SetDelete(DelFunc_t deleteFunc);
131 void SetDeleteArray(DelArrFunc_t deleteArrayFunc);
132 void SetDestructor(DesFunc_t destructorFunc);
133 void SetDirectoryAutoAdd(DirAutoAdd_t dirAutoAdd);
134 void SetFromTemplate();
135 Int_t SetImplFile(const char *file, Int_t line);
136 void SetMerge(MergeFunc_t);
137 void SetResetAfterMerge(ResetAfterMergeFunc_t);
138 void SetNew(NewFunc_t newFunc);
139 void SetNewArray(NewArrFunc_t newArrayFunc);
140 void SetReadRawRules( const std::vector<ROOT::Internal::TSchemaHelper>& rules );
141 void SetReadRules( const std::vector<ROOT::Internal::TSchemaHelper>& rules );
142 Short_t SetStreamer(ClassStreamerFunc_t);
143 void SetStreamerFunc(ClassStreamerFunc_t);
144 void SetConvStreamerFunc(ClassConvStreamerFunc_t);
145 Short_t SetVersion(Short_t version);
146 void SetRNTupleSoARecord(const std::string &recordName);
147
148 // protected:
149 private:
150 void CreateRuleSet( std::vector<ROOT::Internal::TSchemaHelper>& vect, Bool_t ProcessReadRules );
151 TGenericClassInfo(const TGenericClassInfo &) = delete;
152 TGenericClassInfo& operator=(const TGenericClassInfo &) = delete;
153
154 private:
155 TGenericClassInfo();
156
157 };
158
159}
160
161#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:146
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)