• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 EXECUTOR_IMPL_H
17 #define EXECUTOR_IMPL_H
18 
19 #include <vector>
20 
21 #include "v1_0/iexecutor.h"
22 
23 namespace OHOS {
24 namespace HDI {
25 namespace FaceAuth {
26 namespace V1_0 {
27 using BufferProducerSequenceable = OHOS::HDI::Camera::V1_0::BufferProducerSequenceable;
28 class ExecutorImpl : public IExecutor {
29 public:
30     ExecutorImpl();
31 
32     virtual ~ExecutorImpl() = default;
33 
34     int32_t GetExecutorInfo(ExecutorInfo &executorInfo) override;
35 
36     int32_t GetTemplateInfo(uint64_t templateId, TemplateInfo &templateInfo) override;
37 
38     int32_t OnRegisterFinish(const std::vector<uint64_t> &templateIdList,
39         const std::vector<uint8_t> &frameworkPublicKey, const std::vector<uint8_t> &extraInfo) override;
40 
41     int32_t Enroll(uint64_t scheduleId, const std::vector<uint8_t> &extraInfo,
42         const sptr<IExecutorCallback> &callbackObj) override;
43 
44     int32_t Authenticate(uint64_t scheduleId, const std::vector<uint64_t> &templateIdList,
45         const std::vector<uint8_t> &extraInfo, const sptr<IExecutorCallback> &callbackObj) override;
46 
47     int32_t Identify(uint64_t scheduleId, const std::vector<uint8_t> &extraInfo,
48         const sptr<IExecutorCallback> &callbackObj) override;
49 
50     int32_t Delete(const std::vector<uint64_t> &templateIdList) override;
51 
52     int32_t Cancel(uint64_t scheduleId) override;
53 
54     int32_t SendCommand(
55         int32_t commandId, const std::vector<uint8_t> &extraInfo, const sptr<IExecutorCallback> &callbackObj) override;
56 
57     int32_t SetBufferProducer(const sptr<BufferProducerSequenceable> &bufferProducer) override;
58 
59 private:
60     struct ExecutorInfo executorInfo_;
61 };
62 } // namespace V1_0
63 } // namespace FaceAuth
64 } // namespace HDI
65 } // namespace OHOS
66 #endif // EXECUTOR_IMPL_H
67