MantisBT - ITK | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0001485 | ITK | public | 2005-01-14 13:35 | 2009-04-07 06:44 | |
Reporter | Lydia Ng | ||||
Assigned To | Bill Lorensen | ||||
Priority | low | Severity | feature | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | ||||
Resolution Date | |||||
Sprint | |||||
Sprint Status | |||||
Summary | 0001485: Need a standard deprecation mechansim | ||||
Description | We need a standard deprecation mechanism to remove/update old API and classes. This issue is table for the SPIE'05 ISC meeting. Possible options from Brad's email: ------------------------------------ The use of itkWarningMacro to deprecate the Get_vnl_vector methods in Point, Vector, and CovariantVector will not work. Using the warning macro requires there to be a TypeMacro in the class definition. The type macro is intended only for subclasses of LightObject. It adds virtual functions (and therefore a vtable pointer), which is something we don't want for these small classes. While it is easy to rip out this code we need a different deprecation mechanism. We could do something similar to what was recently done in VTK. This would mean adding two CMake options: ITK_LEGACY_SILENT and ITK_LEGACY_REMOVE. By default we would setup some kind of warnings (compile time and/or runtime) for deprecated methods. If the user builds ITK with ITK_LEGACY_SILENT set to ON it would silence the warnings. If the user builds itk with ITK_LEGACY_REMOVE then the legacy code will be removed completely resulting in errors in code trying to call it. Deprecating a method would look like this: // In itkPoint.h: ITK_LEGACY(vnl_vector_ref<TCoordRep> Get_vnl_vector()); // In itkPoint.txx: #ifndef ITK_LEGACY_REMOVE /* * Return a vnl_vector_ref */ template<class T, unsigned int TPointDimension > vnl_vector_ref< T > Point<T, TPointDimension> ::Get_vnl_vector( void ) { ITK_LEGACY_REPLACED_BODY(Point::Get_vnl_vector, "1.10", Point::GetVnlVector); return vnl_vector_ref< T >( TPointDimension, this->GetDataPointer()); } #endif The ITK_LEGACY and ITK_LEGACY_REPLACED_BODY methods would be defined appropriately depending on the settings of ITK_LEGACY_SILENT and ITK_LEGACY_REMOVE. The ITK_LEGACY_REPLACED_BODY macro would use itkGenericOutputMacro to print a deprecation message. There would also be a macro called ITK_LEGACY_BODY to print a message when the method was removed but not replaced. I prefer to make these macros uppercase instead of itkXXXMacro format because it makes the code stick out as legacy rather than implemented by a macro. | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2007-09-18 11:45 | Luis Ibanez | Note Added: 0009082 | |||
2009-04-07 06:44 | Marius Staring | Note Added: 0015945 | |||
2009-04-07 06:44 | Marius Staring | Status | assigned => closed | ||
2009-04-07 06:44 | Marius Staring | Resolution | open => fixed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|