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_SYSTEM_MEMORY_LEVEL_CONFIG_H 17 #define OHOS_MEMORY_MEMMGR_COMMON_INCLUDE_CONFIG_SYSTEM_MEMORY_LEVEL_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 SystemMemoryLevelConfig { 29 public: 30 void ParseConfig(const xmlNodePtr &rootNodePtr); 31 void SetModerate(unsigned int moderate); 32 unsigned int GetModerate(void); 33 void SetLow(unsigned int low); 34 unsigned int GetLow(void); 35 void SetCritical(unsigned int critical); 36 unsigned int GetCritical(void); 37 void Dump(int fd); 38 39 private: 40 unsigned int moderate_ = 0; 41 unsigned int low_ = 0; 42 unsigned int critical_ = 0; 43 }; 44 } // namespace Memory 45 } // namespace OHOS 46 #endif // OHOS_MEMORY_MEMMGR_COMMON_INCLUDE_CONFIG_SYSTEM_MEMORY_LEVEL_CONFIG_H