IMP logo
IMP Reference Guide  2.6.1
The Integrative Modeling Platform
deprecation_macros.h
Go to the documentation of this file.
1 /**
2  * \file IMP/deprecation_macros.h
3  * \brief Control display of deprecation information.
4  *
5  * Copyright 2007-2016 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPKERNEL_DEPRECATION_MACROS_H
10 #define IMPKERNEL_DEPRECATION_MACROS_H
11 
12 #include <IMP/kernel_config.h>
13 #include "deprecation.h"
14 
15 /** Used to implement deprecation support. See the
16  [IMP deprecation policy](@ref deprecation).*/
17 #define IMP_DEPRECATED_MACRO(version, help_message) \
18  IMP_PRAGMA(message("This macro is deprecated as of IMP " #version \
19  ": " help_message))
20 
21 /** Used to implement deprecation support. See the
22  [IMP deprecation policy](@ref deprecation).*/
23 #define IMP_DEPRECATED_OBJECT_RUNTIME_WARNING(version, help_message) \
24  { \
25  std::ostringstream oss; \
26  oss << "Object " << get_module_name() << "::" << get_type_name() \
27  << " is deprecated. " << help_message << std::endl; \
28  IMP::handle_use_deprecated(oss.str()); \
29  }
30 
31 /** Used to implement deprecation support. See the
32  [IMP deprecation policy](@ref deprecation).*/
33 #define IMP_DEPRECATED_VALUE_RUNTIME_WARNING(version, help_message) \
34  { \
35  std::ostringstream oss; \
36  oss << "Class " << get_module_name() << "::" << IMP_CURRENT_FUNCTION \
37  << " is deprecated. " << help_message << std::endl; \
38  IMP::handle_use_deprecated(oss.str()); \
39  }
40 
41 /** Used to implement deprecation support. See the
42  [IMP deprecation policy](@ref deprecation).*/
43 #define IMP_DEPRECATED_FUNCTION_RUNTIME_WARNING(version, help_message) \
44  { \
45  std::ostringstream oss; \
46  oss << "Function " << IMP_CURRENT_PRETTY_FUNCTION << " is deprecated. " \
47  << help_message << std::endl; \
48  IMP::handle_use_deprecated(oss.str()); \
49  }
50 
51 /** Used to implement deprecation support. See the
52  [IMP deprecation policy](@ref deprecation).*/
53 #define IMP_DEPRECATED_METHOD_RUNTIME_WARNING(version, help_message) \
54  { \
55  std::ostringstream oss; \
56  oss << "Method " << IMP_CURRENT_PRETTY_FUNCTION << " is deprecated. " \
57  << "WARNING: " << help_message << std::endl; \
58  IMP::handle_use_deprecated(oss.str()); \
59  }
60 
61 #define IMP_DEPRECATED_FUNCTION_DEF(version, message)
62 
63 #endif /* IMPKERNEL_DEPRECATION_MACROS_H */
Control display of deprecation information.