TXMLFile, streamers and variable names

Dear rooters,

I would like to store my calibration data in a class called TCalibration and stream/read this to/from XML via TXMLFile . The reason is the good “human readability” of XML.
The names of the data memebers of TCalibration should appear in the XML file. However, if I use a streamer generated by the command

rootcint -f TCalibrationDict.cpp -c TCalibration.h

in code that is compiled outside cint (i.e. the VC++ 2008 IDE), they are not. For the member fAnswerToEverything, which is indeed a double, I get the line

  <Double_t v="42.000000" /> 

in the XML file. This kind of defeats the purpose of the operation (which was user editability)…
In contrast, I obtain the expected result if I load TCalibration via ACLIC and then execute the same sample code as before:

root [0].L TCalibration.h++
root [1].x xmltest.C

yields

(...stuff...)
  <fAnswerToEverything v="42.000000" /> 
(more stuff...)

What is the magic switch (possibly a rootcint parameter?) to get the variable names instead of types written into the XML file?

Thanks,

Moritz

PS: I am using root 5.21/06 with VC++ 2008 under Windows Vista.
Example.xml_failure.txt (590 Bytes)
Example.xml_success.txt (659 Bytes)
xmltest.C (225 Bytes)
TCalibration.h (488 Bytes)

Hi, Moritz

When you generate dictionary for your class, you should use following syntax (important “+” sign in the end)

rootcint -f TCalibrationDict.cpp -c TCalibration.h+

Regards, Sergey

Hi Sergey,

this is exactly what I was searching for. Thank you!

Greetings from Frankfurt,

Moritz