1 /* 2 * Copyright (c) 2024-2025 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 RESSCHED_SCENE_RECOGNIZE_SCNEE_RECOGNIZER_BASE_H 17 #define RESSCHED_SCENE_RECOGNIZE_SCNEE_RECOGNIZER_BASE_H 18 19 #include <string> 20 #include <unordered_set> 21 22 #include "nlohmann/json.hpp" 23 24 25 namespace OHOS { 26 namespace ResourceSchedule { 27 class SceneRecognizerBase { 28 public: 29 virtual ~SceneRecognizerBase() = default; 30 virtual void OnDispatchResource(uint32_t resType, int64_t value, const nlohmann::json& payload) = 0; 31 void AddAcceptResTypes(const std::unordered_set<uint32_t>& types); 32 bool Accept(uint32_t resType); 33 private: 34 std::unordered_set<uint32_t> acceptRes_; 35 }; 36 } // namespace ResourceSchedule 37 } // namespace OHOS 38 #endif // RESSCHED_SCENE_RECOGNIZE_SCNEE_RECOGNIZER_BASE_H