diff options
Diffstat (limited to 'src/event.cpp')
-rw-r--r-- | src/event.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/event.cpp b/src/event.cpp index 4e5ce0b..2fe2861 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -28,14 +28,22 @@ void threadcall_async_call(threadcall_t *self, threadcall_callback_t callback, v }); } -eventcontext_t *threadcall_get_ec(threadcall_t *self) { - return new eventcontext_t(self->get_ec()); +const eventcontext_t *threadcall_get_ec(const threadcall_t *self) { + return &self->get_ec(); } void sigev_free(sigev_t *self) { delete self; } void sigev_add(sigev_t *self, int signum) { self->add(signum); } +void sigev_del(sigev_t *self) { self->del(); } + +void sigev_clear(sigev_t *self) { self->clear(); } + +const eventcontext_t *sigev_get_ec(const sigev_t *self) { + return &self->get_ec(); +} + timerev_t *timerev_new(const eventcontext_t *ec, timerev_callback_t callback, void *userdata) { return new timerev_t(*ec, [=](salticidae::TimerEvent &ev) { callback(&ev, userdata); @@ -48,6 +56,11 @@ void timerev_set_callback(timerev_t *self, timerev_callback_t callback, void *us }); } + +const eventcontext_t *timerev_get_ec(const timerev_t *self) { + return &self->get_ec(); +} + void timerev_free(timerev_t *self) { delete self; } void timerev_add(timerev_t *self, double t_sec) { self->add(t_sec); } |