class QQMediator : public Mediator
{
public:
virtual void notify(Colleage *student)
{
student->talk();
for(int i = 0 ; i < studentList.size() ; ++i)
{
if(student != studentList[i])
{
studentList[i]->talk();
}
}
};
};
int main()
{
QQMediator qq;
Monitor *studentMonitor = new Monitor("Foxx");
Secretary *studentSecretary = new Secretary("TC");
StudentA *studentA = new StudentA("Jack");
StudentB *studentB = new StudentB("Frank");