[Dcmlib] [New feature] LEGACY/DEPRECATION mechanism
mathieu.malaterre at kitware.com
Tue Jul 19 16:52:49 CEST 2005
I have just finished integrating the deprecation mechanism VTK uses into GDCM. Here is how it works.
On visual studio 6 and above, as well as on gcc 3.x and above there is an attribute you can specify to the function that let you mark as deprecated, therefore you can get compile time warning when you use such deprecated functions (instead of run time warnings). This make it very convienent to detect old API at compile time.
For developpers, you have to change in the header file:
in the implementation file:
You have access to two options to compile GDCM with:
You want to be on the cutting edge of gdcm devlpment and always follow the new fancy features. Therefore you are compiling gdcm lib *without* any old functionality. And therefore you'll get tons of compile time error if you ever turn it on and use old functions.
You have a thousands of line of code developed against gdcm X, but you need some new feature from gdcm CVS (or release X+1), there you don't want no warnings about deprecated method. This will let you use the next release without any warnings or errors.
More information about the Dcmlib