#include "interface/module.h" #include "interface/server.h" #include "interface/event.h" #include "interface/mutex.h" #include "test1/include/api.h" #include "network/include/api.h" #include //#include using interface::Event; namespace test1 { struct Module: public interface::Module { interface::Mutex m_interface_mutex; interface::Server *m_server; Event::Type m_EventType_test1_thing; network::Packet::Type m_NetworkPacketType_dummy_packet = 0; Module(interface::Server *server): interface::Module("test1"), m_server(server), m_EventType_test1_thing(Event::t("test1:thing")) { std::cout<<"test1 construct"<sub_event(this, Event::t("core:start")); m_server->sub_event(this, m_EventType_test1_thing); m_server->sub_event(this, Event::t("network:new_client")); m_server->sub_event(this, Event::t("network:get_packet_type_resp")); m_server->emit_event("network:get_packet_type", new network::Req_get_packet_type("test1:dummy_packet")); /*MAGIC("network:get_packet_type", new network::Req_get_packet_type("test1:dummy_packet"), [&](const network::Resp_get_packet_type &result){ });*/ //network::cfoo(); /*void *m = dlopen("/home/celeron55/softat/buildat/cache/rccpp_build/network.so", RTLD_NOW); std::cout<<"m="<check_module("network"); network::Direct *network_direct = (network::Direct*)network_module->check_interface(); std::cout<<"Calling network_direct::foo()"<foo(); } void on_thing(const Thing &thing) { std::cout<<"test1.thing: some_data="<emit_event("network:send", packet); } void on_get_packet_type_resp(const network::Resp_get_packet_type &event) { std::cout<<"test1: Got packet type: "<