template_method_pattern

namespace template_method_pattern

Namespace for the Template Method pattern.

class AbstractClass
#include <template_method.hpp>

Abstract base class defining the template method and its steps.

Subclassed by template_method_pattern::ConcreteClass1, template_method_pattern::ConcreteClass2

Public Functions

virtual ~AbstractClass() = default

Virtual destructor for proper cleanup of derived classes.

inline void templateMethod() const

The template method defining the skeleton of the algorithm.

This method calls the steps, some of which are implemented by derived classes.

class ConcreteClass1 : public template_method_pattern::AbstractClass
#include <template_method.hpp>

Concrete implementation of the abstract class.

class ConcreteClass2 : public template_method_pattern::AbstractClass
#include <template_method.hpp>

Another concrete implementation of the abstract class.