[Insight-developers] itkWarningMacroStatic

Karthik Krishnan karthik.krishnan at kitware.com
Wed May 14 09:06:19 EDT 2008


Brad:

Doesn't itkGenericOutputMacro already fulfill these needs ?

thanks
--
karthik

On Wed, May 14, 2008 at 12:58 PM, 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