当前位置: 首页>>代码示例>>C++>>正文


C++ PacketPtr::get方法代码示例

本文整理汇总了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;
	}
开发者ID:Sumxx,项目名称:kbengine,代码行数:19,代码来源:main.cpp

示例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;
      }
   }
}
开发者ID:Michael-Lfx,项目名称:vrjuggler,代码行数:43,代码来源:ApplicationBarrierManager.cpp

示例3: next

	const Packet * next() const	{ return next_.get(); }
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:1,代码来源:packet.hpp


注:本文中的PacketPtr::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。