diff --git a/test/testmodules/test1/include/api.h b/test/testmodules/test1/include/api.h index a013dfe..076e2e2 100644 --- a/test/testmodules/test1/include/api.h +++ b/test/testmodules/test1/include/api.h @@ -8,4 +8,11 @@ namespace test1 Thing(const ss_ &some_data = "default value"): some_data(some_data){} }; + + inline void do_thing(interface::Server *server, const ss_ &some_data) + { + interface::Event event("test1:thing"); + event.p.reset(new test1::Thing(some_data)); + server->emit_event(event); + } } diff --git a/test/testmodules/test2/server/init.cpp b/test/testmodules/test2/server/init.cpp index b69cec5..1385be6 100644 --- a/test/testmodules/test2/server/init.cpp +++ b/test/testmodules/test2/server/init.cpp @@ -40,9 +40,15 @@ struct Module: public interface::Module void start() { + std::cout<<"test2 start(): Calling test1"<emit_event(event); + + // Simplified by inlining + test1::do_thing(m_server, "Kebab"); } };