void simulate(Quackable& duck){ duck.quack(); }
public: virtual void quack() { for (std::vector<Quackable*>::iterator it = quackers.begin(); quackers.end() != it; ++it) { Quackable* quacker = *it; quacker->quack(); } }
void registerObserver(Observer* observer) { duck->registerObserver(observer); }
void notifyObservers() { duck->notifyObservers(); }
void quack() { duck->quack(); numberOfQuacks++; }