Setting entries in TFile::fClassIndex

Hello everyone,

I was wondering if there is a preferred way to set entries in a TFile::fClassIndex to 0 or 1.

The reason I would like to do this is to force a new version of the streamer info for a given class to be written to file (version in memory is read from file). To do this I would update the streamer info and call TStreamerInfo::TagFile. However, in this method there is a check to see if cindex->fArray[fNumber] == 1. In that case it refuses to update this info (it does not set cindex->fArray[0] to 1). Similar for ForceWriteInfo. I think this is sane behaviour since in general you do not want to mess with the streamer info in a file, but right now I would. Would the correct solution be to set the right entry in the file’s fClassIndex by hand?

Thanks for your help.

Cheers,
Jeroen

This array is directly returned by TFile::GetClassIndex. You can call that and then manipulate the array directly. Of course, use caution when doing so.

Cheers,
Philippe.