|
reactor-uc 0.1
|
Loading...
Searching...
No Matches
Go to the documentation of this file. 1#ifndef REACTOR_UC_MACROS_API_H
2#define REACTOR_UC_MACROS_API_H
5#define lf_set(port, val) \
7 __typeof__(val) __val = (val); \
8 Port *_port = (Port *)(port); \
9 _port->set(_port, &__val); \
13#define lf_set_array(port, array) \
15 Port *_port = (Port *)(port); \
16 _port->set(_port, array); \
22#define lf_get(trigger) (&(trigger)->value)
27#define lf_is_present(trigger) (((Trigger *)(trigger))->is_present)
29#define lf_schedule_with_val(action, offset, val) \
31 __typeof__(val) __val = (val); \
32 lf_ret_t ret = (action)->super.schedule(&(action)->super, (offset), (const void *)&__val); \
33 if (ret == LF_FATAL) { \
34 LF_ERR(TRIG, "Scheduling an value, that doesn't have value!"); \
35 Scheduler *sched = (action)->super.super.parent->env->scheduler; \
36 sched->do_shutdown(sched, sched->current_tag(sched)); \
37 throw("Tried to schedule a value onto an action without a type!"); \
41#define lf_schedule_without_val(action, offset) \
43 (action)->super.schedule(&(action)->super, (offset), NULL); \