blob: 862b3b2e6102d8e875b5cf9a4875fd05653944e7 [file] [log] [blame]
Brad Bishop92665b22016-10-26 20:51:16 -05001## This file is a template. The comment below is emitted
2## into the rendered file; feel free to edit this file.
3// This file was auto generated. Do not edit.
Brad Bishop67a5cdb2016-11-22 14:37:53 -05004<%
5 def interface_type(interface):
6 lst = interface.split('.')
7 lst.insert(-1, 'server')
8 return '::'.join(lst)
9%>
Brad Bishop92665b22016-10-26 20:51:16 -050010#include "manager.hpp"
Brad Bishop65ffffa2016-11-29 12:31:31 -050011#include "utils.hpp"
Brad Bishop5fbaa7f2016-10-31 10:42:41 -050012% for i in interfaces:
13#include <${'/'.join(i.split('.') + ['server.hpp'])}>
14% endfor
Brad Bishop92665b22016-10-26 20:51:16 -050015
16namespace phosphor
17{
18namespace inventory
19{
20namespace manager
21{
22
Brad Bishop5fbaa7f2016-10-31 10:42:41 -050023const Manager::Makers Manager::_makers{
24% for i in interfaces:
25 {
26 "${i}",
Brad Bishop65ffffa2016-11-29 12:31:31 -050027 details::MakeInterface<
Brad Bishop451f8d92016-11-21 14:15:19 -050028 details::ServerObject<
29 sdbusplus::${interface_type(i)}>>::make,
Brad Bishop5fbaa7f2016-10-31 10:42:41 -050030 },
31% endfor
32};
33
Brad Bishop92665b22016-10-26 20:51:16 -050034const Manager::Events Manager::_events{
35% for e in events:
36 {
37 % if e.get('description'):
38 // ${e['description']}
39 % endif
Brad Bishop92665b22016-10-26 20:51:16 -050040 std::make_tuple(
41 % for i, s in enumerate(e['signature'].items()):
42 % if i + 1 == len(e['signature']):
43 ${'"{0}=\'{1}\'"'.format(*s)},
44 % else:
45 ${'"{0}=\'{1}\',"'.format(*s)}
46 % endif
47 % endfor
48 % if e['filter'].get('args'):
Brad Bishop65ffffa2016-11-29 12:31:31 -050049 details::make_filter(filters::${e['filter']['type']}(
Brad Bishop92665b22016-10-26 20:51:16 -050050 % for i, a in enumerate(e['filter']['args']):
51 % if i + 1 == len(e['filter']['args']):
Brad Bishop65ffffa2016-11-29 12:31:31 -050052 "${a['value']}")),
Brad Bishop92665b22016-10-26 20:51:16 -050053 % else:
54 "${a['value']}",
55 % endif
56 % endfor
57 % else:
Brad Bishop65ffffa2016-11-29 12:31:31 -050058 details::make_filter(filters::${e['filter']['type']}),
Brad Bishop92665b22016-10-26 20:51:16 -050059 % endif
60 % if e['action'].get('args'):
Brad Bishop90074322016-11-29 13:05:57 -050061 std::vector<details::ActionBasePtr>({details::make_action(actions::${e['action']['type']}(
Brad Bishop92665b22016-10-26 20:51:16 -050062 % for i, a in enumerate(e['action']['args']):
63 % if i + 1 == len(e['action']['args']):
Brad Bishop90074322016-11-29 13:05:57 -050064 "${a['value']}"))})
Brad Bishop92665b22016-10-26 20:51:16 -050065 % else:
66 "${a['value']}",
67 % endif
68 % endfor
69 % else:
Brad Bishop90074322016-11-29 13:05:57 -050070 std::vector<details::ActionBasePtr>(
71 {details::make_action(actions::${e['action']['type']})})
Brad Bishop92665b22016-10-26 20:51:16 -050072 % endif
73 ),
74 },
75% endfor
76};
77
78} // namespace manager
79} // namespace inventory
80} // namespace phosphor