-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheesePizza.hpp
More file actions
28 lines (24 loc) · 674 Bytes
/
CheesePizza.hpp
File metadata and controls
28 lines (24 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef CHEESE_PIZZA_H
#define CHEESE_PIZZA_H
#include "Pizza.hpp"
#include "PizzaIngredientFactory.hpp"
#include <iostream>
#include <memory>
class CheesePizza : public Pizza {
public:
CheesePizza () = default;
CheesePizza(std::unique_ptr<PizzaIngredientFactory>ingfac) : ingredientFactory(std::move(ingfac)) {}
void prepare() override;
private:
std::unique_ptr<PizzaIngredientFactory> ingredientFactory = nullptr;
};
inline
void
CheesePizza::prepare()
{
std::cout << "Preparing " + name << '\n';
dough = ingredientFactory->createDough();
sauce = ingredientFactory->createSauce();
cheese = ingredientFactory->createCheese();
}
#endif /* CHEESE_PIZZA_H */