On Fri, Mar 28, 2008 at 7:26 PM, Steven Watanabe <watanabesj@gmail.com> wrote:
AMDG
You could put the ID in the base Packet type. That should minimize the
Robert Dailey wrote:
> The problem is that the type of the packet is not known until runtime.
> This makes it very difficult to make things "type safe" at compile
> time. What Steven has presented is about as type-safe as you can make
> it. However, the system does not prevent you from mismatching ID's
> with actual packet types, but that's just a natural problem with data
> driven designs.
chances of mismatch.
> original type of the packet, since what is being passed in (the ID) is> Right now there is no possible way to have a factory that returns the
> not known at compile time, as I've already stated.
It seems like a problem in multiple dispatching, which C++ just doesn't
support very well natively.
In Christ,
Steven Watanabe