HawkTracer  0.10.0
events.h File Reference
#include <hawktracer/base_types.h>
#include <hawktracer/mkcreflect.h>
#include <stddef.h>

Go to the source code of this file.

Classes

struct  _HT_EventKlass
 

Macros

#define HT_EVENT(event)   ((HT_Event*)(event))
 
#define HT_REGISTER_EVENT_KLASS(EVENT_TYPE)   ht_##EVENT_TYPE##_register_event_klass()
 
#define HT_EVENT_GET_KLASS(event)   (((HT_Event*)event)->klass)
 
#define HT_EVENT_KLASS_GET(EVENT_TYPE)   ht_##EVENT_TYPE##_get_event_klass_instance()
 
#define HT_EVENT_IS_INSTANCE_OF(event, EVENT_TYPE)   (HT_EVENT_GET_KLASS(event) == HT_EVENT_KLASS_GET(EVENT_TYPE))
 
#define HT_DECL_EVENT(TYPE_NAME, event)   TYPE_NAME event; HT_EVENT(&event)->klass = HT_EVENT_KLASS_GET(TYPE_NAME);
 

Typedefs

typedef typedefHT_DECLS_BEGIN struct _HT_EventKlass HT_EventKlass
 

Functions

 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)
 
HT_API HT_EventKlassId ht_HT_Event_register_event_klass (void)
 
HT_API size_t ht_HT_Event_get_size (HT_Event *event)
 
HT_API size_t ht_HT_Event_fnc_serialize (HT_Event *event, HT_Byte *buffer)
 

Macro Definition Documentation

◆ HT_DECL_EVENT

#define HT_DECL_EVENT (   TYPE_NAME,
  event 
)    TYPE_NAME event; HT_EVENT(&event)->klass = HT_EVENT_KLASS_GET(TYPE_NAME);

◆ HT_EVENT

#define HT_EVENT (   event)    ((HT_Event*)(event))

◆ HT_EVENT_GET_KLASS

#define HT_EVENT_GET_KLASS (   event)    (((HT_Event*)event)->klass)

◆ HT_EVENT_IS_INSTANCE_OF

#define HT_EVENT_IS_INSTANCE_OF (   event,
  EVENT_TYPE 
)    (HT_EVENT_GET_KLASS(event) == HT_EVENT_KLASS_GET(EVENT_TYPE))

◆ HT_EVENT_KLASS_GET

#define HT_EVENT_KLASS_GET (   EVENT_TYPE)    ht_##EVENT_TYPE##_get_event_klass_instance()

◆ HT_REGISTER_EVENT_KLASS

#define HT_REGISTER_EVENT_KLASS (   EVENT_TYPE)    ht_##EVENT_TYPE##_register_event_klass()

Typedef Documentation

◆ HT_EventKlass

typedef typedefHT_DECLS_BEGIN struct _HT_EventKlass HT_EventKlass

Function Documentation

◆ ht_HT_Event_fnc_serialize()

HT_API size_t ht_HT_Event_fnc_serialize ( HT_Event event,
HT_Byte buffer 
)

◆ ht_HT_Event_get_size()

HT_API size_t ht_HT_Event_get_size ( HT_Event event)

◆ ht_HT_Event_register_event_klass()

HT_API HT_EventKlassId ht_HT_Event_register_event_klass ( void  )

◆ MKCREFLECT_DEFINE_STRUCT()

MKCREFLECT_DEFINE_STRUCT ( HT_Event  ,
(POINTER, HT_EventKlass *, klass)  ,
(INTEGER, HT_TimestampNs, timestamp)  ,
(INTEGER, HT_EventId, id)   
)