Re: Changing process ID of TRefTable?

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Mon, 9 May 2011 11:09:40 -0500


> Is there a reason why the process ID cannot be changed by a method?

It is mostly due to the fact that the elements in the TRefArray really really need to shared the same ProcessId and the simplest way to enforce this was not to allow a change mid-stream.

> At the moment the only way of doing this seems to be to have
> a TRefArray* member and create it with the correct process ID.

An alternative, is to put, at the same place you would have put the 'change the pid' call, code like:

     fReferenceArray = TRefArray( other_pid );

Cheers,
Philippe.

On 5/8/11 3:55 AM, Jochen Klein wrote:
> Hi,
>
> when using a TRefArray I realized that the process ID can only be set
> in the constructor, i.e. the only way of changing the process ID is
> another call to the constructor. Is there a reason why the process ID
> cannot be changed by a method?
>
> I am aware that that change holds for all references in the array. But
> let's say I have a TRefArray member in a class which is stored in a
> TClonesArray and I would like to have references to objects from
> different processes (all refs from one array from the same process, of
> course). Then I would like to change the process of the TRefArray for
> every object in the TClonesArray. At the moment the only way of doing
> this seems to be to have a TRefArray* member and create it with the
> correct process ID. However, that means that the TClonesArray has to
> call the destructors for the containing objects, instead of a simple
> clear.
>
> Am I overlooking something?
>
> Cheers,
> Jochen
>
Received on Mon May 09 2011 - 18:09:50 CEST

This archive was generated by hypermail 2.2.0 : Mon May 09 2011 - 23:50:02 CEST