You copied the Doc URL to your clipboard.

API functionsfor managing event callbacks

SoC Designer enables you to register callbacks for the following events:

  • Start or stopof simulation (SimStatusListener).
  • Reset of simulation (ResetListener).
  • Begin of simulation cycle (CycleStartListener).
  • End of communicate phase (EndOfCommunicateListener).
  • End of simulation cycle (CycleListener).
  • Simulator is about to quit (SimQuitListener).

The callback interfaces are implemented using C++ classesthat handle the callbacks. Each callback event type provides itsown pure virtual interface. The callback handlers can be registeredby using one of the following functions:

  • simulator->registerStatusListener(MyStatusListener);
  • simulator->registerResetListener(MyResetListener);
  • simulator->registerCycleStartListener(MyCycleStartListener);
  • simulator->registeEndOfCommunicateListener(MyEndOfCommunicateListener);
  • simulator->registerCycleListener(MyCycleListener);
  • simulator->registerSimQuitListener(MySimQuitListener);

To register a callback:

  1. Createan object that inherits from the appropriate listener class.
  2. Implement the callback function associated withthe listener class.
  3. Register the callback by calling the appropriate registerTypeListener() methodof the MxSimAPI object with your listener object as the parameter.

To unregister a callback handler added by registerTypeListener(),call the corresponding unregisterTypeListener() function.

Was this page helpful? Yes No