摘要:
1 #ifndef OBSERVER_H 2 #define OBSERVER_H 3 #include<list> 4 #include<iostream> 5 using namespace std; 6 7 class Observer 8 { 9 public: 10 virtual void update()=0; 11 }; 12 13 class Subject 14 { 15 public: 16 virtual void attach(Observer* observer)=0; 17 virtual void detach(O... 阅读全文