00001 #include "Pizza.h" 00002 #include "PizzaBuilder.h" 00003 #include "HawaiianPizzaBuilder.h" 00004 #include "SpicyPizzaBuilder.h" 00005 #include "Waiter.h" 00006 00007 // A customer ordering two pizza. 00008 int main() 00009 { 00010 Waiter waiter; 00011 00012 HawaiianPizzaBuilder hawaiianPizzaBuilder; 00013 waiter.SetPizzaBuilder (&hawaiianPizzaBuilder); 00014 waiter.ConstructPizza(); 00015 std::auto_ptr<Pizza> pizza = waiter.GetPizza(); 00016 pizza->ShowPizza(); 00017 00018 SpicyPizzaBuilder spicyPizzaBuilder; 00019 waiter.SetPizzaBuilder(&spicyPizzaBuilder); 00020 waiter.ConstructPizza(); 00021 pizza = waiter.GetPizza(); 00022 pizza->ShowPizza(); 00023 00024 return EXIT_SUCCESS; 00025 }