On 12/22/2011 06:25 PM, Kevin O'Connor wrote:
Why not declare types with something like the following:

TypeInfo my_device_info = {
     .name = "my-device",
     .parentinfo =&device_info,
     .instance_size = sizeof(MyDevice),
};

That is, instead of looking up the TypeImpl via a string, lookup the
TypeImpl via the address of the TypeInfo.  (Or possibly store a
pointer to TypeImpl in TypeInfo during registration.)

This requires all modules to provide a header file just for the TypeInfo or TypeImpl. It doesn't let you use work purely through introspection.

Paolo

Reply via email to