C++ Objects

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
PlayOS

C++ Objects

Post by PlayOS »

Hi,

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

Thanks.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:C++ Objects

Post 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)
PlayOS

Re:C++ Objects

Post 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?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:C++ Objects

Post 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 ;)
Post Reply