• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 HIVIEW_BASE_EVENT_STORE_INCLUDE_SYS_EVENT_DAO_H
17 #define HIVIEW_BASE_EVENT_STORE_INCLUDE_SYS_EVENT_DAO_H
18 
19 #include <memory>
20 #include <string>
21 #include <vector>
22 
23 #include "sys_event.h"
24 #include "sys_event_query.h"
25 
26 namespace OHOS {
27 namespace HiviewDFX {
28 namespace EventStore {
29 enum class StoreType {
30     FAULT = 1,
31     STATISTIC = 2,
32     SECURITY = 3,
33     BEHAVIOR = 4,
34 };
35 
36 class SysEventDao {
37 public:
38     /* for internal query */
39     static std::shared_ptr<SysEventQuery> BuildQuery(const std::string& domain, const std::vector<std::string>& names);
40 
41     /* for external query */
42     static std::shared_ptr<SysEventQuery> BuildQuery(const std::string& domain,
43         const std::vector<std::string>& names, uint32_t type, int64_t toSeq);
44 
45     static int Insert(std::shared_ptr<SysEvent> sysEvent);
46 
47     static void Clear();
48 }; // SysEventDao
49 } // EventStore
50 } // namespace HiviewDFX
51 } // namespace OHOS
52 #endif // HIVIEW_BASE_EVENT_STORE_INCLUDE_SYS_EVENT_DAO_H
53