[Mono-list] Internal call structures

Dan Lewis dihlewis@yahoo.co.uk
Fri, 15 Feb 2002 13:21:28 +0000 (GMT)


Hi

I have a question concerning the structures that my internal call tool
generates. What's your prefered idiom for representing derived types?
For instance, consider MonoString:

	typedef struct {
		MonoObject obj;		// base class
		MonoArray *c_str;
		gint32 length;
	} MonoString;

So to access the class, you use:
	
	MonoClass *klass = str.obj.klass;

Now for MonoReflectionModuleBuilder, there are two levels of
heirarchy:

	typedef struct {
		MonoReflectionModule obj;
		MonoArray *types;
		guint32 table_idx;
	} MonoReflectionModuleBuilder;

So to get at the class for this, you use:

	Monoclass *klass = mb.obj.obj.klass;

This is the way ictool works at the moment, defining a struct as an
extension of its nearest defined base class. But if you want I could
change it to always define from MonoObject downwards, or even to just
define the whole class from nothing. What do you think is best?

Thanks,
  Dan.



__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com