#include "interface/module.h" #include "interface/server.h" #include "interface/event.h" #include "test1/include/api.h" #include using interface::Event; namespace test2 { struct Module: public interface::Module { interface::Server *m_server; Event::Type m_EventType_core_start; Module(interface::Server *server): m_server(server), m_EventType_core_start(Event::t("core:start")) { std::cout<<"test2 construct"<sub_event(this, m_EventType_core_start); } ~Module() { std::cout<<"test2 destruct"<(new test1::Thing("Nakki"))); m_server->emit_event(std::move(event)); } { // Simplified raw Event event("test1:thing", new test1::Thing("Kebab")); m_server->emit_event(std::move(event)); } { // Even simpler m_server->emit_event("test1:thing", new test1::Thing("Pitsa")); } { // Inline wrapper test1::do_thing(m_server, "Rulla"); } } }; extern "C" { EXPORT void* createModule_test2(interface::Server *server){ return (void*)(new Module(server)); } } }