#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(interface::Event::t("core:start")) { std::cout<<"test2 construct"<sub_event(this, m_EventType_core_start); } ~Module() { std::cout<<"test2 destruct"<emit_event(event); // Simplified by inlining test1::do_thing(m_server, "Kebab"); } }; extern "C" { EXPORT void* createModule_test2(interface::Server *server){ return (void*)(new Module(server)); } } }