blob: 382ae7c15be8d77265d7eee2cf16310692f80a66 [file] [log] [blame]
Patrick Williams831839a2016-10-16 18:09:00 -05001#include <sdbusplus/bus.hpp>
2#include <sdbusplus/message.hpp>
3#include <${"/".join(interface.name.split('.') + [ 'server.hpp' ])}>
4 <%
5 namespaces = interface.name.split('.')
6 classname = namespaces.pop()
7 %>
8namespace sdbusplus
9{
10namespace server
11{
12 % for s in namespaces:
13namespace ${s}
14{
15 % endfor
Patrick Williamsadc16822016-10-17 14:43:54 -050016
17${classname}::${classname}(bus::bus& bus, const char* path)
18 : _${"_".join(interface.name.split('.'))}_interface(
19 bus, path, _interface, _vtable, this)
20{
21}
22
Patrick Williams831839a2016-10-16 18:09:00 -050023 % for m in interface.methods:
24${ m.cpp_prototype(loader, interface=interface, ptype='callback-cpp') }
25 % endfor
26
Patrick Williams178e8fc2016-10-17 16:37:24 -050027const vtable::vtable_t ${classname}::_vtable[] = {
28 vtable::start(),
29 % for m in interface.methods:
30${ m.cpp_prototype(loader, interface=interface, ptype='vtable') }
31 % endfor
32 vtable::end()
33};
34
Patrick Williams831839a2016-10-16 18:09:00 -050035 % for s in namespaces:
36} // namespace ${s}
37 % endfor
38} // namespace server
39} // namespace sdbusplus