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