Go to the documentation of this file.
9 #include <mc_rtc/version.h>
19 #define OBSERVER_MODULE_CHECK_VERSION(NAME) \
20 if(mc_rtc::MC_RTC_VERSION != mc_rtc::version()) \
23 "{} was compiled with {} but mc_rtc is currently at version {}, you might experience subtle issues and " \
24 "should recompile your code", \
25 NAME, mc_rtc::MC_RTC_VERSION, mc_rtc::version()); \
28 #ifndef MC_RTC_BUILD_STATIC
30 # define EXPORT_OBSERVER_MODULE(NAME, TYPE) \
33 OBSERVER_MODULE_API void MC_RTC_OBSERVER_MODULE(std::vector<std::string> & names) \
35 OBSERVER_MODULE_CHECK_VERSION(NAME) \
38 OBSERVER_MODULE_API void destroy(mc_observers::Observer * ptr) \
42 OBSERVER_MODULE_API unsigned int create_args_required() \
46 OBSERVER_MODULE_API mc_observers::Observer * create(const std::string & type, const double & dt) \
48 return new TYPE{type, dt}; \
56 # define EXPORT_OBSERVER_MODULE(NAME, TYPE) \
59 static auto registered = []() \
61 using fn_t = std::function<TYPE *(const double &)>; \
62 mc_observers::ObserverLoader::register_object(NAME, fn_t([](const double & dt) { return new TYPE(NAME, dt); })); \