摘要: C/C++有以下几种流对象的: 型别 名称 作用 istream cin 从input通道读入数据 ostream cout 将数据写到标准output通道 ostream cerr 将错误信息写到标准error通道 ostream clog 将日志信息写到标准logging通道 wistream ... 阅读全文
posted @ 2011-10-20 22:17 lq0729 阅读(10827) 评论(0) 推荐(2) 编辑
摘要: 本例将执行体从线程类中抽象出来,形成一个接口,用户可根据需要派生出不同的执行体(线程或进程),从而使得不同的执行体(线程或进程)能以自己想要的方式运行。 执行体类(接口)"CLExecutive": 头文件: View Code #ifndef CLEXECUTIVE_H#defin... 阅读全文
posted @ 2011-10-19 22:18 lq0729 阅读(450) 评论(0) 推荐(0) 编辑
摘要: explicit主要用于 "修饰 "构造函数. 使得它不用于程序中需要通过此构造函数进行 "隐式 "转换的情况! 阅读全文
posted @ 2011-10-19 21:54 lq0729 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 业务逻辑提供者类"CLThreadFunctionProvider" 头文件: View Code #ifndef CLTHREADFUNCTIONPROVIDER_H#define CLTHREADFUNCTIONPROVIDER_H#include "CLStatus.h"cla... 阅读全文
posted @ 2011-10-19 21:41 lq0729 阅读(451) 评论(0) 推荐(0) 编辑
摘要: 头文件: View Code #ifndef CLTHREAD_H#define CLTHREAD_H#include #include "CLStatus.h"#include "CLLog.h"templateclass CLThread{public: CLThread(... 阅读全文
posted @ 2011-10-19 20:37 lq0729 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 线程类"CLThread" 头文件: View Code #ifndef CLTHREAD_H#define CLTHREAD_H#include #include "CLStatus.h"class CLThread{public: CLThread(); virtua... 阅读全文
posted @ 2011-10-19 20:17 lq0729 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 线程类“CLThread” 头文件: View Code #ifndef CLTHREAD_H#define CLTHREAD_H#include #include "CLStatus.h"class CLThread{public: CLThread(); ~CLThr... 阅读全文
posted @ 2011-10-19 18:12 lq0729 阅读(560) 评论(0) 推荐(0) 编辑
摘要: 日志类"CLLog" 头文件(CLLog.h): View Code #ifndef CLLog_H#define CLLog_H#include #include "CLStatus.h"/*用于向文件LOG_FILE_NAME中,记录日志信息*/class CLLog{publi... 阅读全文
posted @ 2011-10-19 17:19 lq0729 阅读(783) 评论(0) 推荐(0) 编辑
摘要: 封装的状态类"CLStatus" 头文件(CLStatus.h): View Code #ifndef CLSTATUS_H#define CLSTATUS_H/*用于保存函数的处理结果*/class CLStatus{public: /* lReturnCode >=0... 阅读全文
posted @ 2011-10-19 10:59 lq0729 阅读(234) 评论(0) 推荐(0) 编辑
摘要: restrict: restrict只适用于指针,它声明一个指针是唯一初始化访问一个数据对象。 int ar[10];int* restrict restar=(int *)malloc(10*sizeof(int));int* par=ar;for(int n=0; n<10; n++) { ... 阅读全文
posted @ 2011-10-18 21:06 lq0729 阅读(250) 评论(0) 推荐(0) 编辑