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 OHOS_MEMORY_MEMMGR_COMMON_INCLUDE_CONFIG_NAND_LIFE_CONFIG_H 17 #define OHOS_MEMORY_MEMMGR_COMMON_INCLUDE_CONFIG_NAND_LIFE_CONFIG_H 18 19 #include <map> 20 #include <string> 21 #include <set> 22 #include "event_handler.h" 23 #include "libxml/parser.h" 24 #include "libxml/xpath.h" 25 26 namespace OHOS { 27 namespace Memory { 28 class NandLifeConfig { 29 public: 30 void ParseConfig(const xmlNodePtr &rootNodePtr); 31 void SetDailySwapOutQuotaMb(unsigned long long dailySwapOutQuotaMb); 32 unsigned long long GetDailySwapOutQuotaMb(void); 33 void SetTotalSwapOutQuotaMb(unsigned long long totalSwapOutQuotaMb); 34 unsigned long long GetTotalSwapOutQuotaMb(void); 35 void Dump(int fd); 36 37 private: 38 unsigned long long dailySwapOutQuotaMb_ = 0; 39 unsigned long long totalSwapOutQuotaMb_ = 0; 40 }; 41 } // namespace Memory 42 } // namespace OHOS 43 #endif // OHOS_MEMORY_MEMMGR_COMMON_INCLUDE_CONFIG_NAND_LIFE_CONFIG_H