Mapa mental
Virtual Functions
Contenido del mapa
Virtual Functions
A member function that is dynamically bound to function calls
- the function will dynamically assign the methd
- Must have a virtual destructor but only needs to be in the base class
- Can be invoked via a dereferenced pointer or reference object
- the function will dynamically assign the methd
Polymorphism
- function that can take arguments of different types
Determination of which virtual function to use cannot always be made at run time
- Implementation of virtual function is by virtual table
- All the objects in a class contain one data member called virtual table pointer which points to an array of function pointers
- When virtual pointer is envoked, actual function is determined by following the pointer and looking up the address in a table
- All the objects in a class contain one data member called virtual table pointer which points to an array of function pointers
- Implementation of virtual function is by virtual table
Información
- Descripción
- Advanced Programming Mapa Mental sobre Virtual Functions, creado por lucy copp el 18/05/2017.
- Creado por
- lucy copp
- Visitas
- 0
- Valoración