|
81 | 81 | /// for all operations and doesn't provide ability to define some perfect subset of
|
82 | 82 | /// operations. PARENT_CLASS should define RTTI with OPENVINO_RTTI_{DECLARATION/DEFINITION}
|
83 | 83 | /// macros.
|
84 |
| -/// \param _VERSION_INDEX is an unsigned integer index to distinguish different versions of |
85 |
| -/// operations that shares the same TYPE_NAME (for backward compatibility) |
86 | 84 | ///
|
87 | 85 | /// OPENVINO_RTTI(name)
|
88 | 86 | /// OPENVINO_RTTI(name, version_id)
|
89 | 87 | /// OPENVINO_RTTI(name, version_id, parent)
|
90 |
| -/// OPENVINO_RTTI(name, version_id, parent, old_version) |
| 88 | + |
91 | 89 | #define OPENVINO_RTTI(...) \
|
92 | 90 | _OPENVINO_RTTI_EXPAND(_OPENVINO_RTTI_DEFINITION_SELECTOR_3(__VA_ARGS__, \
|
93 | 91 | _OPENVINO_RTTI_WITH_TYPE_VERSION_PARENT, \
|
94 | 92 | _OPENVINO_RTTI_WITH_TYPE_VERSION, \
|
95 | 93 | _OPENVINO_RTTI_WITH_TYPE)(__VA_ARGS__))
|
| 94 | + |
| 95 | +#define _OPENVINO_RTTI_BASE_WITH_TYPE(TYPE_NAME) _OPENVINO_RTTI_BASE_WITH_TYPE_VERSION(TYPE_NAME, "util") |
| 96 | + |
| 97 | +#define _OPENVINO_RTTI_BASE_WITH_TYPE_VERSION(TYPE_NAME, VERSION_NAME) \ |
| 98 | + _OPENVINO_HIDDEN_METHOD static const ::ov::DiscreteTypeInfo& get_type_info_static() { \ |
| 99 | + static ::ov::DiscreteTypeInfo type_info_static{TYPE_NAME, VERSION_NAME}; \ |
| 100 | + type_info_static.hash(); \ |
| 101 | + return type_info_static; \ |
| 102 | + } \ |
| 103 | + virtual const ::ov::DiscreteTypeInfo& get_type_info() const { return get_type_info_static(); } |
| 104 | + |
| 105 | +/// Helper macro for base (without rtti parrent) class that provides RTTI block definition. |
| 106 | +/// It's a two parameter version of OPENVINO_RTTI macro, without PARENT_CLASS. |
| 107 | +#define OPENVINO_RTTI_BASE(...) \ |
| 108 | + _OPENVINO_RTTI_EXPAND(_OPENVINO_RTTI_DEFINITION_SELECTOR_2(__VA_ARGS__, \ |
| 109 | + _OPENVINO_RTTI_BASE_WITH_TYPE_VERSION, \ |
| 110 | + _OPENVINO_RTTI_BASE_WITH_TYPE)(__VA_ARGS__)) |
| 111 | + |
| 112 | +#if defined(__GNUC__) |
| 113 | +# define OPENVINO_DO_PRAGMA(x) _Pragma(#x) |
| 114 | +#elif defined(_MSC_VER) |
| 115 | +# define OPENVINO_DO_PRAGMA(x) __pragma(x) |
| 116 | +#else |
| 117 | +# define OPENVINO_DO_PRAGMA(x) |
| 118 | +#endif |
| 119 | + |
| 120 | +#if defined(__clang__) |
| 121 | +# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_START \ |
| 122 | + OPENVINO_DO_PRAGMA(clang diagnostic push) \ |
| 123 | + OPENVINO_DO_PRAGMA(clang diagnostic ignored "-Wsuggest-override") \ |
| 124 | + OPENVINO_DO_PRAGMA(clang diagnostic ignored "-Winconsistent-missing-override") |
| 125 | +# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_END OPENVINO_DO_PRAGMA(clang diagnostic pop) |
| 126 | +#elif (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ > 405)) |
| 127 | +# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_START \ |
| 128 | + OPENVINO_DO_PRAGMA(GCC diagnostic push) \ |
| 129 | + OPENVINO_DO_PRAGMA(GCC diagnostic ignored "-Wsuggest-override") |
| 130 | +# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_END OPENVINO_DO_PRAGMA(GCC diagnostic pop) |
| 131 | +#elif defined(_MSC_VER) |
| 132 | +# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_START \ |
| 133 | + OPENVINO_DO_PRAGMA(warning(push)) \ |
| 134 | + OPENVINO_DO_PRAGMA(warning(disable : 4373)) |
| 135 | +# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_END OPENVINO_DO_PRAGMA(warning(pop)) |
| 136 | +#else |
| 137 | +# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_START |
| 138 | +# define OPENVINO_SUPPRESS_SUGGEST_OVERRIDE_END |
| 139 | +#endif |
0 commit comments