blob: b772bb7b404cc1c39a2ce686ed7cac5c73200b22 [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 Bishop67a5cdb2016-11-22 14:37:53 -050027 sdbusplus::${interface_type(i)}>::make,
Brad Bishop5fbaa7f2016-10-31 10:42:41 -050028 },
29% endfor
30};
31
Brad Bishop92665b22016-10-26 20:51:16 -050032const Manager::Events Manager::_events{
33% for e in events:
34 {
35 % if e.get('description'):
36 // ${e['description']}
37 % endif
38 "${e['name']}",
39 std::make_tuple(
40 % for i, s in enumerate(e['signature'].items()):
41 % if i + 1 == len(e['signature']):
42 ${'"{0}=\'{1}\'"'.format(*s)},
43 % else:
44 ${'"{0}=\'{1}\',"'.format(*s)}
45 % endif
46 % endfor
47 % if e['filter'].get('args'):
48 filters::${e['filter']['type']}(
49 % for i, a in enumerate(e['filter']['args']):
50 % if i + 1 == len(e['filter']['args']):
51 "${a['value']}"),
52 % else:
53 "${a['value']}",
54 % endif
55 % endfor
56 % else:
57 filters::${e['filter']['type']},
58 % endif
59 % if e['action'].get('args'):
60 actions::${e['action']['type']}(
61 % for i, a in enumerate(e['action']['args']):
62 % if i + 1 == len(e['action']['args']):
63 "${a['value']}")
64 % else:
65 "${a['value']}",
66 % endif
67 % endfor
68 % else:
69 actions::${e['action']['type']}
70 % endif
71 ),
72 },
73% endfor
74};
75
76} // namespace manager
77} // namespace inventory
78} // namespace phosphor