本文整理汇总了C++中QSharedPointer::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ QSharedPointer::GetType方法的具体用法?C++ QSharedPointer::GetType怎么用?C++ QSharedPointer::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSharedPointer
的用法示例。
在下文中一共展示了QSharedPointer::GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleSessionPacket
void ExitTunnel::HandleSessionPacket(QSharedPointer<Packet> pp)
{
if(!_running) return;
if(pp.isNull()) return;
qDebug() << "SOCKS MEM active" << _table.Count();
Packet::PacketType ptype = pp->GetType();
switch(ptype) {
case Packet::PacketType_TcpStart:
TcpCreateProxy(pp);
return;
case Packet::PacketType_UdpStart:
qDebug() << "SOCKS got UDP start packet";
UdpCreateProxy(pp);
return;
case Packet::PacketType_TcpRequest:
TcpHandleRequest(pp);
return;
case Packet::PacketType_UdpRequest:
qDebug() << "SOCKS got UDP request packet";
UdpHandleRequest(pp);
return;
case Packet::PacketType_TcpResponse:
return;
case Packet::PacketType_UdpResponse:
return;
case Packet::PacketType_Finish:
HandleFinish(pp);
return;
default:
qWarning() << "SOCKS Unknown packet type" << ptype;
}
}
示例2: IncomingDownstreamPacket
void SocksConnection::IncomingDownstreamPacket(QSharedPointer<Packet> pp)
{
Packet::PacketType ptype = pp->GetType();
qDebug() << "SOCKS Got packet of type " << ptype;
switch(ptype) {
case Packet::PacketType_TcpStart:
return;
case Packet::PacketType_UdpStart:
return;
case Packet::PacketType_TcpRequest:
return;
case Packet::PacketType_UdpRequest:
return;
case Packet::PacketType_TcpResponse:
HandleTcpResponse(pp);
return;
case Packet::PacketType_UdpResponse:
HandleUdpResponse(pp);
return;
case Packet::PacketType_Finish:
qDebug() << "SOCKS got finish";
Close();
return;
default:
qWarning() << "SOCKS Unknown packet type" << ptype;
}
}