[Insight-developers] const ProgressMethods

Luis Ibanez ibanez@cs.unc.edu
Thu, 15 Feb 2001 15:38:21 -0500


Bill,

Sorry about that, It came up while testing our GUI.
I realized later that I was flipping your corrections.

The problem is that for most of the GUI access,
GetProgess() should be a const method.

in fact it seems that itkGetConstMacro() lacks a (&)
or have a 'const' in excess (in the return type),
because it is returning by copy, and setting
'const' in the returned type anyway,    like:

const  float  GetProgress( void ) const
{
...
}


Maybe we should have two separate versions of itkGetMacro()

1)   itkGetByValueMacro()  that generates:

          virtual   type GetName...()  const


2)  itkGetConstMacro()  that generates:

          virtual const type & GetName...()  const


itkGetConstMacro() is the one that should be used in
most of the cases where we use itkGetMacro()...

---

Another option is just to call the itkGetMacro like

      itkGetMacro(  Progress, float & );

but this seems to be less intuitive...
and this is the one that we would like
to call most of the time.


What sounds better to you ?


Luis




---------


"Lorensen, William E (CRD)" wrote:

> Luis,
> I changed the Const macros to Macros for the Progress because of warnings:
>
> cc-3303 CC: WARNING File = /home/lorensen/Insight/Code/Common/itkProcessObject.h, Line = 158
>   A type qualifier on a return type is meaningless.
>
>     itkGetConstMacro(Progress,float);
>     ^
>
> like the above. These are from the SGI compiler and we need to remove them. Any ideas?
>
> Bill
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers

--
______________________________________________________________________

Luis Ibanez
Research Assistant Professor - Division of Neurosurgery
University of North Carolina at Chapel Hill
CB# 7060, Chapel Hill, NC 27599
email : ibanez@cs.unc.edu       home  : http://www.cs.unc.edu/~ibanez
phone : (919)-843-9961          fax   : (919)-966-6627
______________________________________________________________________