Simple Object model: as shown in:
Each object is a series of slots, and each data member or function member has its own slot. This model has very low space and execution efficiency. In this model, the members themselves are not placed in object. Only pointers to member are placed inside the object.
Table Driven Model:
Object member variables and member variable functions are each placed in a table with two pointers pointing to the two tables (this model is supported by virtual functions implementation)
C + + object model:
1. nonstatic data Memger placed in each class object
2. Static data members are placed outside of class object
3. Static and nonstatic function members are placed outside of class objects
4. Virtual functions is supported in two steps:
Class produces a pointer to the virtural functions, placed in the table, which becomes the virtural table. Each object is placed with a pointer to the associated virtual table, which becomes the vptr. Vptr settings and resets are completed by constructor, destructor, copy assignment.
Type_info object (which is supported by Rtti) is also indicated by Tirtural table, which is located in the first slot of the table (so there is not only a virtual function address in virtual table)
About objects (object model)