00001 // Director 00002 class Waiter 00003 { 00004 private: 00005 PizzaBuilder* pizzaBuilder; 00006 public: 00007 Waiter() : pizzaBuilder(NULL) {} 00008 ~Waiter() { } 00009 00010 void SetPizzaBuilder(PizzaBuilder* b) { pizzaBuilder = b; } 00011 std::auto_ptr<Pizza> GetPizza() { return pizzaBuilder->GetPizza(); } 00012 void ConstructPizza() 00013 { 00014 pizzaBuilder->createNewPizzaProduct(); 00015 pizzaBuilder->buildDough(); 00016 pizzaBuilder->buildSauce(); 00017 pizzaBuilder->buildTopping(); 00018 } 00019 };