Using the generated helper functions
You can use the several helper functions that IBM® Engineering Systems Design Rhapsody® generates on Rhapsody implementation blocks (RIMBs). The helper functions can be called in active operations.
Helper functions are categorized as follows:
- Receivers that read data on receiver ports. These functions hide the complexity of the Runtime Environment (RTE) APIs. With some restrictions, they can be used to change the access mode without changing the users' access code.
- Senders that send data or events on sender ports
- Handlers that handle received data or events
- Receiver-and-handlers that read and handle data or events
- Callers that call required (client) services
Except for handlers, all helper functions return the status that is returned from the Runtime Environment function that they call in their implementation.
The following table lists each helper function and what it does.
Helper function | Explanation |
---|---|
receiveData_p_x (int* const x) |
Reads the value of attribute x on receiver port p and puts it in parameter x. This function is generated only when p.x is typed by a C type, not an event. |
receiveEvent_p_x (int* const x) |
Reads the value of attribute x on receiver port p and
puts it in parameter x. This function is generated only when
p.x is typed by a Rhapsody event.
Typically receiveAndHandleEvent is called directly instead of this
function. |
handleData_p_x (int x) |
Generates only when p.x is
typed by a C type, not an event:
|
handleEvent_p_x() |
Generates only when p.x is
typed by an event ev :
|
receiveAndHandleData_p_x() |
Receives data and immediately handles them. |
receiveAndHandleEvent_p_x() |
Receives events and immediately handles them. |
sendData_p_x(int x) |
Sends the value of the parameter to attribute x on sender port p. This function is generated only when p.x is typed by a C type, not an event. |
sendEvent_p_x() |
Generates only when p.x is
typed by an event ev :
|
call_p_f |
Calls the required operation f on client port p. |