1 /* 2 * Copyright (c) 2021-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 HISYSEVENT_BASE_MANAGER_H 17 #define HISYSEVENT_BASE_MANAGER_H 18 19 #include <string> 20 #include <vector> 21 22 #include "hisysevent_base_listener.h" 23 #include "hisysevent_base_query_callback.h" 24 #include "hisysevent_rules.h" 25 26 namespace OHOS { 27 namespace HiviewDFX { 28 class HiSysEventBaseManager { 29 public: 30 HiSysEventBaseManager() = default; ~HiSysEventBaseManager()31 ~HiSysEventBaseManager() {} 32 33 public: 34 static int32_t AddListener(std::shared_ptr<HiSysEventBaseListener> listener, 35 std::vector<ListenerRule>& rules); 36 static int32_t RemoveListener(std::shared_ptr<HiSysEventBaseListener> listener); 37 static int32_t Query(struct QueryArg& arg, std::vector<QueryRule>& rules, 38 std::shared_ptr<HiSysEventBaseQueryCallback> callback); 39 static int32_t SetDebugMode(std::shared_ptr<HiSysEventBaseListener> listener, bool mode); 40 static int64_t Export(struct QueryArg& arg, std::vector<QueryRule>& rules); 41 static int64_t Subscribe(std::vector<QueryRule>& rules); 42 static int32_t Unsubscribe(); 43 }; 44 } // namespace HiviewDFX 45 } // namespace OHOS 46 47 #endif // HISYSEVENT_INNER_MANAGER_H 48 49