Inspirel banner

Programming Distributed Systems with YAMI4

10.2.3 Record Types

Record types are used to define the content structure of message payloads and reflect the structure of the regular YAMI4 parameters object.

Types can contain fields of the following standard types, which mirror regular YAMI4 types:

In addition, fields can have types that are user-defined, which allows to created nested data types.

Example type definitions:

   type Point is
      X : Integer;
      Y : Integer;
   end Point;
   
   type Line is
      A : Point;  --  nested user-defined type
      B : Point;
   end Line;

Fields can be declared as optional, which means that they might or might not be physically present in the data packet:

   type Point is
      First_Name : String;
      Last_Name : String;
      Address : optional String;  --  could be omitted
   end Point;