RiCSETPARAMS() or CSETPARAMS()

The RiCSETPARAMS() statement sets the parameters of an event.

RiCPARAMS() has the same effect as CSETPARAMS(). You do not need to manually write RiCSETPARAMS() in code—it is automatically generated in the dispatchEvent() routine of any event that has arguments.

When the event queue is ready to take an event, it calls RiCSETPARAMS() to allocate a variable params as a pointer to the event. This macro enables you to write the following statement in the guard or action part of a transition to access an argument of the event without repeating the name of the event:

params-><argument>

For example, for a transition on an event ev1 with an argument arg1, you can check whether arg1 is equal to 4 before taking the transition using the following call:

ev1[params->arg1 == 4]

The definition of RiCSETPARAMS() is as follows:

#define RiCSETPARAMS(me,type)   type * params = \
   (type *)((me)->ric_reactive.current_event)

Feedback