[Insight-developers] itkWarningMacroStatic

Brad Davis brad.davis at kitware.com
Wed May 14 09:18:27 EDT 2008


That's it exactly.  Thanks.

On Wed, May 14, 2008 at 9:06 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Brad,
>
>  I think that macro already exists. It is called itkGenericOutputMacro.
>
>  Bill
>
>
>
>  On Wed, May 14, 2008 at 8:58 AM, Brad Davis <brad.davis at kitware.com> wrote:
>  > All,
>  >
>  > I'd like to propose the addition of itkWarningMacroStatic that can
>  > take the place of itkWarningMacro when no "this" is available (e.g.,
>  > in a static function).  One immediate use is for defining an
>  > itkLegacyBodyMacroStatic macro for deprecating static functions.
>  >
>  > The macro would be similar to itkWarningMacro except that it will not
>  > output "this->GetNameOfClass()" or "this".
>  >
>  > It warning macros will be defined as follows:
>  >
>  > #ifdef ITK_LEAN_AND_MEAN
>  > #define itkWarningMacro(x)
>  > #define itkWarningMacroStatic(x)
>  > #else
>  > #define itkWarningMacro(x) \
>  > { if (::itk::Object::GetGlobalWarningDisplay()) \
>  >    { ::itk::OStringStream itkmsg; \
>  >      itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
>  >             << this->GetNameOfClass() << " (" << this << "): " x  \
>  >             << "\n\n"; \
>  >      ::itk::OutputWindowDisplayWarningText(itkmsg.str().c_str());} \
>  > }
>  > #define itkWarningMacroStatic(x) \
>  > { if (::itk::Object::GetGlobalWarningDisplay()) \
>  >    { ::itk::OStringStream itkmsg; \
>  >      itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
>  >             x  \
>  >             << "\n\n"; \
>  >      ::itk::OutputWindowDisplayWarningText(itkmsg.str().c_str());} \
>  > }
>  > #endif
>  >
>  > Any comments, suggestions for improvement, etc?
>  >
>  > Best,
>  > Brad
>
>
> > _______________________________________________
>  > Insight-developers mailing list
>  > Insight-developers at itk.org
>  > http://www.itk.org/mailman/listinfo/insight-developers
>  >
>


More information about the Insight-developers mailing list