ssm
Runtime Library for the Sparse Synchronous Model
|
A variable that may have scheduled updates and triggers. More...
#include <ssm.h>
Data Fields | |
void(* | update )(struct ssm_sv *) |
Update "virtual method". More... | |
ssm_trigger_t * | triggers |
List of sensitive continuations. More... | |
ssm_time_t | later_time |
When the variable should be next updated. More... | |
ssm_time_t | last_updated |
When the variable was last updated. More... | |
A variable that may have scheduled updates and triggers.
This is the "base class" for other scheduled variable types.
On its own, this represents a pure event variable, i.e., a scheduled variable with no data/payload. The presence of an event on such a variable can be tested with ssm_event_on() as well as awaited with triggers.
The update field must point to code that copies the new value of the scheduled variable into its current value. For pure events, this function may do nothing, but the pointer must be non-zero.
This can also be embedded in a wrapper struct/class to implement a scheduled variable with a payload. In this case, the payload should also be embedded in that wrapper class, and the vtable should have update/assign/later methods specialized to be aware of the size and layout of the wrapper class.
An invariant: later_time
!= SSM_NEVER if and only if this variable in the event queue.
ssm_time_t last_updated |
When the variable was last updated.
ssm_time_t later_time |
When the variable should be next updated.
ssm_trigger_t* triggers |
List of sensitive continuations.
void(* update) (struct ssm_sv *) |
Update "virtual method".