blob: 8534674a0fe605771f8a7d338360071f0fee0bec [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(
Brad Bishop68c80832016-11-29 16:41:32 -050041 std::vector<details::EventBasePtr>({
42 std::make_shared<details::DbusSignal>(
Brad Bishop92665b22016-10-26 20:51:16 -050043 % for i, s in enumerate(e['signature'].items()):
44 % if i + 1 == len(e['signature']):
45 ${'"{0}=\'{1}\'"'.format(*s)},
46 % else:
47 ${'"{0}=\'{1}\',"'.format(*s)}
48 % endif
49 % endfor
50 % if e['filter'].get('args'):
Brad Bishop4f20a3e2016-11-29 15:21:46 -050051 details::make_filter(filters::${e['filter']['type']}(
Brad Bishop92665b22016-10-26 20:51:16 -050052 % for i, a in enumerate(e['filter']['args']):
53 % if i + 1 == len(e['filter']['args']):
Brad Bishop68c80832016-11-29 16:41:32 -050054 "${a['value']}")))}),
Brad Bishop92665b22016-10-26 20:51:16 -050055 % else:
56 "${a['value']}",
57 % endif
58 % endfor
59 % else:
Brad Bishop68c80832016-11-29 16:41:32 -050060 details::make_filter(filters::${e['filter']['type']}))}),
Brad Bishop92665b22016-10-26 20:51:16 -050061 % endif
62 % if e['action'].get('args'):
Brad Bishop90074322016-11-29 13:05:57 -050063 std::vector<details::ActionBasePtr>({details::make_action(actions::${e['action']['type']}(
Brad Bishop92665b22016-10-26 20:51:16 -050064 % for i, a in enumerate(e['action']['args']):
65 % if i + 1 == len(e['action']['args']):
Brad Bishop90074322016-11-29 13:05:57 -050066 "${a['value']}"))})
Brad Bishop92665b22016-10-26 20:51:16 -050067 % else:
68 "${a['value']}",
69 % endif
70 % endfor
71 % else:
Brad Bishop90074322016-11-29 13:05:57 -050072 std::vector<details::ActionBasePtr>(
73 {details::make_action(actions::${e['action']['type']})})
Brad Bishop92665b22016-10-26 20:51:16 -050074 % endif
75 ),
76 },
77% endfor
78};
79
80} // namespace manager
81} // namespace inventory
82} // namespace phosphor