Designing character units

The following class diagram represents a reader:

As we go through the other character units, we will come up with a base class for each character unit. Each specific unit will inherit from that base class and will add its specific properties, if any. Here's the complete class diagram for character units:

Pay attention to the base class it's an interface rather than a regular class. It defines pure virtual functions to be implemented in derived classes. Here's what the CharacterUnit interface looks like in code:

Get Expert C++ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.