CMsg
/**********************************************************************************
* @file CMsg.h
* @brief 消息类头文件
**********************************************************************************/
#ifndef CMSG_H
#define CMSG_H
#include "msg/MsgExport.h"
#include <stddef.h>
#include <string>
#include "boost/shared_ptr.hpp"
namespace kbd_msg {
class MSG_API CMsg
{
public:
CMsg();
CMsg(int type);
CMsg(int type,int channelID);
virtual ~CMsg();
int getChannelID() const;
void setChannelID(int nChannelID);
int getType() const;
void setType(int nType);
private:
//<to-do 设计
int m_channelID;
int m_type;
};
typedef boost::shared_ptr<kbd_msg::CMsg> CMsgPtr;
} //< namespace kbd_msg
#endif // CMSG_H
#include <msg/CMsg.h>
kbd_msg::CMsg::CMsg():
m_channelID(-1),
m_type(-1)
{
}
kbd_msg::CMsg::CMsg(int type) :
m_channelID(-1),
m_type(type)
{
}
kbd_msg::CMsg::CMsg(int type, int channelID) :
m_channelID(channelID),
m_type(type)
{
}
kbd_msg::CMsg::~CMsg()
{
}
int kbd_msg::CMsg::getChannelID() const
{
return m_channelID;
}
void kbd_msg::CMsg::setChannelID(int nChannelID)
{
m_channelID = nChannelID;
}
int kbd_msg::CMsg::getType() const
{
return m_type;
}
void kbd_msg::CMsg::setType(int nType)
{
m_type = nType;
}
浙公网安备 33010602011771号