[Insight-users] How to use smart pointers in derived class ??
Luis Ibanez
luis.ibanez@kitware.com
Wed May 19 21:46:57 EDT 2004
Hi Sachin,
In order to take advantage of SmartPointer in your
class, please do the following:
1) Define the typedef for "Self"
2) Define the typedef for "Superclass"
3) Add a line with the itkNewMacro()
4) Add a line with the itkTypeMacro()
If you look at other ITK classes and follow
their code, it should be relatively easy to
get yours adapted.
Regards,
Luis
--------------------------
Sachin Jambawalikar wrote:
> Hi all ,
>
> Can anybody tell me how to use smart pointers for a derived class.
>
>
> I've derived a class from the itkcolortable class.
>
> I can instantiate an object of the class by
>
> CadColorType* colortb=new CadColorTable();
> colortb->useCad(); //function inderived class
>
>
>
> I would like to use instead
> CadColorTableType::Pointer colortb=ColorTableType::New();
> colortb->useCad();
>
> What do I need to do for constructor to use New()??
>
> Regards
> --Sachin
> _______________________________________________
> Insight-users mailing list
> Insight-users@itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list