|
Inheritance vs Interface Polymorphism (C++)
Doxygen docs for the C++ implementation
|
| CAbstractAnimal | Abstract base class combining shared state, a concrete default method, and a pure virtual method subclasses must implement |
| CDogWithDefault | Concrete AbstractAnimal that implements the required speak() method |
| CAnimal | Base class exposing a virtual speak() method |
| CCat | Animal subclass that overrides speak() to meow |
| CDog | Animal subclass that overrides speak() to bark |
| CISingleSpeaker | Interface contract for a single, non-substitutable speaker |
| CPureBreedDog | Sealed 'final' class ensures NO other subclass can modify this method path |
| CISpeaker | Pure abstract class acting as an interface contract |
| CInterfaceCat | ISpeaker implementation that meows |
| CInterfaceDog | ISpeaker implementation that barks |