LCM

eventlog.h
1 #ifndef _LCM_EVENTLOG_H_
2 #define _LCM_EVENTLOG_H_
3
4 #include <stdint.h>
5 #include <stdio.h>
6
7 #ifdef LCM_PYTHON
8 #define LCM_EXPORT
9 #else
10 #include "lcm_export.h"
11 #endif
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
31 typedef struct _lcm_eventlog_t lcm_eventlog_t;
32 struct _lcm_eventlog_t {
36 FILE *f;
37
41 int64_t eventcount;
42 };
43
47 typedef struct _lcm_eventlog_event_t lcm_eventlog_event_t;
48 struct _lcm_eventlog_event_t {
53 int64_t eventnum;
58 int64_t timestamp;
62 int32_t channellen;
66 int32_t datalen;
67
71 char *channel;
75 void *data;
76 };
77
86 LCM_EXPORT
87 lcm_eventlog_t *lcm_eventlog_create(const char *path, const char *mode);
88
98 LCM_EXPORT
99 lcm_eventlog_event_t *lcm_eventlog_read_next_event(lcm_eventlog_t *eventlog);
100
106 LCM_EXPORT
107 void lcm_eventlog_free_event(lcm_eventlog_event_t *event);
108
117 LCM_EXPORT
118 int lcm_eventlog_seek_to_timestamp(lcm_eventlog_t *eventlog, int64_t ts);
119
129 LCM_EXPORT
130 int lcm_eventlog_write_event(lcm_eventlog_t *eventlog, lcm_eventlog_event_t *event);
131
137 LCM_EXPORT
138 void lcm_eventlog_destroy(lcm_eventlog_t *eventlog);
139
144 #ifdef __cplusplus
145 }
146 #endif
147
148 #endif
_lcm_eventlog_event_t::timestamp
int64_t timestamp
Definition: eventlog.h:58
_lcm_eventlog_event_t::channel
char * channel
Definition: eventlog.h:71
lcm_eventlog_destroy
void lcm_eventlog_destroy(lcm_eventlog_t *eventlog)
lcm_eventlog_seek_to_timestamp
int lcm_eventlog_seek_to_timestamp(lcm_eventlog_t *eventlog, int64_t ts)
lcm_eventlog_write_event
int lcm_eventlog_write_event(lcm_eventlog_t *eventlog, lcm_eventlog_event_t *event)
_lcm_eventlog_t
Definition: eventlog.h:32
_lcm_eventlog_t::f
FILE * f
Definition: eventlog.h:36
_lcm_eventlog_event_t::channellen
int32_t channellen
Definition: eventlog.h:62
lcm_eventlog_create
lcm_eventlog_t * lcm_eventlog_create(const char *path, const char *mode)
_lcm_eventlog_event_t::data
void * data
Definition: eventlog.h:75
lcm_eventlog_read_next_event
lcm_eventlog_event_t * lcm_eventlog_read_next_event(lcm_eventlog_t *eventlog)
_lcm_eventlog_event_t::datalen
int32_t datalen
Definition: eventlog.h:66
_lcm_eventlog_event_t::eventnum
int64_t eventnum
Definition: eventlog.h:53
_lcm_eventlog_t::eventcount
int64_t eventcount
Definition: eventlog.h:41
lcm_eventlog_free_event
void lcm_eventlog_free_event(lcm_eventlog_event_t *event)
_lcm_eventlog_event_t
Definition: eventlog.h:48