设计模式
李嘉图mTONG
- -
展开
-
简单工厂模式
#include #include enum FactoryType { A, B, C }; class Product { public: virtual void show() = 0; }; class ProductA : public Product { public: void show() { std::cout << "Product A" << std::e翻译 2015-02-13 21:11:12 · 581 阅读 · 2 评论 -
抽象工厂模式
#include #include class ProductA { public: virtual void show() = 0; }; class ProductA1 : public ProductA { public: void show() { std::cout << "Product A1" << std::endl; } }; class ProductA2翻译 2015-02-15 13:50:44 · 408 阅读 · 0 评论 -
工厂方法模式
#include #include class Product { public: virtual void show() = 0; }; class ProductA : public Product { public: void show() { std::cout << "Product A" << std::endl; } }; class ProductB : pu翻译 2015-02-15 11:36:27 · 419 阅读 · 0 评论 -
boost asio学习笔记(1) echo服务端
#include <iostream> #include <memory> #include <array> #include <boost/asio.hpp>const int MAX_MESS_SIZE = 4096;class Session : public std::enable_shared_from_this < Session > { public: Session(boos原创 2015-05-19 21:23:08 · 683 阅读 · 0 评论