[Insight-users] array of SmartPointer

bertrand delhay at creatis.insa-lyon.fr
Wed Mar 16 09:19:00 EST 2005


Hello all,

I would to how if there is a way to create an array of SmartPointer and 
if there is one, how to do that.
Actually I'm looking for writing a class in which I'd like to store some 
SmartPointer in an array
For example in the header of the class, I have something like :

        typedef GaussianDensityFunction< MeasurementVectorType >        
      DensityComponantType;
        typedef DensityComponantType::Pointer                            
                      DensityComponantPointer;

In this class I use an attribute:

        DensityComponantPointer *        m_GaussianComponents;


I would like this attribute to be an array where I could store a set of  
N * DensityComponantPointer
I've tried  to write something like :

    unsigned int size = m_List->Size();
    m_GaussianComponents  = new DensityComponantPointer[size];

    for ( unsigned int s = 0; s < size; s++ )
        { 
        this->m_GaussianComponents[size] = DensityComponantType::New();
         }

in my *.txx* file but I get a  unhandled  execption when debugging it
Is there a way to resolve it ??

Bertrand
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050316/a8e9a8b1/attachment.htm


More information about the Insight-users mailing list