1#include <${events.headerFile("event")}>
2#include <nlohmann/json.hpp>
3
4%if events.errors:
5
6namespace sdbusplus::error::${events.cppNamespacedClass()}
7{
8% for e in events.errors:
9
10${events.render(loader, "event.cpp.mako", events=events, event=e)}\
11% endfor
12
13/* Load error map into sd_bus for errno translation. */
14static sd_bus_error_map errors[] = {
15% for e in events.errors:
16    SD_BUS_ERROR_MAP(${e.CamelCase}::errName, ${e.CamelCase}::errErrno),
17% endfor
18    SD_BUS_ERROR_MAP_END
19};
20[[gnu::constructor]] static void loadErrors()
21{
22    sd_bus_error_add_map(errors);
23}
24
25} // namespace sdbusplus::error::${events.cppNamespacedClass()}
26
27%endif
28%if events.events:
29
30namespace sdbusplus::event::${events.cppNamespacedClass()}
31{
32% for e in events.events:
33
34${events.render(loader, "event.cpp.mako", events=events, event=e)}\
35% endfor
36
37} // namespace sdbusplus::event::${events.cppNamespacedClass()}
38%endif
39