blob: 984f00b795340f30f1b985cee94c50ab59c8a5ca [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
40 "${e['name']}",
41 std::make_tuple(
42 % for i, s in enumerate(e['signature'].items()):
43 % if i + 1 == len(e['signature']):
44 ${'"{0}=\'{1}\'"'.format(*s)},
45 % else:
46 ${'"{0}=\'{1}\',"'.format(*s)}
47 % endif
48 % endfor
49 % if e['filter'].get('args'):
Brad Bishop65ffffa2016-11-29 12:31:31 -050050 details::make_filter(filters::${e['filter']['type']}(
Brad Bishop92665b22016-10-26 20:51:16 -050051 % for i, a in enumerate(e['filter']['args']):
52 % if i + 1 == len(e['filter']['args']):
Brad Bishop65ffffa2016-11-29 12:31:31 -050053 "${a['value']}")),
Brad Bishop92665b22016-10-26 20:51:16 -050054 % else:
55 "${a['value']}",
56 % endif
57 % endfor
58 % else:
Brad Bishop65ffffa2016-11-29 12:31:31 -050059 details::make_filter(filters::${e['filter']['type']}),
Brad Bishop92665b22016-10-26 20:51:16 -050060 % endif
61 % if e['action'].get('args'):
Brad Bishop65ffffa2016-11-29 12:31:31 -050062 details::make_action(actions::${e['action']['type']}(
Brad Bishop92665b22016-10-26 20:51:16 -050063 % for i, a in enumerate(e['action']['args']):
64 % if i + 1 == len(e['action']['args']):
Brad Bishop65ffffa2016-11-29 12:31:31 -050065 "${a['value']}"))
Brad Bishop92665b22016-10-26 20:51:16 -050066 % else:
67 "${a['value']}",
68 % endif
69 % endfor
70 % else:
Brad Bishop65ffffa2016-11-29 12:31:31 -050071 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