/********************************************************************* * * 文 件: GlobalTimer.h 定时任务管理 * * 版权所有: Shanghai Baosight Software Co., Ltd. * * 概述: * : * : * * 版本历史 * 1.0 2010-09-02 echo_li 增加注释 * *********************************************************************/ #ifndef H_GLBTIMER_H #define H_GLBTIMER_H #include #include #include #define MAXSNDBUF 4096 namespace baosight { struct DataWorkBuffer{ char TaskName[48]; int SwitchFact; unsigned int DelayTime; int LenBuf; int TimeMethod; char DataBuffer[MAXSNDBUF]; }; /********************************************************************* * 类 名: GlobalTimer * 版权所有: Shanghai Baosight Software Co., Ltd. * 类 职 责:复制启动定时任务,停止定时任务 * : * : * 版本历史 * 1.0 2010-09-02 echo_li 增加注释 * *********************************************************************/ class GlobalTimer{ public: /********************************************************************** * 概述: 启动定时任务 * 函数名: StartTimer * 返回值: int * 参数列表: 参数类型 取值范围 描述 * TaskName: const string& 启动的任务 * Fact: int * Delay: unsigned int 延迟秒数(单位毫秒) * Buf: char * * Buflen: int * Flag: int * * 版本历史 * 1.0 2010-09-02 echo_li 增加注释 * **********************************************************************/ static int StartTimer( const string& TaskName, int Fact, unsigned int Delay, char *Buf, int Buflen, int Flag); /********************************************************************** * 概述: 启动定时任务 * 函数名: StartTimer * 返回值: int * 参数列表: 参数类型 取值范围 描述 * TaskName: const string& * Fact: int * Delay: unsigned int * Flag: int * * 版本历史 * 1.0 2010-09-02 echo_li 增加注释 * **********************************************************************/ static int StartTimer( const string&, int Fact, unsigned int Delay, int Flag); /********************************************************************** * 概述: 停止定时任务 * 函数名: StopTimer * 返回值: int * 参数列表: 参数类型 取值范围 描述 * TaskName: const string& * Fact: int * * 版本历史 * 1.0 2010-09-02 echo_li 增加注释 * **********************************************************************/ static int StopTimer( const string& TaskName, int Fact); private: static struct DataWorkBuffer mDataWork; }; }; #endif