Page 1 of 1

C++ Objects

Posted: Fri Oct 04, 2002 3:03 am
by PlayOS
Hi,

Just wondering if anyone knows where I can get information on implementing classes in my OS.

Thanks.

Re:C++ Objects

Posted: Fri Oct 04, 2002 3:30 am
by Pype.Clicker
what exactly do you mean ? how the C++ compiler translates classes into bits & bytes ? i've seen a good book on it, but there is no standard way to do it, a.f.a.i.k.

A common trick is to have an "instance structure" that holds all the variables of your class plus a VPTR pointer to a table of function pointers for virtual functions (which is shared by all the instances of the same class)

Re:C++ Objects

Posted: Fri Oct 04, 2002 3:33 am
by PlayOS
Do you know how I can get the book? I was wanting to know how C++ handles them, so does C++ do something similar to what you suggested?

Re:C++ Objects

Posted: Fri Oct 04, 2002 5:22 am
by Pype.Clicker
most implementations i know (Borland C++, gpp, MS Visual C++) do have such techniques, however it's might be compiler-specific.

http://research.sun.com/techrep/1994/smli_tr-94-26.pdf

could interrest you ;)