blob: a024d192b522a7bd43ef9e6c3f00de5ac2257319 [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 Bishop92665b22016-10-26 20:51:16 -05004#include "manager.hpp"
Brad Bishop65ffffa2016-11-29 12:31:31 -05005#include "utils.hpp"
Brad Bishop5fbaa7f2016-10-31 10:42:41 -05006% for i in interfaces:
Brad Bishop22cfbe62016-11-30 13:25:10 -05007#include <${i.header()}>
Brad Bishop5fbaa7f2016-10-31 10:42:41 -05008% endfor
Brad Bishop92665b22016-10-26 20:51:16 -05009
10namespace phosphor
11{
12namespace inventory
13{
14namespace manager
15{
16
Brad Bishop5fbaa7f2016-10-31 10:42:41 -050017const Manager::Makers Manager::_makers{
18% for i in interfaces:
19 {
Brad Bishop22cfbe62016-11-30 13:25:10 -050020 "${str(i)}",
Brad Bishop65ffffa2016-11-29 12:31:31 -050021 details::MakeInterface<
Brad Bishop451f8d92016-11-21 14:15:19 -050022 details::ServerObject<
Brad Bishop22cfbe62016-11-30 13:25:10 -050023 ${i.namespace()}>>::make,
Brad Bishop5fbaa7f2016-10-31 10:42:41 -050024 },
25% endfor
26};
27
Brad Bishop92665b22016-10-26 20:51:16 -050028const Manager::Events Manager::_events{
29% for e in events:
30 {
Brad Bishop22cfbe62016-11-30 13:25:10 -050031 % if e.description:
32 // ${e.description.strip()}
Brad Bishop92665b22016-10-26 20:51:16 -050033 % endif
Brad Bishop92665b22016-10-26 20:51:16 -050034 std::make_tuple(
Brad Bishop22cfbe62016-11-30 13:25:10 -050035 std::vector<details::EventBasePtr>(
36 {
37 % if e.cls == 'match':
38 std::make_shared<details::DbusSignal>(
39 % for i, s in enumerate(e.signatures[0].sig.items()):
40 % if i == 0:
41 ${'"{0}=\'{1}\',"'.format(*s)}
42 % elif i + 1 == len(e.signatures[0].sig):
43 ${'"{0}=\'{1}\'"'.format(*s)},
Brad Bishop92665b22016-10-26 20:51:16 -050044 % else:
Brad Bishop22cfbe62016-11-30 13:25:10 -050045 ${'"{0}=\'{1}\',"'.format(*s)}
Brad Bishop92665b22016-10-26 20:51:16 -050046 % endif
47 % endfor
Brad Bishop22cfbe62016-11-30 13:25:10 -050048 % if e.filters[0].pointer:
49 details::make_filter(${e.filters[0].bare_method()})),
50 % else:
51 % if e.filters[0].args:
52 details::make_filter(
53 ${e.filters[0].bare_method()}(
54 % for i, arg in enumerate(e.filters[0].args):
55 % if i + 1 != len(e.filters[0].args):
56 ${arg.cppArg()},
Brad Bishop92665b22016-10-26 20:51:16 -050057 % else:
Brad Bishop22cfbe62016-11-30 13:25:10 -050058 ${arg.cppArg()}))),
Brad Bishop92665b22016-10-26 20:51:16 -050059 % endif
60 % endfor
61 % else:
Brad Bishop22cfbe62016-11-30 13:25:10 -050062 details::make_filter(
63 ${e.filters[0].bare_method()}()),
Brad Bishop92665b22016-10-26 20:51:16 -050064 % endif
Brad Bishop22cfbe62016-11-30 13:25:10 -050065 % endif
66 % endif
67 }
68 ),
Brad Bishop90074322016-11-29 13:05:57 -050069 std::vector<details::ActionBasePtr>(
Brad Bishop22cfbe62016-11-30 13:25:10 -050070 {
71 % for action in e.actions:
72 % if action.pointer:
73 details::make_action(${action.bare_method()}),
74 % else:
75 % if action.args:
76 details::make_action(
77 ${action.bare_method()}(
78 % for i, arg in enumerate(action.args):
79 % if i + 1 != len(action.args):
80 ${arg.cppArg()},
81 % else:
82 ${arg.cppArg()})),
83 % endif
84 % endfor
85 % else:
86 details::make_action(
87 ${action.bare_method()}()),
Brad Bishop92665b22016-10-26 20:51:16 -050088 % endif
Brad Bishop22cfbe62016-11-30 13:25:10 -050089 % endif
90 % endfor
91 }
92 )
93 )
Brad Bishop92665b22016-10-26 20:51:16 -050094 },
Brad Bishop22cfbe62016-11-30 13:25:10 -050095%endfor
Brad Bishop92665b22016-10-26 20:51:16 -050096};
97
98} // namespace manager
99} // namespace inventory
100} // namespace phosphor