1 /* 2 * Copyright (c) 2023 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_HIVIEWDFX_SYS_EVENT_USER_H 17 #define OHOS_HIVIEWDFX_SYS_EVENT_USER_H 18 19 #include <string> 20 21 namespace OHOS { 22 namespace HiviewDFX { 23 namespace EventThreshold { 24 enum ProcessType { 25 HAP = 1, 26 }; 27 28 struct Configs { 29 size_t queryRuleLimit; 30 }; 31 32 class SysEventUser { 33 public: SysEventUser(const std::string & name,ProcessType type)34 SysEventUser(const std::string& name, ProcessType type) : name_(name), type_(type), configs_({0}) {} SysEventUser()35 SysEventUser() : name_(""), type_(ProcessType::HAP), configs_({0}) {} 36 37 public: 38 void SetName(std::string& name); 39 void GetName(std::string& name); 40 void SetProcessType(ProcessType type); 41 ProcessType GetProcessType(); 42 void SetConfigs(Configs& configs); 43 void GetConfigs(Configs& configs); 44 45 private: 46 std::string name_; 47 ProcessType type_; 48 Configs configs_; 49 }; 50 } // namespace EventThreshold 51 } // namespace HiviewDFX 52 } // namespace OHOS 53 54 #endif // OHOS_HIVIEWDFX_SYS_EVENT_USER_H 55