📄 netmsg.h
字号:
//netmsg.h
#ifndef _netmsg_h
#pragma once
#include "BaseFunc.h"
#include "NetworkDef.h"
#include "MyObject.h"
typedef std::pair<std::string,std::string> STD_PAIR_STRING_STRING;
//#define MSGHEAD_DEFINE unsigned short unMsgSize;unsigned short unMsgType;
class CNetMsg
{
public:
DECL_CLASS(CNetMsg,CNetMsg);
CNetMsg();
virtual ~CNetMsg();
void Init(void);
void Reset(void) {Init();}
const unsigned short GetType (void) {return m_unMsgType;}
const unsigned short GetSize (void) {return m_unMsgSize;}
char* GetBuf(void) {return m_bufMsg;}
public:
virtual BOOL Create (char* pMsgBuf, DWORD dwSize);
virtual BOOL IsValid (void);
// virtual void Send (void);
virtual void Process (void *pInfo);
public:
static int GetMaxSize (void) {return _MAX_MSGSIZE;}
static unsigned short GetType (char* pbufMsg, DWORD dwMsgSize);
static unsigned short GetSize (char* pbufMsg, DWORD dwMsgSize);
static CNetMsg* CreateMsg (char* pbufMsg, DWORD dwMsgSize);
protected:
union
{
char m_bufMsg[_MAX_MSGSIZE];
struct
{
unsigned short m_unMsgSize;
unsigned short m_unMsgType;
};
};
public:
static const char* GetMsgIdName(const long lMsgID);
};
//CNetMsg* CreateNetMsgFromId(const long lId);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -