jeans chen
we've got them by the balls
摘要: 转贴自倒霉熊的博客【linux学习笔记-2】父子进程共享文件描述符(2009-03-02 23:03:17)转载▼标签:学习linux子进程文件描述符杂谈分类: 学习#include #include//包含O_RDONLY等宏定义int main(void){char test;int fd;if((fd = open("test.dat",O_RDONLY))==-1){perror("Can't open file test.dat\n");return 1;}printf("Open file succeed.\n") 阅读全文
posted @ 2013-11-19 18:02 jeans chen 阅读(501) 评论(0) 推荐(0) 编辑
摘要: 详细见《C++设计模式 23种设计模式.pdf 55页》在面向对象系统的分析与设计过程中经常会遇到这样一种情况:对于某一个业务逻辑(算法实现)在不同的对象中有不同的细节实现,但是逻辑(算法)的框架(或通用的应用算法)是相同的。Template 提供了这种情况的一个实现框架。Template 模式是采用继承的方式实现这一点:将逻辑(算法)框架放在抽象基类中,并定义好细节的接口,子类中实现细节。【注释 1】Strategy 模式解决的是和 Template 模式类似的问题,但是 Strategy 模式是将逻辑(算法)封装到一个类中,并采取组合(委托)的方式解决这个问题。模式选择:Template 阅读全文
posted @ 2013-11-19 17:02 jeans chen 阅读(393) 评论(0) 推荐(0) 编辑