40 f.write(
'#if (ROSCONSOLE_MIN_SEVERITY > ROSCONSOLE_SEVERITY_%s)\n' %(caps_name))
41 f.write(
'#define ROSFMT_%s(...)\n' %(caps_name))
42 f.write(
'#define ROSFMT_%s_NAMED(name, ...)\n' %(caps_name))
43 f.write(
'#define ROSFMT_%s_COND(cond, ...)\n' %(caps_name))
44 f.write(
'#define ROSFMT_%s_COND_NAMED(cond, name, ...)\n' %(caps_name))
46 f.write(
'#define ROSFMT_%s_ONCE(...)\n' %(caps_name))
47 f.write(
'#define ROSFMT_%s_ONCE_NAMED(name, ...)\n' %(caps_name))
48 f.write(
'#define ROSFMT_%s_THROTTLE(period, ...)\n' %(caps_name))
49 f.write(
'#define ROSFMT_%s_THROTTLE_NAMED(period, name, ...)\n' %(caps_name))
50 f.write(
'#define ROSFMT_%s_DELAYED_THROTTLE(period, ...)\n' %(caps_name))
51 f.write(
'#define ROSFMT_%s_DELAYED_THROTTLE_NAMED(period, name, ...)\n' %(caps_name))
53 f.write(
'#define ROSFMT_%s_FILTER(filter, ...)\n' %(caps_name))
54 f.write(
'#define ROSFMT_%s_FILTER_NAMED(filter, name, ...)\n' %(caps_name))
56 f.write(
'#define ROSFMT_%s(...) ROSFMT_LOG(::ros::console::levels::%s, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)\n' %(caps_name, enum_name))
57 f.write(
'#define ROSFMT_%s_NAMED(name, ...) ROSFMT_LOG(::ros::console::levels::%s, std::string(ROSCONSOLE_NAME_PREFIX) + "." + name, __VA_ARGS__)\n' %(caps_name, enum_name))
58 f.write(
'#define ROSFMT_%s_COND(cond, ...) ROSFMT_LOG_COND(cond, ::ros::console::levels::%s, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)\n' %(caps_name, enum_name))
59 f.write(
'#define ROSFMT_%s_COND_NAMED(cond, name, ...) ROSFMT_LOG_COND(cond, ::ros::console::levels::%s, std::string(ROSCONSOLE_NAME_PREFIX) + "." + name, __VA_ARGS__)\n' %(caps_name, enum_name))
61 f.write(
'#define ROSFMT_%s_ONCE(...) ROSFMT_LOG_ONCE(::ros::console::levels::%s, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)\n' %(caps_name, enum_name))
62 f.write(
'#define ROSFMT_%s_ONCE_NAMED(name, ...) ROSFMT_LOG_ONCE(::ros::console::levels::%s, std::string(ROSCONSOLE_NAME_PREFIX) + "." + name, __VA_ARGS__)\n' %(caps_name, enum_name))
64 f.write(
'#define ROSFMT_%s_THROTTLE(period, ...) ROSFMT_LOG_THROTTLE(period, ::ros::console::levels::%s, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)\n' %(caps_name, enum_name))
65 f.write(
'#define ROSFMT_%s_THROTTLE_NAMED(period, name, ...) ROSFMT_LOG_THROTTLE(period, ::ros::console::levels::%s, std::string(ROSCONSOLE_NAME_PREFIX) + "." + name, __VA_ARGS__)\n' %(caps_name, enum_name))
67 f.write(
'#define ROSFMT_%s_DELAYED_THROTTLE(period, ...) ROSFMT_LOG_DELAYED_THROTTLE(period, ::ros::console::levels::%s, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)\n' %(caps_name, enum_name))
68 f.write(
'#define ROSFMT_%s_DELAYED_THROTTLE_NAMED(period, name, ...) ROSFMT_LOG_DELAYED_THROTTLE(period, ::ros::console::levels::%s, std::string(ROSCONSOLE_NAME_PREFIX) + "." + name, __VA_ARGS__)\n' %(caps_name, enum_name))
70 f.write(
'#define ROSFMT_%s_FILTER(filter, ...) ROSFMT_LOG_FILTER(filter, ::ros::console::levels::%s, ROSCONSOLE_DEFAULT_NAME, __VA_ARGS__)\n' %(caps_name, enum_name))
71 f.write(
'#define ROSFMT_%s_FILTER_NAMED(filter, name, ...) ROSFMT_LOG_FILTER(filter, ::ros::console::levels::%s, std::string(ROSCONSOLE_NAME_PREFIX) + "." + name, __VA_ARGS__)\n' %(caps_name, enum_name))
74 f = open(os.path.join(os.path.dirname(__file__),
'../include/rosfmt/macros_generated.h'),
'w')
76 f.write(
"// !!!!!!!!!!!!!!!!!!!!!!! This is a generated file, do not edit manually\n\n")
def add_macro(f, caps_name, enum_name)