Updated on 2022-03-13 GMT+08:00

IAIListener

Provides IAIListener when the Process interface is asynchronously called, used for callback notification after model execution is complete. The details are as follows. This data type is defined in ai_nn_node.h.

/*
* Asynchronous callback interface, which is implemented by the caller
*/
class IAIListener
{
public:
    virtual ~IAIListener(){}
    /*
   * @brief  Asynchronous callback interface
   * @param [in] context   Context information, including variable parameter configurations when the NNNode is running
    * @param [in] result  Task status when the execution is complete
    * @param [in] out_data   Output data when the execution is complete 
    */
    virtual void OnProcessDone(const AIContext &context, int result,-
        const std::vector<std::shared_ptr<IAITensor>> &out_data) = 0;
    / *
      * @brief   Service death callback interface. When the client is suspended from the server, the application is notified.
      */
    virtual void OnServiceDied() {};
};