Re: Null-Pointers in TTree

Rene Brun (Rene.Brun@cern.ch)
Fri, 07 Nov 1997 11:56:31 +0100


Christoph Borgmeier wrote:

> Hi,
>
> how does TBranchObject store NULL pointers? It seems to me, that they are
> simply ignored when reading a file, since the pointer like `event->fH'
> remains always constant while the contents of the object it points to are
> exchanged.
>
> Can I store NULL pointers or do I need a workaround for them?
>

In the version 1.03/07, I have implemented support for NULL pointers.
If Root finds a NULL pointer in a TBranchObject, a Zombie object
is written to the branch buffer.
When reading back the branch, if a Zombie object is detected,
it is deleted and the pointer set to NULL as in the producer.

Rene Brun