Program by using port APIs in C++

This section describes the basic APIs used to exchange messages with and instantiate ports.
Note: The following example is not complete; it is simply a reference for the subsequent table of API calls.

Consider the following example:

Example to show reference for table of API calls

The following table shows the calls to use to perform the specified tasks.

Table 1. List of API calls to use to exchange messages with and instantiate ports
Task Call
Call an operation. OUT_PORT(src)->f();
Send an event from a to b using the ports. OUT_PORT(src)->GEN(evt);
Listen for an event from port src to port mon. evt[IS_PORT(mon)]/doYourStuff();

You could also use the OPORT macro, which is equivalent to OUT_PORT.


Feedback