30 #ifndef MCL_3DL_COMPAT_COMPATIBILITY_H
31 #define MCL_3DL_COMPAT_COMPATIBILITY_H
39 #define STATIC_ASSERT(EXPR) static_assert(EXPR, #EXPR)
46 #ifndef UNDEF_COMPATIBILITY_LEVEL
66 const std::string message =
70 throw std::runtime_error(message);
74 const std::string message =
78 throw std::runtime_error(message);
83 "======= [Deprecated] %s is run in compatible mode =======\n"
84 "=========================================================\n"
85 "Set _compatible:=%d to switch to new topic namespaces.\n"
86 "Compatible mode will be obsolated in the future update.\n"
87 "=========================================================",
94 return std::string(
"~/");
99 template <
class M,
class T>
102 const std::string& topic_new,
104 const std::string& topic_old,
106 void (T::*fp)(M)
const,
113 "Use %s (%s%s) topic instead of %s (%s%s)",
118 return nh_old.
subscribe(topic_old, queue_size, fp, obj, transport_hints);
122 return nh_new.
subscribe(topic_new, queue_size, fp, obj, transport_hints);
125 template <
class M,
class T>
128 const std::string& topic_new,
130 const std::string& topic_old,
139 "Use %s (%s%s) topic instead of %s (%s%s)",
144 return nh_old.
subscribe(topic_old, queue_size, fp, obj, transport_hints);
148 return nh_new.
subscribe(topic_new, queue_size, fp, obj, transport_hints);
154 const std::string& topic_new,
156 const std::string& topic_old,
163 "Use %s (%s%s) topic instead of %s (%s%s)",
168 return nh_old.
advertise<M>(topic_old, queue_size, latch);
172 return nh_new.
advertise<M>(topic_new, queue_size, latch);
175 template <
class T,
class MReq,
class MRes>
178 const std::string& service_new,
180 const std::string& service_old,
181 bool (T::*srv_func)(MReq&, MRes&),
187 "Use %s (%s%s) service instead of %s (%s%s)",
200 template <
typename T>
203 const std::string& param_name_new,
204 const std::string& param_name_old)
209 "Use %s parameter instead of %s",
215 "%s is also defined. Ignoring %s.",
227 #endif // MCL_3DL_COMPAT_COMPATIBILITY_H