blob: 63bc7886029de44c972e2426a4337b08ef0dd185 [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 Williams178e8fc2016-10-17 16:37:24 -050026const vtable::vtable_t ${classname}::_vtable[] = {
27 vtable::start(),
28 % for m in interface.methods:
29${ m.cpp_prototype(loader, interface=interface, ptype='vtable') }
30 % endfor
31 vtable::end()
32};
33
Patrick Williams831839a2016-10-16 18:09:00 -050034 % for s in namespaces:
35} // namespace ${s}
36 % endfor
37} // namespace server
38} // namespace sdbusplus