Hi,
Just wondering if anyone knows where I can get information on implementing classes in my OS.
Thanks.
C++ Objects
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:C++ Objects
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)
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
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?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:C++ Objects
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
http://research.sun.com/techrep/1994/smli_tr-94-26.pdf
could interrest you