Generating port code in C

In C, code can be generated for the following types of ports:

The following macros are used for working with ports and events:

  • Generating and sending an event through a port:
    • RiCGEN_PORT([pointer to port], [event])

      Examples:
      RiCGEN_PORT (me->myPort, myEvent())

      For ports with multiplicity greater than one:
      RiCGEN_PORT (me->myPort[2], myEvent())
  • Detecting the input port through which an event was sent:
    • RiCIS_PORT([pointer to port])

      Examples:
      RiCIS_PORT(me->myPort)
      This returns True if the event currently being handled by theRhapsody Developer for C Reactive (instantiated as me) was sent through the port myPort.

      For ports with multiplicity greater than one:
      RiCIS_PORT(me->myPort[2])