Reading TTask derived class from file and fTasks

I am writing a class derived from the TTask class. I plan to overwrite Write() so that the TList data member, fTasks, and its objects are is written with one key.

Can I code the default constructor is such a way that fTasks will initalize containing all the saved objects(in order) and still use the ROOT I/O?
I know that the default contructor cannot allocate memory, but I am uncertain as to how the TList and its objects work when written with a single key.

Let me know if, and why, this is a stupid question.

Okay, I know why its stupid; the default constructor doesn’t need to do this.

Let me reform the question. If I use:

TFile f(filename,“READ”);
MyTTaskDerivedObject *blah=f->Get(MyTTaskDerivedObjectsNameInFile);

What will blah->GetListOfTasks() have in it?
Nothing? Will the Objects be in order?

The objects in a list are streamed/serialized in the order found in the list.
Same when reading.


Thanks Rene.
If the keys are written individually does the TList still load the objects?
What happens if another program overwrites the object but not the list?

If you write the objects individually, you have to read them individually.