Statecharts The following sample code shows the event discharge , which has one argument called color . The code was generated in the header file for the Default package: //------------------------------------------------------- // Default.h //------------------------------------------------------- class discharge; class Firecracker; enum Colors {red, green, blue}; class discharge : public OMEvent { DECLARE_META_EVENT //// User explicit entries //// public : Colors color; //// User implicit entries //// public : // Constructors and destructors: discharge(); //// Framework entries //// public :
discharge(Colors p_color); // This constructor is need in code instrumentation discharge(int p_color); }; When the Firecracker event queue is ready to take the event discharge , it calls SETPARAMS(discharge) . SETPARAMS is a macro defined in oxf\state.h as follows: #define SETPARAMS(type) type *params; params=(type*)event Calling SETPARAMS(discharge) allocates a variable params of type pointer to an event of type discharge . This enables you to use params->color in the action part of the transition as a short- hand notation for discharge->color . 784 User Guide