Does TRef useful for swap?

Hi,

I have in my application collection of objects which could be quite big and I like to organize processing in a way that only few of them are in memory at a time and all the rest are in local “swap” file and retreaving from there only when really using. Is it possible to profit somehow of TRef to make this process more automatic, or anyway I need to remember the names of the stored objects and retreave them from file as …gDirectory->Get(name)?
I spend some time for reading the comments to TRef, but din’t got the point.

Regards,
Valeri

Hi Valeri,

In version 4.01, when a TRef is used inside a TTree branch,
it privides the functionality that you describe. Dereferencing the TRef
in branch B1 will automatically read the branch B2 containing the referenced object.
However, this mechanism works currently within the same Tree.
To use it, see the description of TTree::BranchRef
root.cern.ch/root/htmldoc/TTree. … :BranchRef
root.cern.ch/root/htmldoc/TRefTable.html

I am currently extending this functionality, such that dereferencing a TRef in B1 in Tree T1 will be able to
-automatically connect the file containing the branch B2 in Tree T2
-and call GetEntry for branch B2

This code will go to CVS sometime in January.

Rene