builder_pattern::ConcreteBuilder

class ConcreteBuilder : public builder_pattern::Builder

Concrete implementation of the Builder interface.

The ConcreteBuilder class constructs a specific type of product by implementing the steps defined in the Builder interface.

Public Functions

ConcreteBuilder()

Constructor initializes a new Product instance.

Constructs a new ConcreteBuilder and initializes a product.

Creates a new Product instance and initializes the builder.

Initializes the builder with a fresh Product instance for construction.

virtual void buildPartA() override

Builds Part A of the product.

Builds Part A of the product.

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

Sets Part A of the product to a specific value defined by the builder.

virtual void buildPartB() override

Builds Part B of the product.

Builds Part B of the product.

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

Sets Part B of the product to a specific value defined by the builder.

virtual std::shared_ptr<Product> getResult() override

Retrieves the constructed product.

Retrieves the constructed product.

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

Returns the fully constructed product after all parts have been built.

Returns:

A shared pointer to the constructed Product.

Returns:

A shared pointer to the constructed Product.