I'll look into arena allocation, since all I really want is destroy-after-use. Will that do it?
Regarding "polymorphism", what I'm really after is some way to manage and act upon a group of messages, something like:
1. Get incoming packet from a queue, deserialize it and create the message object.
2. Send the message object (hence the need for a base class) to a "dispatcher"
3. Dispatcher invokes the appropriate processing method which creates a response message.
4. Serialize the response and send packet on return queue.
Steps 1 and 3 are the parts that I'm grappling with, both in Java and C++. Any tips on
-- The best way to examine the packet and create the correct message? I have some freedom to put framing around the packet if necessary.
-- The best way to create and invoke a message->method mapping in Java / C++?
Thanks
john