触发器类 , 指针函数
来源:互联网 发布:免费淘宝联盟推广软件 编辑:程序博客网 时间:2024/04/30 10:01
///*************************************************** *************************************************** Trigger.cpp -- interface of the 'Trigger' general purpose TickTock Trigger version 1.0.8, Jan 15th, 2016 Copyright (C) 2015-2016 Acheld CHEN This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Acheld CHEN http://blog.csdn.net/acheld *************************************************** ****************************************************/#include "StdAfx.h"#include "Trigger.h"CTrigger::CTrigger(void){m_pFnTrigger = NULL;}CTrigger::~CTrigger(void){}void CTrigger::InitTrigger( CTrigger* &pTrigger ){pTrigger = NULL;if (!pTrigger){pTrigger = new CTrigger();}}void CTrigger::TickTock(){if (m_pFnTrigger){m_pFnTrigger(m_lpParam,m_dwPtr);}}
/////*************************************************** Trigger.h -- interface of the 'Trigger' general purpose TickTock Trigger version 1.0.8, Jan 15th, 2016 Acheld CHEN http://blog.csdn.net/acheld ****************************************************/#pragma once//*******************************//trigger timer function ,point function//define one kind of the point function,create one new object function//set this function as the params//when some conditions satisfy ,call this function//then can do some thing in this function//*********************************#include "TimeCount.h"typedef void(* pFn_Trigger)(LPVOID lpParam, DWORD_PTR dwPtr);void TockTrigger(LPVOID lpParam, DWORD_PTR dwPtr);void TickTrigger(LPVOID lpParam, DWORD_PTR dwPtr);//Tock(Qpart1,lpSpendTime);class CTrigger{protected:CTrigger(void);~CTrigger(void);public:static void InitTrigger(CTrigger* &pTrigger);void SetTrigger(pFn_Trigger pTrigger){m_pFnTrigger = pTrigger;}void TickTock();void SetlpParam(LPVOID lpParam){m_lpParam = lpParam;}LPVOID GetlpParam(){return m_lpParam;}void SetdwPtr(DWORD_PTR dwPtr){m_dwPtr = dwPtr;}DWORD_PTR GetdwPtr(){return m_dwPtr;}protected:pFn_Trigger m_pFnTrigger;LPVOID m_lpParam;DWORD_PTR m_dwPtr;};extern CTrigger* g_Trigger;
0 0
- 触发器类 , 指针函数
- 函数指针、指针函数类
- 函数--触发器
- 触发器函数
- 类函数指针和普通函数指针
- 类函数指针和普通函数指针
- C++ 函数指针 & 类成员函数指针
- c++函数指针和类函数指针
- 类成员函数 指针函数
- 类成员函数指针
- 类函数指针
- 类成员函数指针
- 类成员函数指针
- 类的函数指针
- 类成员函数指针
- 类成员函数指针
- 类的函数指针。
- 函数指针 与 类
- Syntax error, annotations are only available if source level is 1.5
- 使用Visual Studio对项目重命名
- 启动控制面板中的applet时的一点笔记--发文于2013-10-22
- 《侣行》三季合集下载
- RMI AND CORBA简介——java菜鸟成长记
- 触发器类 , 指针函数
- Understanding Linux /proc/id/maps
- 关于幂等的设计
- 哈希查找之链地址法解决冲突(代码封装实现)
- 常用的正则表达式验证
- iOSCore Location地理定位的简单实用
- ubuntu 14.04 改网卡IP为静态IP
- MySQL高级十六——内存优化
- Save could not be completed. Reason: some characters cannot be mapped using “ISO-8859-1“