15#include "TBaseClass.h"
18#include "TClassEdit.h"
19#include "TDataMember.h"
23#include "TStreamerInfo.h"
38UInt_t CalculateCheckSum (TClass* cl,
const char* name_in)
42 TString
name = name_in;
45 for (
int i=0;
i<
il;
i++)
id =
id*3+name[i];
47 TList *tlb =
cl->GetListOfBases();
53 while((tbc=(TBaseClass*)nextBase())) {
54 name = tbc->GetName();
56 for (
int i=0;
i<
il;
i++)
id =
id*3+name[i];
59 TList *tlm =
cl->GetListOfDataMembers();
64 while((tdm=(TDataMember*)nextMemb())) {
65 if (!tdm->IsPersistent())
continue;
67 prop = (tdm->Property());
68 TDataType*
tdt = tdm->GetDataType();
69 if (tdt) prop |=
tdt->Property();
71 if ( prop&kIsStatic)
continue;
73 if (prop&kIsEnum)
id =
id*3 + 1;
76 for (i=0;
i<
il;
i++)
id =
id*3+name[i];
77 type = tdm->GetFullTypeName();
82 R__WRITE_LOCKGUARD(ROOT::gCoreMutex);
83 if (TClassEdit::IsSTLCont(
type) != ROOT::kNotSTL)
84 type = TClassEdit::ShortType(
type, TClassEdit::kDropStlDefault );
88 for (i=0;
i<
il;
i++)
id =
id*3+
type[i];
90 int dim = tdm->GetArrayDim();
92 for (
int i=0;
i<
dim;
i++)
id =
id*3+tdm->GetMaxIndex(i);
152 const std::string& trans_cls,
153 const std::string& pers_cls)
174 const std::string& pers_cls)
192 Error (
"TVirtualConverter",
193 "Both transient and persistent classes are null.");
195 Error (
"TVirtualConverter",
196 "Transient class is null for persistent class `%s'",
200 Error (
"TVirtualConverter",
201 "Persistent class is null for transient class `%s'",
312 return gROOT->GetClass (name.c_str());
324 TClass* cl = gROOT->GetClass (
id);
330 const char* name =
id.name();
331 cl = gROOT->GetClass (name);
334 const char* n2 = name;
337 cl = gROOT->GetClass (n2);
341 char* demname =
nullptr;
346 R__WRITE_LOCKGUARD(ROOT::gCoreMutex);
347 demname = TClassEdit::DemangleTypeIdName (
id, errorCode);
350 cl = gROOT->GetClass (demname);
373 const TObjArray* trans_sis =
fTransClass->GetStreamerInfos();
374 if (trans_sis->GetLast() !=
fOldLast) {
383 const TObjArray* pers_sis =
fPersClass->GetStreamerInfos();
384 assert (trans_sis->LowerBound() == pers_sis->LowerBound());
385 for (Int_t v = trans_sis->LowerBound(); v <= trans_sis->GetLast(); ++v) {
387 trans_sis->At(v) != 0 &&
388 (v > pers_sis->GetLast() || pers_sis->At(v) == 0))
394 TStreamerInfo* new_si =(TStreamerInfo*)(trans_sis->At(v)->Clone());
Base class for Root converters.
virtual void ReadBuffer(TBuffer &b, void *obj, Version_t version, UInt_t R__S, UInt_t R__c)
Read object in non-split mode.
TClass * fPersClass
The declared persistent class.
TClass * GetTransClass()
Return the transient class, to which we're converting.
virtual void * NewPersObj()
Create a new instance of the persistent class.
int fOldLast
Used by CheckStreamInfos: the length of the streamerinfo list that we saw on the last CheckStreamInfo...
virtual ~TVirtualConverter()
Destructor.
TVirtualConverter()
Default constructor.
virtual void DeletePersObj(void *persobj)
Destroy an instance of the persistent class.
void CheckStreamInfos()
Helper to allow for automatic schema evolution for persistent classes.
int GetCheckSum() const
Return the checksum of the class from which we're converting.
void SetCtorInfo(UInt_t checksum, TClass *trans_cls, TClass *pers_cls)
Set the parameters that would normally be passed to the constructor.
virtual void ConvertVoid(void *transobj, const void *persobj)=0
Do the conversion.
TClass * GetPersClass()
Return the persistent class, from which we're converting.
static TClass * ToClass(const std::string &name)
Helper to convert a class name to a Root class pointer.
void * fPersObj
The temporary persistent object instance, used for conversions (in non-split mode).
TClass * fTransClass
The declared transient class.
UInt_t fCheckSum
The declared checksum.
void CheckClasses()
Helper to check that the classes have been defined properly.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]