1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef I_CLIENT_CB_H 17 #define I_CLIENT_CB_H 18 19 #include "protocol/struct_definition/aie_info_define.h" 20 21 namespace OHOS { 22 namespace AI { 23 class IClientCb { 24 public: 25 virtual ~IClientCb() = default; 26 27 /** 28 * Called when asynchronous inference is complete. 29 * 30 * @param [in] result The inference results, it'll be freed automatically. 31 * @param [out] resultCode The return code. 32 * @param [out] requestId The request Id, defined in AlgorithmInfo. 33 */ 34 virtual void OnResult(const DataInfo &result, int resultCode, int requestId) = 0; 35 }; 36 37 class IServiceDeadCb { 38 public: 39 virtual ~IServiceDeadCb() = default; 40 41 /** 42 * Called when service dies. 43 */ 44 virtual void OnServiceDead() = 0; 45 }; 46 } // namespace AI 47 } // namespace OHOS 48 49 #endif // I_CLIENT_CB_H 50