Lv.的博客
摘要: /*Andyisgoingtoholdaconcertwhilethetimeisnotdecided.EricisafansofAndywhodoesn'twanttomissthisconcert.Andydoesn'tknowEric.HowcanEricgetsthenewswhenAndy... 阅读全文
posted @ 2015-04-23 22:49 Avatarx 阅读(663) 评论(0) 推荐(0)
摘要: 1) 观察者模式定义略,各种设计模式的书上都有定义。2) 观察者模式一般实现观察者模式一般实现,都是“被观察者”保存一个“观察者”的列表,循环这个列表来通知“观察者”。代码,其中使用了boost的智能指针shared_ptr:[cpp]view plaincopy#include#include#i... 阅读全文
posted @ 2015-04-23 22:46 Avatarx 阅读(519) 评论(0) 推荐(0)