blob: 63374dbdaa3a27ee846729dc69b857b9dda233fd [file] [log] [blame]
Patrick Williams0966ce82016-10-17 21:54:09 -05001#include <sdbusplus/server.hpp>
Patrick Williams831839a2016-10-16 18:09:00 -05002#include <${"/".join(interface.name.split('.') + [ 'server.hpp' ])}>
3 <%
4 namespaces = interface.name.split('.')
5 classname = namespaces.pop()
6 %>
7namespace sdbusplus
8{
9namespace server
10{
11 % for s in namespaces:
12namespace ${s}
13{
14 % endfor
Patrick Williamsadc16822016-10-17 14:43:54 -050015
16${classname}::${classname}(bus::bus& bus, const char* path)
17 : _${"_".join(interface.name.split('.'))}_interface(
18 bus, path, _interface, _vtable, this)
19{
20}
21
Patrick Williams831839a2016-10-16 18:09:00 -050022 % for m in interface.methods:
23${ m.cpp_prototype(loader, interface=interface, ptype='callback-cpp') }
24 % endfor
25
Patrick Williams5302a462016-10-18 11:11:51 -050026 % for s in interface.signals:
27${ s.cpp_prototype(loader, interface=interface, ptype='callback-cpp') }
28 % endfor
29
Patrick Williams178e8fc2016-10-17 16:37:24 -050030const vtable::vtable_t ${classname}::_vtable[] = {
31 vtable::start(),
32 % for m in interface.methods:
33${ m.cpp_prototype(loader, interface=interface, ptype='vtable') }
34 % endfor
Patrick Williams5302a462016-10-18 11:11:51 -050035 % for s in interface.signals:
36${ s.cpp_prototype(loader, interface=interface, ptype='vtable') }
37 % endfor
Patrick Williams178e8fc2016-10-17 16:37:24 -050038 vtable::end()
39};
40
Patrick Williams831839a2016-10-16 18:09:00 -050041 % for s in namespaces:
42} // namespace ${s}
43 % endfor
44} // namespace server
45} // namespace sdbusplus