本文整理汇总了C++中PacketPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ PacketPtr::get方法的具体用法?C++ PacketPtr::get怎么用?C++ PacketPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketPtr
的用法示例。
在下文中一共展示了PacketPtr::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processSocket
bool processSocket(bool expectingPacket)
{
int len = pNextPacket_->recvFromEndPoint(socket_);
if (len <= 0)
{
return this->checkSocketErrors(len, expectingPacket);
}
PacketPtr curPacket = pNextPacket_;
pNextPacket_ = new TCPPacket();
Address srcAddr = socket_.getRemoteAddress();
Reason ret = this->processPacket(srcAddr, curPacket.get());
if (ret != REASON_SUCCESS)
{
this->dispatcher().errorReporter().reportException(ret, srcAddr);
}
return true;
}
示例2: handlePacket
void ApplicationBarrierManager::handlePacket(PacketPtr packet, gadget::NodePtr node)
{
vprDEBUG(gadgetDBG_RIM, vprDBG_HVERB_LVL)
<< clrOutBOLD(clrMAGENTA,"[ApplicationBarrierManager::handlePacket()]")
<< "In handlePacket.\n" << vprDEBUG_FLUSH;
if ( NULL != packet.get() && NULL != node.get() )
{
switch ( packet->getPacketType() )
{
case cluster::Header::RIM_DATA_PACKET:
{
DataPacketPtr data_packet = boost::dynamic_pointer_cast<DataPacket>(packet);
vprASSERT(NULL != data_packet.get() && "Dynamic cast failed!");
// Find the ApplicationBarrier Object that we have received data
// for.
ApplicationBarrier* barrier =
getApplicationBarrier(data_packet->getObjectId());
if (barrier != NULL)
{
// Parse the object's data using the temporary ObjectReader
barrier->incWaitingNodes();
}
else
{
vprDEBUG(gadgetDBG_RIM,vprDBG_WARNING_LVL)
<< clrOutBOLD(clrCYAN,"[ApplicationBarrierManager] ")
<< "Got data for an unknown ApplicationBarrier object: "
<< data_packet->getObjectId() << std::endl << vprDEBUG_FLUSH;
}
break;
}
default:
vprDEBUG(gadgetDBG_RIM,vprDBG_WARNING_LVL)
<< clrOutBOLD(clrCYAN,"[ApplicationBarrierManager] ")
<< "Don't know how to handle a packet of type: "
<< packet->getPacketType() << std::endl << vprDEBUG_FLUSH;
break;
}
}
}
示例3: next
const Packet * next() const { return next_.get(); }