builder_pattern::Builder

class Builder

Abstract interface for constructing a Product.

The Builder interface defines the steps required to build different parts of a product and retrieve the final result. Concrete implementations of this interface construct specific types of products.

Subclassed by builder_pattern::ConcreteBuilder

Public Functions

virtual ~Builder() = default

Virtual destructor to allow proper cleanup in derived classes.

virtual void buildPartA() = 0

Builds Part A of the product.

Defines the step required to construct Part A of the product.

virtual void buildPartB() = 0

Builds Part B of the product.

Defines the step required to construct Part B of the product.

virtual std::shared_ptr<Product> getResult() = 0

Retrieves the constructed product.

After all parts of the product are built, this method returns the fully constructed product.

Returns:

A shared pointer to the constructed Product.