⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sesmsgqueue.h

📁 linux下编写的一个时间定时触发器
💻 H
字号:
/****************************************************************************
 *
 *         (c) Copyright 2006 by SCADA Enterprise Solutions Inc
 *         All rights reserved
 *
 * NAME:
 *
 *         sesMsgQueue.H -- This is the header file for the sesMsgQueue class.
 *
 * AUTHOR: gang cheng
 *
 * DESCRIPTION:
 *
 *         This class is specially designed to allows other objects to operate message queue
 *
 * RESTRICTION:
 *
 * REVISION HISTORY:
 *
 *         Mar-2006    gang cheng    Created the initial version.
 * 
 ***************************************************************************/
#ifndef SESMSGQUEUE_H#define SESMSGQUEUE_H#include <sys/ipc.h>#include <sys/msg.h>#include <stdio.h>#include <unistd.h>#include <string.h>				//for strlen()#include <stdlib.h>				//for alloce()#include <time.h>               //for ctime
#define SESMSG_MAX_SIZE 4096 
typedef struct sesMsgHead{	unsigned short type;
	unsigned short srcPid;
	//char srcName[20];	unsigned short destPid;
	//char destName[20];	unsigned short responseFlag;	unsigned long msgSize;};

typedef struct sesMsgMem              
{
	sesMsgHead msghead;
	char msgbody[1];
};

typedef struct sesMsg
{
	sesMsgHead msghead;
	char* message;
};

class sesMsgQueue{public:	int MsqCreate(key_t key);	int MsqSend(int msqid, sesMsg msg);
	int MsqSendTo(int msqid, sesMsg msg);	int MsqRecv(int msqid, sesMsg *msg);
	int MsgRemove(int msqid);	int GetMsqId(key_t key);	int GetMsgCount(int msqid);private:	struct msqid_ds msg_ginfo;	};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -