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 <set> 21 #include <string> 22 23 #include "event_handler.h" 24 #include "libxml/parser.h" 25 #include "libxml/xpath.h" 26 27 namespace OHOS { 28 namespace Memory { 29 class SystemMemoryLevelConfig { 30 public: 31 void ParseConfig(const xmlNodePtr &rootNodePtr); 32 void SetPurgeable(unsigned int purgeable); 33 unsigned int GetPurgeable(void); 34 void SetModerate(unsigned int moderate); 35 unsigned int GetModerate(void); 36 void SetLow(unsigned int low); 37 unsigned int GetLow(void); 38 void SetCritical(unsigned int critical); 39 unsigned int GetCritical(void); 40 void Dump(int fd); 41 42 private: 43 unsigned int purgeable_ = 0; 44 unsigned int moderate_ = 0; 45 unsigned int low_ = 0; 46 unsigned int critical_ = 0; 47 }; 48 } // namespace Memory 49 } // namespace OHOS 50 #endif // OHOS_MEMORY_MEMMGR_COMMON_INCLUDE_CONFIG_SYSTEM_MEMORY_LEVEL_CONFIG_H