本文整理汇总了C++中NetworkMessage::getMsg方法的典型用法代码示例。如果您正苦于以下问题:C++ NetworkMessage::getMsg方法的具体用法?C++ NetworkMessage::getMsg怎么用?C++ NetworkMessage::getMsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetworkMessage
的用法示例。
在下文中一共展示了NetworkMessage::getMsg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: malloc
NetworkMessageV2::NetworkMessageV2 (const NetworkMessage& nm)
{
if (nm.getVersion() == 2) {
_pBuf = (char *) malloc (nm.getLength());
memcpy (_pBuf, nm.getBuf(), nm.getLength());
_ui16NetMsgLen = nm.getLength();
}
else {
uint8 ui8Version = nm.getVersion();
uint8 ui8MsgType = nm.getMsgType();
uint32 ui32SourceAddress = nm.getSourceAddress();
uint32 ui32TargetAddress = nm.getTargetAddress();
uint16 ui16SessionId = nm.getSessionId();
uint16 ui16MsgId = nm.getMsgId();
uint8 ui8HopCount = nm.getHopCount();
uint8 ui8TTL = nm.getTTL();
ChunkType chunkType = (ChunkType) nm.getChunkType();
bool bReliable = nm.isReliableMsg();
const void *pMsgMetaData = nm.getMetaData();
uint16 ui16MsgMetaDataLen = nm.getMetaDataLen();
const void *pMsg = nm.getMsg();
uint16 ui16MsgLen = nm.getMsgLen();
uint8 ui8QueueSize = 0;
create (ui8MsgType, ui32SourceAddress, ui32TargetAddress, ui16SessionId,
ui16MsgId, ui8HopCount, ui8TTL, chunkType, bReliable,
pMsgMetaData, ui16MsgMetaDataLen, pMsg, ui16MsgLen, 0);
}
}