资源简介
银行排队叫号系统源码,若发现bug,欢迎指正,谢谢。操作系统是windows,开发工具vs2008

代码片段和文件信息
// bank_queue.cpp : 定义控制台应用程序的入口点。
//
#include “stdafx.h“
#include
//#include
//#include
#include
#include
#include
#include
#include “numMachine.h“
#include “serviceWin.h“
#include “client.h“
#include “constances.h“
using namespace std;
HANDLE thread1[4];
HANDLE thread2;
HANDLE thread3;
map thread_Map;
enum ID{
THREAD1_0THREAD1_1THREAD1_2THREAD1_3THREAD2THREAD3
};
Client::ClientType createClientType() {
int type;
type = rand() % 10 + 1;
if (type <= 6)
return Client::CLIENT_COMMON;
else if (type >= 7 && type <= 9)
return Client::CLIENT_FAST;
return Client::CLIENT_VIP;
}
int createTasktime() {
return rand() % MAX_SERVICE_TIME + 1;
}
void createClient() {
Client::ClientType clientType;
int taskTime;
for (int i = 0; i < MAX_CLIENT_NUM; ++i) {
clientType = createClientType();
taskTime = createTasktime();
std::cout << “Come in a client : clientType = “ << clientType
<< “ taskTime = “ << taskTime << std::endl;
NumMachine::getInstance()->pressMachine(clientType taskTime);
Sleep(1);
}
// Sleep(5);
}
unsigned __stdcall serviceWin(void *win) {
ServiceWin *serWin = static_cast (win);
serWin->execute();
TerminateThread(thread_Map[serWin->getCount()]0);
// ExitThread(0);
// _endthreadex(0);
return 0;
}
bool createServiceWin(HANDLE thread1[]HANDLE &thread2HANDLE &thread3) {
// pthread_t commonServiceWin[4];
// pthread_t fastServiceWin;
// pthread_t vipServiceWin;
unsigned commonServiceWin[4];
unsigned fastServiceWin;
unsigned vipServiceWin;
char tmp[20]={0};
ServiceWin *win;
for (int i = 0; i < 4; ++i) {
sprintf(tmp “CommonWin%d“ i);
win = new CommonSerWin(tmp);
if (win == NULL) {
std::cout << “Create common service win error.“ << std::endl;
return -1;
}
win->setCount(i);
// if (pthread_create(&commonServiceWin[i] NULL serviceWin (void*) win) != 0) {
//_beginthreadex返回handle
if ((thread1[i] = (HANDLE)_beginthreadex(NULL 0serviceWin (void*) win0&commonServiceWin[i]) )== 0) {
std::cout << “Create common service thread error.“ << std::endl;
return false;
}
thread_Map.insert(map::value_type(ithread1[i]));
}
memset(tmp0sizeof(tmp));
sprintf(tmp “FastWin“);
win = new FastSerWin(tmp);
if (win == NULL) {
std::cout << “Create fast service win error.“ << std::endl;
return false;
}
win->setCount(THREAD2);
// if (pthread_create(&fastServiceWin NULL serviceWin (void*) win) != 0) {
if ((thread2 = (HANDLE )_beginthreadex(NULL 0serviceWin (void*) win0NULL/*&fastServiceWin*/)) == 0) {
std::cout << “Create fast service thread error.“ << std::endl;
return false;
}
thread_Map.insert(map:
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-07-23 01:02 bank_queue\
目录 0 2015-07-23 14:15 bank_queue\bank_queue\
文件 13282304 2015-07-23 14:21 bank_queue\bank_queue.ncb
文件 896 2015-07-21 22:02 bank_queue\bank_queue.sln
文件 52736 2015-07-23 14:21 bank_queue\bank_queue.suo
文件 4317 2015-07-23 14:15 bank_queue\bank_queue\bank_queue.cpp
文件 4953 2015-07-21 22:24 bank_queue\bank_queue\bank_queue.vcproj
文件 1413 2015-07-23 14:21 bank_queue\bank_queue\bank_queue.vcproj.zhang-PC.zhang.user
文件 304 2015-07-21 22:06 bank_queue\bank_queue\client.cpp
文件 303 2015-07-21 22:06 bank_queue\bank_queue\client.h
文件 235 2015-07-23 13:16 bank_queue\bank_queue\constances.h
目录 0 2015-07-23 13:31 bank_queue\bank_queue\Debug\
文件 663 2015-07-23 00:54 bank_queue\bank_queue\Debug\bank_queue.exe.em
文件 728 2015-07-23 00:54 bank_queue\bank_queue\Debug\bank_queue.exe.em
文件 621 2015-07-23 13:31 bank_queue\bank_queue\Debug\bank_queue.exe.intermediate.manifest
文件 255497 2015-07-23 13:31 bank_queue\bank_queue\Debug\bank_queue.obj
文件 10878976 2015-07-23 00:54 bank_queue\bank_queue\Debug\bank_queue.pch
文件 9086 2015-07-23 13:31 bank_queue\bank_queue\Debug\BuildLog.htm
文件 6686 2015-07-23 00:54 bank_queue\bank_queue\Debug\client.obj
文件 65 2015-07-23 13:31 bank_queue\bank_queue\Debug\mt.dep
文件 423618 2015-07-23 13:19 bank_queue\bank_queue\Debug\numMachine.obj
文件 75016 2015-07-23 13:16 bank_queue\bank_queue\Debug\serviceWin.obj
文件 264095 2015-07-23 00:54 bank_queue\bank_queue\Debug\stdafx.obj
文件 674816 2015-07-23 13:31 bank_queue\bank_queue\Debug\vc90.idb
文件 1142784 2015-07-23 13:31 bank_queue\bank_queue\Debug\vc90.pdb
文件 4596 2015-07-23 13:19 bank_queue\bank_queue\numMachine.cpp
文件 1118 2015-07-23 00:26 bank_queue\bank_queue\numMachine.h
文件 1201 2015-07-21 22:02 bank_queue\bank_queue\ReadMe.txt
文件 2517 2015-07-23 00:53 bank_queue\bank_queue\serviceWin.cpp
文件 961 2015-07-23 11:26 bank_queue\bank_queue\serviceWin.h
文件 217 2015-07-22 00:11 bank_queue\bank_queue\stdafx.cpp
............此处省略6个文件信息
- 上一篇:合成孔径卫星魏钟铨
- 下一篇:数学建模10大常用算法+程序源码打包
相关资源
- GUI银行管理系统
- 排队机叫号 源代码
- C 餐厅叫号系统(QT平)
- 银行家算法_fat.jar
- 模拟网上银行截图(易语言)整蛊好
- 第一美国银行采用NetApp统一存储简化
- 广西工商银行病毒防护解决方案
- 用友NC为中国工商银行提供可操作性解
- 广东省工商银行存储备份项目
- 针对银行的数据备份成功案例
- IBM日本和东京三菱银行基于Web服务开
- 再造神经中枢,中国工商银行的数据
- 中国工商银行数据安全可管理备份应
- 湖南大学操作系统实验报告
- 看住信SBI网上银行如何叩问“新型
- 商业银行省分行IP骨干网案例
- 商业银行基于大数据的精准营销解决
- 建设银行计算中心网络数据备份系统
- 富士通存储设备在建设银行的应用
- 访中国建设银行总行资金清算系统灾
- GM/T 0076-2019 《银行卡信息系统密码应
- 中国建设银行总行资金清算系统灾难
- 贵州中行采用EMC信息基础架构建立银
- 中国银行集中化建设进程启示
- 逼近GI/G/1休假排队
- 带启动-关闭期和N策略的单重休假M/
- 多重休假M/G/1排队系统队长分布的数值
- 顾客具有不耐烦时间的M/G/1K-重休假排
- 带有服务台故障和两阶段服务的休假
- 生物压力识别技术在银行安全中的应
评论
共有 条评论