1 #ifndef HAWKTRACER_EVENTS_H 2 #define HAWKTRACER_EVENTS_H 23 #define HT_EVENT(event) ((HT_Event*)(event)) 33 #define HT_REGISTER_EVENT_KLASS(EVENT_TYPE) ht_##EVENT_TYPE##_register_event_klass() 35 #define HT_EVENT_GET_KLASS(event) (((HT_Event*)event)->klass) 36 #define HT_EVENT_KLASS_GET(EVENT_TYPE) ht_##EVENT_TYPE##_get_event_klass_instance() 37 #define HT_EVENT_IS_INSTANCE_OF(event, EVENT_TYPE) \ 38 (HT_EVENT_GET_KLASS(event) == HT_EVENT_KLASS_GET(EVENT_TYPE)) 40 #define HT_DECL_EVENT(TYPE_NAME, event) \ 41 TYPE_NAME event; HT_EVENT(&event)->klass = HT_EVENT_KLASS_GET(TYPE_NAME);
#define HT_API
Defines a directive for exporting/importing symbols from DLL.
Definition: macros.h:76
#define HT_DECLS_END
Defines an end of C linkage block.
Definition: macros.h:17
Definition: mkcreflect.h:42
HT_API size_t ht_HT_Event_get_size(HT_Event *event)
uint8_t HT_Byte
An unsigned integer guaranteed to be 8 bits on all platforms.
Definition: base_types.h:26
uint64_t HT_TimestampNs
An unsigned integer used for representing timestamps in nanoseconds.
Definition: base_types.h:14
uint64_t HT_EventId
An unsigned integer used for event identifiers.
Definition: base_types.h:16
HT_API size_t ht_HT_Event_fnc_serialize(HT_Event *event, HT_Byte *buffer)
size_t(* serialize)(HT_Event *event, HT_Byte *buffer)
Definition: events.h:28
HT_DECLS_BEGIN INTEGER
Definition: core_events.h:11
HT_API HT_EventKlassId ht_HT_Event_register_event_klass(void)
HT_EventKlassId klass_id
Definition: events.h:30
typedefHT_DECLS_BEGIN struct _HT_EventKlass HT_EventKlass
Definition: events.h:11
#define HT_DECLS_BEGIN
Defines a beginning of C linkage block.
Definition: macros.h:16
MKCREFLECT_TypeInfo * type_info
Definition: events.h:27
HT_DECLS_BEGIN typedef uint32_t HT_EventKlassId
An unsigned integer used for event klass identifiers.
Definition: base_types.h:12
HT_DECLS_BEGIN HT_Event
Definition: core_events.h:11
size_t(* get_size)(HT_Event *event)
Definition: events.h:29
MKCREFLECT_DEFINE_STRUCT(HT_Event,(POINTER, HT_EventKlass *, klass),(INTEGER, HT_TimestampNs, timestamp),(INTEGER, HT_EventId, id)) HT_API HT_EventKlass *ht_HT_Event_get_event_klass_instance(void)