www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Smart object container

Hello everyone,

I'm working on an application which needs to use many predefined 
structures/classes, (Can be any of both actually) to unpack 
external data over these.

Based on the data I receive, I'd need to look up for the ID of 
the structure/class
I wish to use to unpack it.

So the main need is to be able to have access to the structure 
matching the ID within the data received.

The way I go about this for now is by forging an AA of the 
structures/objects that'll be used to unpack data.

                             Object[uint]

With each class instance being associated with it's class ID.

This poses several issues when it comes to casting the Object 
members.
In case this is a decent direction, I'm also able to grab all 
structure/class names at compile time.

Let me know your suggestions, greatly appreciate :)
Mar 26 2013