builder_pattern::Director
-
class Director
Orchestrates the construction process.
The
Directorclass uses aBuilderto construct a product in a predefined sequence. It ensures that the construction process is consistent and follows a specific order.Public Functions
-
explicit Director(Builder *builder)
Constructor accepts a builder.
Initializes the
Directorwith a specific builder to use for the construction process.- Parameters:
builder – A pointer to the
Builderinstance.
-
void construct()
Constructs the product by invoking the builder’s methods in order.
Constructs the product by invoking the builder’s methods in sequence.
Executes the sequence of steps to construct the product using the builder.
Orchestrates the construction process by calling the builder’s methods in a predefined order.
-
std::shared_ptr<Product> getProduct()
Retrieves the constructed product.
Retrieves the constructed product from the builder.
After the construction process is complete, this method retrieves the fully constructed product from the builder.
After the construction process is complete, this method retrieves the final constructed product from the builder.
-
explicit Director(Builder *builder)