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 THERMAL_DEVICE_CONTROL_H 17 #define THERMAL_DEVICE_CONTROL_H 18 19 #include <map> 20 #include <memory> 21 #include <mutex> 22 #include <string> 23 24 #include "ithermal_action.h" 25 26 namespace OHOS { 27 namespace PowerMgr { 28 class ThermalDeviceControl { 29 public: 30 using ThermalActionMap = std::map<std::string, std::shared_ptr<IThermalAction>>; ThermalDeviceControl()31 ThermalDeviceControl() {}; ~ThermalDeviceControl()32 ~ThermalDeviceControl() {}; 33 bool Init(); GetThermalAction()34 ThermalActionMap GetThermalAction() 35 { 36 return thermalActionMap_; 37 } 38 private: 39 ThermalActionMap thermalActionMap_; 40 std::shared_ptr<IThermalAction> thermalAction_; 41 std::string preName_; 42 std::mutex mutex_; 43 }; 44 } // namespace PowerMgr 45 } // namespace OHOs 46 47 #endif // THERMAL_DEVICE_CONTROL_H