The event handler function of an instruction meta-class can process events with types represented by macros listed below.
Event type is available in mehcall->evt, where mehcall is an argument of that event handler function.
Instruction meta-class initialization.
The function qsmm_reg_instr_meta_class called to register the instruction meta-class sends this event.
Instruction meta-class uninitialization.
The function qsmm_destroy called to destroy the multinode model sends this event to all registered instruction meta-class event handlers.
This event can trigger deallocating resources allocated on preparing the multinode model or processing the event QSMM_EVT_ENT_INIT.
Instruction class initialization.
The function qsmm_reg_instr_class_v2 (see Registering Instruction Classes) called to register an individual instruction class derived from the instruction meta-class sends this event.
Handling this event typically includes the following operations:
qsmm_set_mehcall_instr_param_f if the instruction has parameters (see Setting Text Instruction Parameters);
qsmm_set_mehcall_noutcome if the instruction has more than one outcome or should behave depending on the outcome of the previous instruction invoked (see Setting the Number of Instruction Outcomes).
Instruction class uninitialization.
The function qsmm_destroy called to destroy the multinode model sends this event to instruction meta-class event handlers for individual instruction classes registered by the function qsmm_reg_instr_class_v2 and then sends the event QSMM_EVT_ENT_DONE to the event handlers.
This event can trigger the uninitialization of binary instruction class parameters (see Accessing Binary Instruction Parameters) and the deallocation of additional resources associated with the instruction class allocated on processing the event QSMM_EVT_INSTR_CLASS_INIT.
Model instance initialization.
The function qsmm_engine_create called to create the model instance sends this event to all registered instruction meta-class event handlers at the end of execution of that function.
Model instance uninitialization.
The function qsmm_engine_destroy called to destroy the model instance sends this event to all registered instruction meta-class event handlers at the beginning of execution of that function in reverse order relative to the order of sending events QSMM_EVT_ENGINE_INIT.
The function qsmm_engine_create calls qsmm_engine_destroy implicitly when recreating the model instance.
The function qsmm_destroy calls qsmm_engine_destroy implicitly when destroying the multinode model.
This event can trigger deallocating resources allocated on preparing the model instance or processing the event QSMM_EVT_ENGINE_INIT.
Instruction invocation.
See Handling Instruction Invocation.
On emitting an individual instruction class by the instruction emitting engine, the function qsmm_node_call_default sends this event to the event handler of instruction meta-class of the instruction class.
On emitting an instruction class sequence, qsmm_node_call_default sends this event to instruction meta-class event handlers for all instruction classes in the sequence.
On successful completion, the event handler function shall return a non-negative value.
A specific non-negative value has no effect on model operation.
On error, the event handler function shall return a negative value.
This negative value causes the invocation of an error handler function with passing QSMM_ERR_EVTHNDLR to it if the model has an error handler set.