Skip to main content

system

A named set of local protocols that runs together: one protocol per component, giving the whole assembly's behavior.

component Radar;
component CommandPost;

message struct TrackReport {
    track_id: uint32;
}

message struct Ack {
    track_id: uint32;
}

local protocol Report in Radar {
    send any TrackReport to CommandPost;
    recv _: Ack from CommandPost;
}

local protocol Collect in CommandPost {
    recv _: TrackReport from Radar;
    send any Ack to Radar;
}

system Tracking {
    Report;
    Collect;
}

Members​

The body is a sequence of protocol references, each a path and a ;.

  • Each reference names a local protocol.
  • No two references name protocols on the same component. The one protocol a component has here is its whole top-level behavior, so a second would be ambiguous.
  • A component with nothing to do in this system is simply left out.
  • A protocol may belong to more than one system, so one component's behavior can appear in several assemblies.

A system says nothing new about the protocols it lists. It names the set, and adds no statements of its own.

Errors​

Listing something that is not a local protocol​

component Radar;
component CommandPost;

message struct TrackReport {
    track_id: uint32;
}

global protocol Report {
    exch any TrackReport from Radar to CommandPost;
}

system Tracking {
    Report;   // error: system-protocol-not-local
}

Two protocols on the same component​

component Radar;
component CommandPost;

message struct TrackReport {
    track_id: uint32;
}

message struct Heartbeat {
    uptime_s: uint32;
}

local protocol Report in Radar {
    send any TrackReport to CommandPost;
}

local protocol Beat in Radar {
    send any Heartbeat to CommandPost;
}

system Tracking {
    Report;
    Beat;   // error: system-duplicate-component
}