Method 1: Flat VTable. All virtual methods of the class type (including inherited methods) are presented in the table of method pointers, one for each virtual method. The call requires an indirect call to the method pointer with a fixed offset in the table. Each new class creates its own vtable, copies the vtable of its ancestor, overwrites pointers to virtual methods that override the class, with pointers to new methods, and adds new virtual methods defined in the class at the end of the table.
2: VTable ( )
, , vtable. , id method . Invocation , . , .. , .
3: . . , . case/switch . .
vtables . , . Windows WndProc - , wndproc - . WndProc , .
- , . VTable ( ), . VTable , VTables , , .
Delphi VTables, , WndProcs .