摘要:
本例将执行体从线程类中抽象出来,形成一个接口,用户可根据需要派生出不同的执行体(线程或进程),从而使得不同的执行体(线程或进程)能以自己想要的方式运行。 执行体类(接口)"CLExecutive": 头文件: View Code #ifndef CLEXECUTIVE_H#defin... 阅读全文
摘要:
explicit主要用于 "修饰 "构造函数. 使得它不用于程序中需要通过此构造函数进行 "隐式 "转换的情况! 阅读全文
摘要:
业务逻辑提供者类"CLThreadFunctionProvider" 头文件: View Code #ifndef CLTHREADFUNCTIONPROVIDER_H#define CLTHREADFUNCTIONPROVIDER_H#include "CLStatus.h"cla... 阅读全文
摘要:
头文件: View Code #ifndef CLTHREAD_H#define CLTHREAD_H#include #include "CLStatus.h"#include "CLLog.h"templateclass CLThread{public: CLThread(... 阅读全文
摘要:
线程类"CLThread" 头文件: View Code #ifndef CLTHREAD_H#define CLTHREAD_H#include #include "CLStatus.h"class CLThread{public: CLThread(); virtua... 阅读全文
摘要:
线程类“CLThread” 头文件: View Code #ifndef CLTHREAD_H#define CLTHREAD_H#include #include "CLStatus.h"class CLThread{public: CLThread(); ~CLThr... 阅读全文
摘要:
日志类"CLLog" 头文件(CLLog.h): View Code #ifndef CLLog_H#define CLLog_H#include #include "CLStatus.h"/*用于向文件LOG_FILE_NAME中,记录日志信息*/class CLLog{publi... 阅读全文
摘要:
封装的状态类"CLStatus" 头文件(CLStatus.h): View Code #ifndef CLSTATUS_H#define CLSTATUS_H/*用于保存函数的处理结果*/class CLStatus{public: /* lReturnCode >=0... 阅读全文