[Insight-users] Source code for itkOptimizer->GetCurrentPosition()

Neil Weisenfeld neil at bwh.harvard.edu
Thu Sep 8 02:28:25 EDT 2005


Vanilla cases of Get and Set of class member variables are often created 
using macros to avoid having to repeatedly code things like:

const ParametersType& GetCurrentPosition() { return 
this->m_CurrentPosition; };

So in itkOptimizer.h you see:

   /** Get current position of the optimization. */
   itkGetConstReferenceMacro( CurrentPosition, ParametersType );

and the macro is defined in Code/Common/itkMacro.h as:

#define itkGetConstReferenceMacro(name,type) \
   virtual const type & Get##name () const \
   { \
     itkDebugMacro("returning " << #name " of " << this->m_##name ); \
     return this->m_##name; \
   }

which generates a definition for GetCurrentPosition.


HTH,
Neil


p.s. -- it's 2:30am, so someone will bark if I made any mistakes and 
please excuse them.


Tanya S wrote:
> Dear All,
>  
> I need to read the source code of  itkOptimizer->GetCurrentPosition(). 
> But when I try to search into the itkOptimizer.h and itkOptimizer.cxx, I 
> could not found this method.
> Where is the source code, actually?
>  
> I found it sometimes I can not find the search code for a method I look 
> for in ITK as well as in VTK. Are they saved in the binary code?
>  
> Any hint would be really appreciated.
>  
> Best regards,
> .Tanya S.
> 
> ------------------------------------------------------------------------
> Click here to donate to the Hurricane Katrina relief effort. 
> <http://store.yahoo.com/redcross-donate3/>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list