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 | 67a5cdb | 2016-11-22 14:37:53 -0500 | [diff] [blame] | 4 | <% |
| 5 | def interface_type(interface): |
| 6 | lst = interface.split('.') |
| 7 | lst.insert(-1, 'server') |
| 8 | return '::'.join(lst) |
| 9 | %> |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 10 | #include "manager.hpp" |
Brad Bishop | 65ffffa | 2016-11-29 12:31:31 -0500 | [diff] [blame] | 11 | #include "utils.hpp" |
Brad Bishop | 5fbaa7f | 2016-10-31 10:42:41 -0500 | [diff] [blame] | 12 | % for i in interfaces: |
| 13 | #include <${'/'.join(i.split('.') + ['server.hpp'])}> |
| 14 | % endfor |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 15 | |
| 16 | namespace phosphor |
| 17 | { |
| 18 | namespace inventory |
| 19 | { |
| 20 | namespace manager |
| 21 | { |
| 22 | |
Brad Bishop | 5fbaa7f | 2016-10-31 10:42:41 -0500 | [diff] [blame] | 23 | const Manager::Makers Manager::_makers{ |
| 24 | % for i in interfaces: |
| 25 | { |
| 26 | "${i}", |
Brad Bishop | 65ffffa | 2016-11-29 12:31:31 -0500 | [diff] [blame] | 27 | details::MakeInterface< |
Brad Bishop | 451f8d9 | 2016-11-21 14:15:19 -0500 | [diff] [blame] | 28 | details::ServerObject< |
| 29 | sdbusplus::${interface_type(i)}>>::make, |
Brad Bishop | 5fbaa7f | 2016-10-31 10:42:41 -0500 | [diff] [blame] | 30 | }, |
| 31 | % endfor |
| 32 | }; |
| 33 | |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 34 | const Manager::Events Manager::_events{ |
| 35 | % for e in events: |
| 36 | { |
| 37 | % if e.get('description'): |
| 38 | // ${e['description']} |
| 39 | % endif |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 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'): |
Brad Bishop | 65ffffa | 2016-11-29 12:31:31 -0500 | [diff] [blame] | 49 | details::make_filter(filters::${e['filter']['type']}( |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 50 | % for i, a in enumerate(e['filter']['args']): |
| 51 | % if i + 1 == len(e['filter']['args']): |
Brad Bishop | 65ffffa | 2016-11-29 12:31:31 -0500 | [diff] [blame] | 52 | "${a['value']}")), |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 53 | % else: |
| 54 | "${a['value']}", |
| 55 | % endif |
| 56 | % endfor |
| 57 | % else: |
Brad Bishop | 65ffffa | 2016-11-29 12:31:31 -0500 | [diff] [blame] | 58 | details::make_filter(filters::${e['filter']['type']}), |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 59 | % endif |
| 60 | % if e['action'].get('args'): |
Brad Bishop | 9007432 | 2016-11-29 13:05:57 -0500 | [diff] [blame] | 61 | std::vector<details::ActionBasePtr>({details::make_action(actions::${e['action']['type']}( |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 62 | % for i, a in enumerate(e['action']['args']): |
| 63 | % if i + 1 == len(e['action']['args']): |
Brad Bishop | 9007432 | 2016-11-29 13:05:57 -0500 | [diff] [blame] | 64 | "${a['value']}"))}) |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 65 | % else: |
| 66 | "${a['value']}", |
| 67 | % endif |
| 68 | % endfor |
| 69 | % else: |
Brad Bishop | 9007432 | 2016-11-29 13:05:57 -0500 | [diff] [blame] | 70 | std::vector<details::ActionBasePtr>( |
| 71 | {details::make_action(actions::${e['action']['type']})}) |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 72 | % endif |
| 73 | ), |
| 74 | }, |
| 75 | % endfor |
| 76 | }; |
| 77 | |
| 78 | } // namespace manager |
| 79 | } // namespace inventory |
| 80 | } // namespace phosphor |