Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-03 09:26:34

0001 // @(#)root/meta:$Id$
0002 // Author: Philippe Canal   23/2/02
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2002, Rene Brun, Fons Rademakers and al.           *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_Rtypes
0013 // Include Rtypes.h outside of the code guard to insure the intended
0014 // ordering of Rtypes.h and TGenericClassInfo.h
0015 #include "Rtypes.h"
0016 #endif
0017 
0018 #ifndef ROOT_TGenericClassInfo
0019 #define ROOT_TGenericClassInfo
0020 
0021 #include "TSchemaHelper.h"
0022 #include <vector>
0023 #include <string>
0024 #include <unordered_map>
0025 
0026 // Forward declarations
0027 class TVirtualIsAProxy;
0028 
0029 
0030 namespace ROOT {
0031 
0032    namespace Internal {
0033       /// Returns a string with the demangled and normalized name for the given type.
0034       std::string GetDemangledTypeName(const std::type_info&);
0035    }
0036 
0037    namespace Detail {
0038       class TCollectionProxyInfo;
0039    }
0040 
0041    class TGenericClassInfo {
0042       // This class in not inlined because it is used is non time critical
0043       // section (the dictionaries) and inline would lead to too much
0044       // repetition of the code (once per class!).
0045 
0046       const Internal::TInitBehavior *fAction;
0047       TClass                     *fClass;
0048       const char                 *fClassName;
0049       const char                 *fDeclFileName;
0050       Int_t                       fDeclFileLine;
0051       DictFuncPtr_t               fDictionary;
0052       const std::type_info       &fInfo;
0053       const char                 *fImplFileName;
0054       Int_t                       fImplFileLine;
0055       TVirtualIsAProxy           *fIsA;
0056       Int_t                       fVersion;
0057       MergeFunc_t                 fMerge;
0058       ResetAfterMergeFunc_t       fResetAfterMerge;
0059       NewFunc_t                   fNew;
0060       NewArrFunc_t                fNewArray;
0061       DelFunc_t                   fDelete;
0062       DelArrFunc_t                fDeleteArray;
0063       DesFunc_t                   fDestructor;
0064       DirAutoAdd_t                fDirAutoAdd;
0065       TClassStreamer             *fStreamer;
0066       ClassStreamerFunc_t         fStreamerFunc;
0067       ClassConvStreamerFunc_t     fConvStreamerFunc;
0068       TVirtualCollectionProxy    *fCollectionProxy;
0069       Int_t                       fSizeof;
0070       std::size_t                 fAlignment;
0071       Int_t                       fPragmaBits;
0072       std::string                 fRNTupleSoARecord;
0073       Detail::TCollectionProxyInfo *fCollectionProxyInfo;
0074       Detail::TCollectionProxyInfo *fCollectionStreamerInfo;
0075       std::vector<ROOT::Internal::TSchemaHelper>  fReadRules;
0076       std::vector<ROOT::Internal::TSchemaHelper>  fReadRawRules;
0077       std::vector<ROOT::TClassAlt*>               fAlternate;
0078       std::unordered_map<std::string, TMemberStreamer *> fAdoptedMemberStreamers;
0079 
0080    public:
0081       TGenericClassInfo(const char *fullClassname, const char *declFileName, Int_t declFileLine,
0082                         const std::type_info &info, const Internal::TInitBehavior *action, DictFuncPtr_t dictionary,
0083                         TVirtualIsAProxy *isa, Int_t pragmabits, Int_t sizof, std::size_t alignof_ = 0);
0084 
0085       TGenericClassInfo(const char *fullClassname, Int_t version, const char *declFileName, Int_t declFileLine,
0086                         const std::type_info &info, const Internal::TInitBehavior *action, DictFuncPtr_t dictionary,
0087                         TVirtualIsAProxy *isa, Int_t pragmabits, Int_t sizof, std::size_t alignof_ = 0);
0088 
0089       TGenericClassInfo(const char *fullClassname, Int_t version,
0090                         const char *declFileName, Int_t declFileLine,
0091                         const Internal::TInitBehavior *action,
0092                         DictFuncPtr_t dictionary, Int_t pragmabits);
0093 
0094       void Init(Int_t pragmabits);
0095       ~TGenericClassInfo();
0096 
0097       const Internal::TInitBehavior    &GetAction() const;
0098       TClass                           *GetClass();
0099       const char                       *GetClassName() const;
0100       Detail::TCollectionProxyInfo     *GetCollectionProxyInfo() const;
0101       Detail::TCollectionProxyInfo     *GetCollectionStreamerInfo() const;
0102       const char                       *GetDeclFileName() const;
0103       Int_t                             GetDeclFileLine() const;
0104       DelFunc_t                         GetDelete() const;
0105       DelArrFunc_t                      GetDeleteArray() const;
0106       DesFunc_t                         GetDestructor() const;
0107       DirAutoAdd_t                      GetDirectoryAutoAdd() const;
0108       const char                       *GetImplFileName();
0109       Int_t                             GetImplFileLine();
0110       const std::type_info             &GetInfo() const;
0111       TVirtualIsAProxy                 *GetIsA() const;
0112       NewFunc_t                         GetNew() const;
0113       NewArrFunc_t                      GetNewArray() const;
0114       const std::vector<ROOT::Internal::TSchemaHelper> &GetReadRawRules() const;
0115       const std::vector<ROOT::Internal::TSchemaHelper> &GetReadRules() const;
0116       Int_t                             GetVersion() const;
0117 
0118       TClass                           *IsA(const void *obj);
0119 
0120       void                              AdoptAlternate(ROOT::TClassAlt *alt);
0121       bool                              AdoptMemberStreamer(const char *name, TMemberStreamer *strm);
0122       Short_t                           AdoptStreamer(TClassStreamer*);
0123       Short_t                           AdoptCollectionProxy(TVirtualCollectionProxy*);
0124       void                              AdoptCollectionProxyInfo(Detail::TCollectionProxyInfo*);
0125       void                              AdoptCollectionStreamerInfo(Detail::TCollectionProxyInfo*);
0126       Int_t                             SetDeclFile(const char *file, Int_t line);
0127       void                              SetDelete(DelFunc_t deleteFunc);
0128       void                              SetDeleteArray(DelArrFunc_t deleteArrayFunc);
0129       void                              SetDestructor(DesFunc_t destructorFunc);
0130       void                              SetDirectoryAutoAdd(DirAutoAdd_t dirAutoAdd);
0131       void                              SetFromTemplate();
0132       Int_t                             SetImplFile(const char *file, Int_t line);
0133       void                              SetMerge(MergeFunc_t);
0134       void                              SetResetAfterMerge(ResetAfterMergeFunc_t);
0135       void                              SetNew(NewFunc_t newFunc);
0136       void                              SetNewArray(NewArrFunc_t newArrayFunc);
0137       void                              SetReadRawRules( const std::vector<ROOT::Internal::TSchemaHelper>& rules );
0138       void                              SetReadRules( const std::vector<ROOT::Internal::TSchemaHelper>& rules );
0139       Short_t                           SetStreamer(ClassStreamerFunc_t);
0140       void                              SetStreamerFunc(ClassStreamerFunc_t);
0141       void                              SetConvStreamerFunc(ClassConvStreamerFunc_t);
0142       Short_t                           SetVersion(Short_t version);
0143       void                              SetRNTupleSoARecord(const std::string &recordName);
0144 
0145       //   protected:
0146    private:
0147       void CreateRuleSet( std::vector<ROOT::Internal::TSchemaHelper>& vect, Bool_t ProcessReadRules );
0148       TGenericClassInfo(const TGenericClassInfo &) = delete;
0149       TGenericClassInfo& operator=(const TGenericClassInfo &) = delete;
0150 
0151    private:
0152       TGenericClassInfo();
0153 
0154    };
0155 
0156 }
0157 
0158 #endif