pimgen: Switch to new Mako templates
A substantial structural update to pimgen.
The existing template and supporting code is difficult
to enhance. Given that the code being generated by
pimgen is primarily a large map, with map elements being
initialized by simple types, initializers lists or the result
of method calls - structure pimgen types in a way that track
these givens.
yaml: Simplify the yaml structures.
MethodCall: become an argument.
Mako: Simplify main template.
Use new convenience types.
Use new decorator types.
Remove unused function throughout.
Change-Id: I1c3c16776ef8d5d7e005142999817e0371f9ce89
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/generated.mako.cpp b/generated.mako.cpp
index a024d19..12d783b 100644
--- a/generated.mako.cpp
+++ b/generated.mako.cpp
@@ -14,6 +14,8 @@
namespace manager
{
+using namespace std::literals::string_literals;
+
const Manager::Makers Manager::_makers{
% for i in interfaces:
{
@@ -31,66 +33,7 @@
% if e.description:
// ${e.description.strip()}
% endif
- std::make_tuple(
- std::vector<details::EventBasePtr>(
- {
- % if e.cls == 'match':
- std::make_shared<details::DbusSignal>(
- % for i, s in enumerate(e.signatures[0].sig.items()):
- % if i == 0:
- ${'"{0}=\'{1}\',"'.format(*s)}
- % elif i + 1 == len(e.signatures[0].sig):
- ${'"{0}=\'{1}\'"'.format(*s)},
- % else:
- ${'"{0}=\'{1}\',"'.format(*s)}
- % endif
- % endfor
- % if e.filters[0].pointer:
- details::make_filter(${e.filters[0].bare_method()})),
- % else:
- % if e.filters[0].args:
- details::make_filter(
- ${e.filters[0].bare_method()}(
- % for i, arg in enumerate(e.filters[0].args):
- % if i + 1 != len(e.filters[0].args):
- ${arg.cppArg()},
- % else:
- ${arg.cppArg()}))),
- % endif
- % endfor
- % else:
- details::make_filter(
- ${e.filters[0].bare_method()}()),
- % endif
- % endif
- % endif
- }
- ),
- std::vector<details::ActionBasePtr>(
- {
- % for action in e.actions:
- % if action.pointer:
- details::make_action(${action.bare_method()}),
- % else:
- % if action.args:
- details::make_action(
- ${action.bare_method()}(
- % for i, arg in enumerate(action.args):
- % if i + 1 != len(action.args):
- ${arg.cppArg()},
- % else:
- ${arg.cppArg()})),
- % endif
- % endfor
- % else:
- details::make_action(
- ${action.bare_method()}()),
- % endif
- % endif
- % endfor
- }
- )
- )
+ ${e.call(loader, indent=indent +2)},
},
%endfor
};