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 | 5fbaa7f | 2016-10-31 10:42:41 -0500 | [diff] [blame] | 11 | % for i in interfaces: |
| 12 | #include <${'/'.join(i.split('.') + ['server.hpp'])}> |
| 13 | % endfor |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 14 | |
| 15 | namespace phosphor |
| 16 | { |
| 17 | namespace inventory |
| 18 | { |
| 19 | namespace manager |
| 20 | { |
| 21 | |
Brad Bishop | 5fbaa7f | 2016-10-31 10:42:41 -0500 | [diff] [blame] | 22 | const Manager::Makers Manager::_makers{ |
| 23 | % for i in interfaces: |
| 24 | { |
| 25 | "${i}", |
| 26 | details::interface::holder::Holder< |
Brad Bishop | 67a5cdb | 2016-11-22 14:37:53 -0500 | [diff] [blame^] | 27 | sdbusplus::${interface_type(i)}>::make, |
Brad Bishop | 5fbaa7f | 2016-10-31 10:42:41 -0500 | [diff] [blame] | 28 | }, |
| 29 | % endfor |
| 30 | }; |
| 31 | |
Brad Bishop | 92665b2 | 2016-10-26 20:51:16 -0500 | [diff] [blame] | 32 | const 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 |