本文整理汇总了C++中Header::GetVariant方法的典型用法代码示例。如果您正苦于以下问题:C++ Header::GetVariant方法的具体用法?C++ Header::GetVariant怎么用?C++ Header::GetVariant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Header
的用法示例。
在下文中一共展示了Header::GetVariant方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Deserialize
bool RTMPProtocolSerializer::Deserialize(Header &header, IOBuffer &buffer,
Variant &message) {
message.Reset();
message[RM_HEADER] = header.GetVariant();
switch (H_MT(header)) {
case RM_HEADER_MESSAGETYPE_NOTIFY:
{
return DeserializeNotify(buffer, message[RM_NOTIFY]);
}
case RM_HEADER_MESSAGETYPE_FLEXSTREAMSEND:
{
return DeserializeFlexStreamSend(buffer, message[RM_FLEXSTREAMSEND]);
}
case RM_HEADER_MESSAGETYPE_INVOKE:
case RM_HEADER_MESSAGETYPE_FLEX:
{
message[RM_INVOKE][RM_INVOKE_IS_FLEX] =
(bool)(H_MT(header) == RM_HEADER_MESSAGETYPE_FLEX);
return DeserializeInvoke(buffer, message[RM_INVOKE]);
}
case RM_HEADER_MESSAGETYPE_FLEXSHAREDOBJECT:
{
//TODO: This is a hack. We store the data on RM_SHAREDOBJECT
//instead of RM_FLEXSHAREDOBJECT
//return DeserializeFlexSharedObject(buffer, message[RM_FLEXSHAREDOBJECT]);
return DeserializeFlexSharedObject(buffer, message[RM_SHAREDOBJECT]);
}
case RM_HEADER_MESSAGETYPE_SHAREDOBJECT:
{
return DeserializeSharedObject(buffer, message[RM_SHAREDOBJECT]);
}
case RM_HEADER_MESSAGETYPE_USRCTRL:
{
return DeserializeUsrCtrl(buffer, message[RM_USRCTRL]);
}
case RM_HEADER_MESSAGETYPE_CHUNKSIZE:
{
return DeserializeChunkSize(buffer, message[RM_CHUNKSIZE]);
}
case RM_HEADER_MESSAGETYPE_ACK:
{
return DeserializeAck(buffer, message[RM_ACK]);
}
case RM_HEADER_MESSAGETYPE_WINACKSIZE:
{
return DeserializeWinAckSize(buffer, message[RM_WINACKSIZE]);
}
case RM_HEADER_MESSAGETYPE_PEERBW:
{
return DeserializePeerBW(buffer, message[RM_PEERBW]);
}
case RM_HEADER_MESSAGETYPE_ABORTMESSAGE:
{
return DeserializeAbortMessage(buffer, message[RM_ABORTMESSAGE]);
}
default:
{
FATAL("Invalid message type: %u %s", H_MT(header), STR(buffer));
return false;
}
}
}