I need to create a class Fontthat will have several implementations covering platforms or different libraries (for example, Win32 GDI or FreeType). Thus, essentially there will be one common header / interface file and several .cpp implementations (selected at build time). I would prefer to keep the public interface (header file) clean from any implementation details, but this is usually difficult to achieve. A font object must be dragging some particular state — for example, a handle in GDI or a FreeType face object inside.
In C ++ , what is the best way to track the details of a private implementation? Should I use static data in implementation files?
Edit: Found this wonderful article on the topic: Separation of the interface and implementation in C ++ .
ps I remember that in Objective-C there are private categories that allow you to define the class extension in your personal implementation file, making a rather elegant decision.
source
share