Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Znav
nextImplementing an IceStorm Publisher
prevIceStorm Interfaces

Now we'll expand on the earlier weather monitoring example, demonstrating how to create, subscribe to and publish messages on a topic. We use the following Slice definitions in our example:

Wiki Markup
{zcode:slice}
struct Measurement {
    string tower; // tower id
    float windSpeed; // knots
    short windDirection; // degrees
    float temperature; // degrees Celsius
};

interface Monitor {
    void report(Measurement m);
};
{zcode}

Monitor is our topic interface. For the sake of simplicity, it defines just one operation, report, taking a Measurement struct as its only parameter.

Topics

Children Display
Ztop
See Also
Zret
Znav
nextImplementing an IceStorm Publisher
prevIceStorm Interfaces