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