Problems with writing (reading) complex object to file

Hi all,

I have a class containing pointers to a Canvas and two pads. Trying to use the streamer as
given by rootcint I got a segmentation violation on reading an object of this type form a file. My solution was to exclude the pointers for the Canvas and the pads from beeing written to file using “//!” in the declaration and to write a custom streamer that recreates my Canvas and the pads. This works almost ok… I get an object that I can interact with via its canvas when reading it from a file using

root [3] TPlunger b* = _file0->Get(“plunger2”)

but I also get

Error: Can’t call TPlunger::TPlunger((class TObject*)0xde1b30) in current scope(tmpfile):1:
Possible candidates are…
(in TPlunger)
/home/joa/plunger/prog/./ -1:-1 0 public: TPlunger TPlunger::TPlunger(void);
/home/joa/plunger/prog/./ -1:-1 0 public: TPlunger TPlunger::TPlunger(int StartFrom);
/home/joa/plunger/prog/./ -1:-1 0 public: TPlunger TPlunger::TPlunger(TRootEmbeddedCanvas* EmbeddedCanvas,Int_t canvas);
*** Interpreter error recovered ***

and b is not allocated (the object is but the pointer to is not). I have a default constructor
without parameters that just set all pointers in the class to zero.

Any ideas?



You mean TPlunger* b.

Yes, I do. Sometimes I curse the curses;) Now it works like a charm.