#include <mc_observers/Observer.h>
#include <mc_rtc/version.h>
Go to the source code of this file.
◆ EXPORT_OBSERVER_MODULE
#define EXPORT_OBSERVER_MODULE |
( |
|
NAME, |
|
|
|
TYPE |
|
) |
| |
Value: extern "C" \
{ \
OBSERVER_MODULE_API void MC_RTC_OBSERVER_MODULE(std::vector<std::string> & names) \
{ \
OBSERVER_MODULE_CHECK_VERSION(NAME) \
names = {NAME}; \
} \
{ \
delete ptr; \
} \
OBSERVER_MODULE_API unsigned int create_args_required() \
{ \
return 2; \
} \
{ \
return new TYPE{type, dt}; \
} \
}
◆ OBSERVER_MODULE_CHECK_VERSION
#define OBSERVER_MODULE_CHECK_VERSION |
( |
|
NAME | ) |
|
Value: if(mc_rtc::MC_RTC_VERSION != mc_rtc::version()) \
"{} was compiled with {} but mc_rtc is currently at version {}, you might experience subtle issues and " \
"should recompile your code", \
NAME, mc_rtc::MC_RTC_VERSION, mc_rtc::version()); \
}
A simple compile-time versus run-time version checking macro
If you are not relying on EXPORT_OBSERVER_MODULE you should use this in your MC_RTC_OBSERVER_MODULE implementation