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 SAMPLE_PLUGIN_2_H
17 #define SAMPLE_PLUGIN_2_H
18 
19 #include <cstring>
20 
21 #include "plugin/i_plugin.h"
22 
23 namespace OHOS {
24 namespace AI {
25 class SamplePlugin2 : public IPlugin {
26 public:
27     SamplePlugin2();
28 
29     ~SamplePlugin2() override;
30 
31     const long long GetVersion() const override;
32 
33     const char *GetName() const override;
34 
35     const char *GetInferMode() const override;
36 
37     int SyncProcess(IRequest *request, IResponse *&response) override;
38 
39     int AsyncProcess(IRequest *request, IPluginCallback *callback) override;
40 
41     int Prepare(long long transactionId, const DataInfo &inputInfo, DataInfo &outputInfo) override;
42 
43     int Release(bool isFullUnload, long long transactionId, const DataInfo &inputInfo) override;
44 
45     int SetOption(int optionType, const DataInfo &inputInfo) override;
46 
47     int GetOption(int optionType, const DataInfo &inputInfo, DataInfo &outputInfo) override;
48 
49 private:
50     DataInfo optionData_ {};
51 };
52 }
53 }
54 
55 #endif // SAMPLE_PLUGIN_2_H
56