00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00043 #ifndef NSMIRACLE_DEPRECATED_H
00044 #define NSMIRACLE_DEPRECATED_H
00045
00046 #include<iostream>
00047
00048
00049 #define RETVAL_NOT_IMPLEMENTED 5432
00050
00051
00052 #define PRINT_WARNING_DEPRECATED_FUNCTION { \
00053 static bool print_warning_deprecated_function = true; \
00054 if (print_warning_deprecated_function) { \
00055 cerr << "WARNING: method " << __PRETTY_FUNCTION__ \
00056 << "() is deprecated " << endl; \
00057 print_warning_deprecated_function = false; \
00058 } \
00059 }
00060
00061
00062
00063
00064 #ifdef __STRING
00065 #define WARNING_MSG_DEPRECATED_VIRTUAL_METHOD(X,Y) "WARNING: deprecated virtual method " __STRING(X) " is being used instead of " __STRING(Y)
00066 #else // __STRING is undefined !!!
00067 #define WARNING_MSG_DEPRECATED_VIRTUAL_METHOD "WARNING: a deprecated virtual method is being used instead of a new one "
00068 #endif // __STRING
00069
00070
00071
00072 #define RUN_DEPRECATED_OR_NEW_VIRTUAL_METHOD(X,Y) { \
00073 static bool print_warning_deprecated_virtual_method = true; \
00074 int retval=(Y); \
00075 if ( retval == RETVAL_NOT_IMPLEMENTED ) { \
00076 retval = (X); \
00077 if (( retval != RETVAL_NOT_IMPLEMENTED ) \
00078 && print_warning_deprecated_virtual_method) { \
00079 cerr << WARNING_MSG_DEPRECATED_VIRTUAL_METHOD(X,Y) << endl; \
00080 print_warning_deprecated_virtual_method = false; \
00081 } \
00082 } \
00083 }
00084
00085
00086
00087
00088
00089
00090
00091 #endif // NSMIRACLE_DEPRECATED_H