Line data Source code
1 : //
2 : // Author: Vladimir Migashko <migashko@gmail.com>, (C) 2013-2018
3 : //
4 : // Copyright: See COPYING file that comes with this distribution
5 : //
6 :
7 : #pragma once
8 :
9 : #include "statlog_config.hpp"
10 : #include <wfc/json.hpp>
11 :
12 : namespace wfc{ namespace core{
13 :
14 : struct statlog_config_json
15 : {
16 0 : JSON_NAME(perseconds)
17 0 : JSON_NAME(seconds)
18 0 : JSON_NAME(milliseconds)
19 0 : JSON_NAME(microseconds)
20 0 : JSON_NAME(nanoseconds)
21 0 : JSON_NAME(hide)
22 :
23 : typedef json::enumerator<
24 : int,
25 : json::member_list<
26 : json::enum_value<n_hide, int, -1>,
27 : json::enum_value<n_perseconds, int, 0>,
28 : json::enum_value<n_nanoseconds, int, 1>,
29 : json::enum_value<n_microseconds, int, 1000>,
30 : json::enum_value<n_milliseconds, int, 1000000>,
31 : json::enum_value<n_seconds, int, 1000000000>
32 : >
33 : > enum_json;
34 :
35 0 : JSON_NAME(target)
36 0 : JSON_NAME(common_log)
37 0 : JSON_NAME(legend_log)
38 0 : JSON_NAME(table_log)
39 0 : JSON_NAME(log_metric)
40 :
41 : typedef json::object<
42 : statlog_config,
43 : json::member_list<
44 : json::member< n_target, statlog_config, std::string, &statlog_config::target>,
45 : json::member< n_common_log, statlog_config, std::string, &statlog_config::common_log>,
46 : json::member< n_legend_log, statlog_config, std::string, &statlog_config::legend_log>,
47 : json::member< n_table_log, statlog_config, std::string, &statlog_config::table_log>,
48 : json::member< n_log_metric, statlog_config, int, &statlog_config::log_metric, enum_json>
49 : >
50 : > type;
51 :
52 : typedef type::target target;
53 : typedef type::serializer serializer;
54 : typedef type::member_list member_list;
55 : };
56 :
57 : }}
|