Re: TRefArray :: accessing elements

From: Adrian Sevcenco <Adrian.Sevcenco_at_cern.ch>
Date: Thu, 18 Aug 2011 21:42:16 +0300


On 08/18/11 21:29, Philippe Canal wrote:
> Hi Adrian,

Hi!

>> 1. if TRefArray* array ; elements are still accessed with array.At(i)

> or with array->At(i) (as with any
>> other pointer)?

>
> Yes.

i imagine that is yes for the last option :)
>> 2. if i know the type of obj (a derived class of TObject)
>> can i do directly a cast like lets say
>> AliAODTrack* track = (AliAODTrack*) array->At(i) ?

> Yes (however you may want to use dynamic_cast<AliAODTrack*>(array->At(i))

it seems that i have some problems with dynamic_cast (i am not sure i'm in process of verifying) that could be related to http://gcc.gnu.org/faq.html#dso .. thought i am not sure ...

Thanks,
Adrian

Received on Thu Aug 18 2011 - 20:41:35 CEST

This archive was generated by hypermail 2.2.0 : Thu Aug 18 2011 - 23:50:01 CEST