Please can someone help me as how to change the class in name in a schema.
I have a shared library with my own classes in it that I store to the output. I want to rename a class for a new version of the output and shared library but retain backwards compatibility. I followed the instructions:
(https://root.cern.ch/root/htmldoc/guides/users-guide/ROOTUsersGuide.html#schema-evolution)
There are no anchors, so at “11.5.6.1 The dictionaries”.
I have a class currently called “BDSOutputROOTGeant4Data”. I will not change any members (two std::map<int, structs>) where there are 2 structs called ParticleInfo and IonInfo both defined inside BDSOutputROOTGeant4Data.
In the linkdef, I currently have (for ClassDef(BDSOutputROOTGeant4Data,2):
#pragma link C++ class BDSOutputROOTGeant4Data+;
#pragma link C++ class BDSOutputROOTGeant4Data::ParticleInfo+;
#pragma link C++ class BDSOutputROOTGeant4Data::IonInfo+;
I want to rename this class to BDSOutputROOTEventParticleData. The structs will remain the same inside the class.
I changed the link def to (file now called BDSOutputROOTEventParticleDataLinkDef.hh):
#pragma link C++ class BDSOutputROOTEventParticleData+;
#pragma link C++ class BDSOutputROOTEventParticleData::ParticleInfo+;
#pragma link C++ class BDSOutputROOTEventParticleData::IonInfo+;
#pragma read sourceClass=“BDSOutputROOTGeant4Data”
version="[-2]"
targetClass=“BDSOutputROOTEventParticleData”
At the end of the new header (BDSOutputROOTEventParticleData.hh), I have:
ClassDef(BDSOutputROOTEventParticleData,1);
When I load the old data using the new shared library I get an error that there’s no dictionary so it’s not working…
TClass::Init:0: RuntimeWarning: no dictionary for class BDSOutputROOTGeant4Data is available
TClass::Init:0: RuntimeWarning: no dictionary for class BDSOutputROOTGeant4Data::ParticleInfo is available
I also found the following paper on this, which has similar instructions.
Is this possible and does anyone know how to do this?
I can’t find any example of only changing the class name either on the ROOT website, the documentation or the included tutorial example files.
Many thanks,
Laurie
_ROOT Version: 6.16/00
_Platform: Mac OSX Mojave
_Compiler: Apple LLVM version 10.0.0 (clang-1000.11.45.5)