Lecture 4 - Page 1 : 24
Notes about C++
Abstraction Mechanisms, Part 2
Inheritance in C++
Inheritance: Constructors and destructors
Inheritance: Copying and slicing
Member access control: private, public and protected
Virtual Functions
Destructors and Inheritance - Virtual Destructors
Hiding inherited names
Abstract Classes
What about interfaces in C++?
What about nested classes in C++?
What about prevention of derivation in C++
Pointer to members
Multiple inheritance - issues and C++ solutions
Multiple inheritance - issues and C++ solutions
Multiple inheritance: Ambiguities
Replicated base class
Is repeated inheritance possible?
Is repeated inheritance possible? No!
Shared base class: Virtual base
Base class access
Base class access
Base class access - the C++ rules
Base class access - Examples
Discussion: No single most general class in C++
Inheritance in C++
Overview of the
interesting topics
related in inheritance in C++
Multiple inheritance
More than one superclass (base class) is possible in C++
No interfaces in C++
Interfaces in Java and C# compensates for the lack of multiple inheritance
Virtual functions and pure virtual functions
Abstract classes are related to the presence of virtual functions
Polymorphic behavior - dynamic binding - relies on access to objects via pointers or C++ references
Shared or replicated base classes
Shared bases classes are called virtual bases classes
Access control to base classes
Private, protected and public base classes