• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 TEST_WUKONG_DATA_SET_H
17 #define TEST_WUKONG_DATA_SET_H
18 
19 #include <map>
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include "filter.h"
25 #include "format.h"
26 #include "statistics.h"
27 #include "table.h"
28 #include "wukong_define.h"
29 namespace OHOS {
30 namespace WuKong {
31 class DataSet {
32 public:
33     DataSet() = default;
34     ~DataSet() = default;
35     void FilterData(std::map<std::string, std::string> data);
36     void SetFilterType(std::string filterType);
37     void SetFilterStragety(std::shared_ptr<Filter> filter);
38     void StatisticsData();
39     void SetStatisticsStragety(std::shared_ptr<Statistics> statistics);
40     void FormatData(std::string name, std::string &content);
41     void SetFormatStragety(std::shared_ptr<Format> format);
42 private:
43     // filtered data vector
44     std::vector<std::map<std::string, std::string>> dataVector_;
45     std::shared_ptr<Filter> filter_ = nullptr;
46     std::shared_ptr<Format> format_;
47     std::shared_ptr<Statistics> statistics_ = nullptr;
48     // filtered data vector statistical processing tables
49     std::map<std::string, std::shared_ptr<Table>> tables_;
50     std::string filterType_;
51 };
52 }  // namespace WuKong
53 }  // namespace OHOS
54 #endif
55