• 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 "face_auth_hdi.h"
22 
23 namespace OHOS {
24 namespace HDI {
25 namespace FaceAuth {
26 using BufferProducerSequenceable = OHOS::HDI::Camera::V1_0::BufferProducerSequenceable;
27 class ExecutorImpl : public IExecutor {
28 public:
29     ExecutorImpl();
30 
31     ~ExecutorImpl() override = default;
32 
33     int32_t GetExecutorInfo(ExecutorInfo &executorInfo) override;
34 
35     int32_t GetTemplateInfo(uint64_t templateId, TemplateInfo &templateInfo) override;
36 
37     int32_t OnRegisterFinish(const std::vector<uint64_t> &templateIdList,
38         const std::vector<uint8_t> &frameworkPublicKey, const std::vector<uint8_t> &extraInfo) override;
39 
40     int32_t Enroll(uint64_t scheduleId, const std::vector<uint8_t> &extraInfo,
41         const sptr<IExecutorCallback> &callbackObj) override;
42 
43     int32_t Authenticate(uint64_t scheduleId, const std::vector<uint64_t> &templateIdList,
44         const std::vector<uint8_t> &extraInfo, const sptr<IExecutorCallback> &callbackObj) override;
45 
46     int32_t Identify(uint64_t scheduleId, const std::vector<uint8_t> &extraInfo,
47         const sptr<IExecutorCallback> &callbackObj) override;
48 
49     int32_t Delete(const std::vector<uint64_t> &templateIdList) override;
50 
51     int32_t Cancel(uint64_t scheduleId) override;
52 
53     int32_t SendCommand(
54         int32_t commandId, const std::vector<uint8_t> &extraInfo, const sptr<IExecutorCallback> &callbackObj) override;
55 
56     int32_t SetBufferProducer(const sptr<BufferProducerSequenceable> &bufferProducer) override;
57 
58     int32_t GetProperty(const std::vector<uint64_t> &templateIdList, const std::vector<GetPropertyType> &propertyTypes,
59         Property &property) override;
60 
61     int32_t SetCachedTemplates(const std::vector<uint64_t> &templateIdList) override;
62 
63     int32_t RegisterSaCommandCallback(const sptr<ISaCommandCallback> &callbackObj) override;
64 
65 private:
66     ExecutorInfo executorInfo_;
67 };
68 } // namespace FaceAuth
69 } // namespace HDI
70 } // namespace OHOS
71 #endif // EXECUTOR_IMPL_H
72