资源简介
算是一个消息处理框架吧,用于说函数对象function与bind的基本用法;
比较适合入门boost的function与bind的基本用法

代码片段和文件信息
#include
#include
#include “process_data.h“
using namespace std;
int printHelpInfo(string cmd const void *pData int dataLen)
{
cout <<“-----------------------------------“< cout <<“help info:“< cout <<“help: print this info.“< cout <<“ver : print this demo ver.“< cout <<“test: process test class func cmd.“< cout <<“q : exit.“< cout <<“-----------------------------------“<
return 0;
}
int printVer(string cmd const void *pData int dataLen)
{
cout <<“in printVer ver 1.0.0“< return 0;
}
class testDataProc
{
public:
int TestDataProcFunc(string cmd const void *pData int dataLen)
{
cout << “in testDataProc::TestDataProcFunc process cmd “< return 0;
}
};
int main(int argc char **argv)
{
//静态函数注册
CDataProcess::getInstance()->registProcHandle(“help“ printHelpInfo);
CDataProcess::getInstance()->registProcHandle(“ver“ printVer);
//测试类成员函数注册
testDataProc testProcObj;
CDataProcess::getInstance()->registProcHandle(“test“boost::bind(&testDataProc::TestDataProcFunc testProcObj _1 _2 _3));
char cInPutBuf[256] = {0};
while ( true )
{
printf(“inPut cmd>: “);
bzero(cInPutBuf sizeof(cInPutBuf));
cin.getline(cInPutBufsizeof(cInPutBuf));
if (cInPutBuf[0] == ‘q‘)
{
cout <<“Bye!“< break;
}
CDataProcess::getInstance()->processDataFunction(cInPutBuf NULL 0);
}
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-01-09 17:47 dataProc\
文件 1535 2018-01-09 17:41 dataProc\main.cpp
文件 594 2018-01-09 17:43 dataProc\Makefile
文件 3363 2018-01-09 17:46 dataProc\process_data.cpp
文件 1440 2018-01-09 17:46 dataProc\process_data.h
文件 283 2018-01-09 17:47 dataProc\public.h
文件 25288 2018-01-09 17:45 dataProc\示例截图.png
- 上一篇:cpp实现的消息处理框架
- 下一篇:Solaris8-11 iso镜像
相关资源
-
Gap functions and error bounds ba
sed on con - Effects of the cultured Cordyceps exopolysacch
- Investigation of the Lower Resistance Meridian
- multifunction device win7 v1.1 免费版
- Optimal recovery of functions on the sphere on
- Existence of positive solutions for some singu
- The Existence of Optimal Control for Fully Cou
- Enol functionalized N-heterocyclic carbene lan
- Reviewed on The Functionalization of Nanometer
- eightmodelSobelfunction.zip
- The Special Functions and Their Approximations,
- Domain Modeling Made Functional Tackle Softwar
- Handbook of Functional MRI Data Analysis
- Pearls of Functional algorithm design
- Geometric Functional Analysis and Its Applicat
- FANUC CNC Screen Display Function_ FOCAS2Ether
- function alanalysis Stein
- Functional Safety for Road Vehicles
- StarCCM+FieldFunction函数建立
- Effective Functional Verification
- COMPUTABILITY An introduction to recursive fun
- Reinforcement learning and dynamic programming
- Cadence User Interface SKILL Functions Referen
- FunctionalReactiveProgrammingOniOS Functional
- Swift 3 Functional Programming
- Functional Reactive Programming on iOS
- Functional Reactive Programming on iOS.pdf
- The Functional Approach to Programming
- Functional Analysis 2nd Edition Rudin Walter
- Radial Basis Functions:Theory and Implementa
评论
共有 条评论