HawkTracer  0.8.0
event_macros_impl.h
Go to the documentation of this file.
1 #ifndef HAWKTRACER_EVENT_MACROS_IMPL_H
2 #define HAWKTRACER_EVENT_MACROS_IMPL_H
3 
5 
6 #ifdef MKCREFLECT_DEFINE_GET_METHOD
7 #undef MKCREFLECT_DEFINE_GET_METHOD
8 #endif
9 
10 #define MKCREFLECT_DEFINE_GET_METHOD(TYPE_NAME, ...) \
11  MKCREFLECT_TypeInfo* mkcreflect_get_##TYPE_NAME##_type_info(void) \
12  { \
13  static MKCREFLECT_FieldInfo fields_info[MKCREFLECT_FOREACH(MKCREFLECT_SUM, 0, __VA_ARGS__)] = \
14  { \
15  MKCREFLECT_FOREACH(MKCREFLECT_FIELD_INFO, TYPE_NAME, __VA_ARGS__) \
16  }; \
17  static MKCREFLECT_TypeInfo type_info = \
18  { \
19  #TYPE_NAME, \
20  MKCREFLECT_FOREACH(MKCREFLECT_SUM, 0, __VA_ARGS__), \
21  sizeof(TYPE_NAME), \
22  MKCREFLECT_FOREACH(MKCREFLECT_SIZEOF, 0, __VA_ARGS__), \
23  fields_info \
24  }; \
25  return &type_info; \
26  }
27 
28 #ifdef HT_EVENT_DEFINITIONS
29 #undef HT_EVENT_DEFINITIONS
30 #endif
31 
32 #define HT_EVENT_DEFINITIONS(TYPE_NAME, BASE_TYPE, ...) \
33  HT_EVENT_DEFINITIONS_(TYPE_NAME, BASE_TYPE, __VA_ARGS__)
34 
35 #endif /* HAWKTRACER_EVENT_MACROS_IMPL_H */