April 2017
Beginner to intermediate
394 pages
9h 16m
English
Next let's look at our base builder class. Notice that this is the same type of interface that would be used in the classic Factory method pattern. This abstraction declares a method that returns another abstraction, in this case M5Stage.
Just like before, we need to have an empty virtual destructor so when we use this class in a polymorphic way, the correct destructor will be called. Also like before, the other methods are marked as purely virtual, which disallows direct instantiation of this class. That means we cannot create an M5StageBuilder directly. We must derive from it, and implement the pure virtual methods:
class M5StageBuilder { public: virtual ~M5StageBuilder() {} //Empty virtual destructor virtual ...Read now
Unlock full access