Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 1 | ## 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 Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 4 | #include "manager.hpp" |
Brad Bishop | 65ffffa | 2016-11-29 12:31:31 -0500 | [diff] [blame] | 5 | #include "utils.hpp" |
Brad Bishop | 5fbaa7f | 2016-10-31 10:42:41 -0500 | [diff] [blame] | 6 | % for i in interfaces: |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 7 | #include <${i.header()}> |
Brad Bishop | 5fbaa7f | 2016-10-31 10:42:41 -0500 | [diff] [blame] | 8 | % endfor |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 9 | |
| 10 | namespace phosphor |
| 11 | { |
| 12 | namespace inventory |
| 13 | { |
| 14 | namespace manager |
| 15 | { |
| 16 | |
Brad Bishop | 5fbaa7f | 2016-10-31 10:42:41 -0500 | [diff] [blame] | 17 | const Manager::Makers Manager::_makers{ |
| 18 | % for i in interfaces: |
| 19 | { |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 20 | "${str(i)}", |
Brad Bishop | 65ffffa | 2016-11-29 12:31:31 -0500 | [diff] [blame] | 21 | details::MakeInterface< |
Brad Bishop | 451f8d9 | 2016-11-21 14:15:19 -0500 | [diff] [blame] | 22 | details::ServerObject< |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 23 | ${i.namespace()}>>::make, |
Brad Bishop | 5fbaa7f | 2016-10-31 10:42:41 -0500 | [diff] [blame] | 24 | }, |
| 25 | % endfor |
| 26 | }; |
| 27 | |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 28 | const Manager::Events Manager::_events{ |
| 29 | % for e in events: |
| 30 | { |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 31 | % if e.description: |
| 32 | // ${e.description.strip()} |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 33 | % endif |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 34 | std::make_tuple( |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 35 | 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 Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 44 | % else: |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 45 | ${'"{0}=\'{1}\',"'.format(*s)} |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 46 | % endif |
| 47 | % endfor |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 48 | % 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 Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 57 | % else: |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 58 | ${arg.cppArg()}))), |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 59 | % endif |
| 60 | % endfor |
| 61 | % else: |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 62 | details::make_filter( |
| 63 | ${e.filters[0].bare_method()}()), |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 64 | % endif |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 65 | % endif |
| 66 | % endif |
| 67 | } |
| 68 | ), |
Brad Bishop | 9007432 | 2016-11-29 13:05:57 -0500 | [diff] [blame] | 69 | std::vector<details::ActionBasePtr>( |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 70 | { |
| 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 Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 88 | % endif |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 89 | % endif |
| 90 | % endfor |
| 91 | } |
| 92 | ) |
| 93 | ) |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 94 | }, |
Brad Bishop | 22cfbe6 | 2016-11-30 13:25:10 -0500 | [diff] [blame] | 95 | %endfor |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 96 | }; |
| 97 | |
| 98 | } // namespace manager |
| 99 | } // namespace inventory |
| 100 | } // namespace phosphor |