blob: e1925a2874db0cc472b4b2613f3f5c9137eee613 [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 Bishop5fbaa7f2016-10-31 10:42:41 -050011% for i in interfaces:
12#include <${'/'.join(i.split('.') + ['server.hpp'])}>
13% endfor
Brad Bishop92665b22016-10-26 20:51:16 -050014
15namespace phosphor
16{
17namespace inventory
18{
19namespace manager
20{
21
Brad Bishop5fbaa7f2016-10-31 10:42:41 -050022const Manager::Makers Manager::_makers{
23% for i in interfaces:
24 {
25 "${i}",
26 details::interface::holder::Holder<
Brad Bishop451f8d92016-11-21 14:15:19 -050027 details::ServerObject<
28 sdbusplus::${interface_type(i)}>>::make,
Brad Bishop5fbaa7f2016-10-31 10:42:41 -050029 },
30% endfor
31};
32
Brad Bishop92665b22016-10-26 20:51:16 -050033const Manager::Events Manager::_events{
34% for e in events:
35 {
36 % if e.get('description'):
37 // ${e['description']}
38 % endif
39 "${e['name']}",
40 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'):
49 filters::${e['filter']['type']}(
50 % for i, a in enumerate(e['filter']['args']):
51 % if i + 1 == len(e['filter']['args']):
52 "${a['value']}"),
53 % else:
54 "${a['value']}",
55 % endif
56 % endfor
57 % else:
58 filters::${e['filter']['type']},
59 % endif
60 % if e['action'].get('args'):
61 actions::${e['action']['type']}(
62 % for i, a in enumerate(e['action']['args']):
63 % if i + 1 == len(e['action']['args']):
64 "${a['value']}")
65 % else:
66 "${a['value']}",
67 % endif
68 % endfor
69 % else:
70 actions::${e['action']['type']}
71 % endif
72 ),
73 },
74% endfor
75};
76
77} // namespace manager
78} // namespace inventory
79} // namespace phosphor