ssm
Runtime Library for the Sparse Synchronous Model
Data Fields
ssm_sv Struct Reference

A variable that may have scheduled updates and triggers. More...

#include <ssm.h>

Collaboration diagram for ssm_sv:
Collaboration graph
[legend]

Data Fields

void(* update )(struct ssm_sv *)
 Update "virtual method". More...
 
ssm_trigger_ttriggers
 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...
 

Detailed Description

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.

Field Documentation

◆ last_updated

ssm_time_t last_updated

When the variable was last updated.

◆ later_time

ssm_time_t later_time

When the variable should be next updated.

◆ triggers

ssm_trigger_t* triggers

List of sensitive continuations.

◆ update

void(* update) (struct ssm_sv *)

Update "virtual method".


The documentation for this struct was generated from the following file: