GOF Factory method(工厂算法)
摘要:#include using namespace std;// Safe Delete Pointer#define SAFEDELETE(p) if (NULL != p)/{/ delete p;/ p = NULL;/}// base productclass ProductBase{public: ProductBase(void) { } virtual void print() { }};// sub productclass ProductInt :public ProductBase{public: ProductInt(void) { } void print() { c..
阅读全文
posted @ 2010-12-17 14:02