AMDG Robert Dailey wrote:
Subscription doesn't seem as simple as you proposed. I looked into possible designs for subscribing to the signals and nothing is working out. There's no way to generate a second map to provide slot connections, since the signal object is actually owned by the first map, and thus the two cannot share them. Secondly, the slots (given the design above) each have a different signature for each packet, which further complicates things.
Any suggestions? I'm having trouble thinking outside the box...
(iter->second.first)->connect(f); }; void operator()(PacketID id, const Packet& packet) { dispatcher[id].second(packet); }
#include
dispatcher_t; dispatcher_t dispatcher; };
void test(WalkPacket const&) { std::cout << "Got a WalkPacket" << std::endl; } int main() { SignalHolder holder; holder.register_function<WalkPacket>(&test); WalkPacket packet; holder(PID_WALKPACKET, packet); } In Christ, Steven Watanabe