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 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef HOS_IPP_ALGO_PARSER_H 18 #define HOS_IPP_ALGO_PARSER_H 19 20 #include "algo_plugin.h" 21 #include "device_resource_if.h" 22 #include <list> 23 #include <map> 24 #include <string> 25 26 namespace OHOS::Camera { 27 using AlgoPluginList = std::list<std::shared_ptr<AlgoPlugin>>; 28 class IppAlgoParser { 29 public: 30 IppAlgoParser(const std::string& pathName); 31 ~IppAlgoParser(); 32 IppAlgoParser(const IppAlgoParser& other) = delete; 33 IppAlgoParser(IppAlgoParser&& other) = delete; 34 IppAlgoParser& operator=(const IppAlgoParser& other) = delete; 35 IppAlgoParser& operator=(IppAlgoParser&& other) = delete; 36 37 public: 38 RetCode Init(); 39 AlgoPluginList ConstructPluginByHcsData(); 40 41 private: 42 std::shared_ptr<AlgoPlugin> ConstructPlugin(const DeviceResourceNode* node); 43 44 private: 45 std::string pathName_ = ""; 46 const DeviceResourceIface* devResInstance_ = nullptr; 47 const DeviceResourceNode* rootNode_ = nullptr; 48 static std::map<std::string, int> algoModeMap_; 49 }; 50 } // namespace OHOS::Camera 51 #endif 52