Trace Parser: add python output support
[platform/core/system/swap-manager.git] / src / cli / trace_parser / exe / writer_py.h
1 /*
2  *  SWAP Trace Parser
3  *
4  * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:
7  *
8  * Alexander Aksenov <a.aksenov@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  * Contributors:
23  * - Samsung RnD Institute Russia
24  *
25  */
26
27
28
29 #ifndef __WRITER_PY_H__
30 #define __WRITER_PY_H__
31
32
33 #include <data_writer.h>
34
35
36 class DataWriterPython: public DataWriter
37 {
38 public:
39     using DataWriter::DataWriter;
40
41     void start_file(const uint32_t version);
42     void finish_file();
43
44     void start_msg();
45     void finish_msg();
46
47     void output_val(const std::string &name, const uint8_t val);
48     void output_val(const std::string &name, const uint32_t val);
49     void output_val(const std::string &name, const uint64_t val);
50     void output_val(const std::string &name, const float val);
51     void output_val(const std::string &name, const double val);
52     void output_val(const std::string &name, const std::string &val);
53     void output_val(const std::string &name, const char val);
54     void output_val(const std::string &name, const int val);
55
56     void output_hex(const std::string &name, const uint32_t val);
57     void output_hex(const std::string &name, const uint64_t val);
58
59     void output_args(const std::string &name, const bool val);
60     void output_args(const std::string &name, const uint8_t val);
61     void output_args(const std::string &name, const uint32_t val);
62     void output_args(const std::string &name, const uint64_t val);
63     void output_args(const std::string &name, const float val);
64     void output_args(const std::string &name, const double val);
65     void output_args(const std::string &name, const std::string &val);
66     void output_args(const std::string &name);
67     void output_args(const std::string &name, const std::vector<float> &val,
68                     uint64_t p);
69     void output_args(const std::string &name, const std::vector<uint32_t> &val,
70                     uint64_t p);
71     void output_args_hex(const std::string &name, const uint64_t val);
72
73     void output_time(const std::string &name, const uint64_t val);
74     void output_buf(const std::vector<char> &buf);
75     void start_array(const std::string &name);
76     void finish_array();
77     void start_object(const std::string &name);
78     void finish_object();
79 };
80
81 #endif /* __WRITER_PY_H__ */