• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ buffer::Iterator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中buffer::Iterator的典型用法代码示例。如果您正苦于以下问题:C++ Iterator类的具体用法?C++ Iterator怎么用?C++ Iterator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Iterator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1:

uint8_t
IeLinkMetricReport::DeserializeInformationField (Buffer::Iterator start, uint8_t length)
{
  Buffer::Iterator i = start;
  m_metric = i.ReadLsbtohU32 ();
  return i.GetDistanceFrom (start);
}
开发者ID:shuiziliuBUPT,项目名称:HelloWorld,代码行数:7,代码来源:ie-dot11s-metric-report.cpp


示例2:

void
PeerLinkFrameStart::Serialize (Buffer::Iterator start) const
{
  Buffer::Iterator i = start;
  NS_ASSERT (m_subtype < 3);
  i = m_protocol.Serialize (i);
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CLOSE) != m_subtype)
    {
      i.WriteHtolsbU16 (m_capability);
    }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CONFIRM) == m_subtype)
    {
      i.WriteHtolsbU16 (m_aid);
    }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CLOSE) != m_subtype)
    {
      i = m_rates.Serialize (i);
      i = m_rates.extended.Serialize (i);
    }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CONFIRM) != m_subtype)
    {
      i = m_meshId.Serialize (i);
    }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CLOSE) != m_subtype)
    {
      i = m_config.Serialize (i);
    }
  else
    {
      i.WriteHtolsbU16 (m_reasonCode);
    }
}
开发者ID:shuiziliuBUPT,项目名称:HelloWorld,代码行数:32,代码来源:peer-link-frame.cpp


示例3: readDone

bool HTTPClientConnection::readDone() {
  int rc;

  while (true) {
    Buffer::Iterator it = in_.begin();
    Response* response = new Response;
    rc = Parser::parseResponse(&it, response);
    if (rc < 0) {
      delete response;
      LOG(LogMessage::ERROR) << "Error parsing response";
      return false;

    } else if (rc > 0) {
      delete response;
      return true;

    } else /* rc == 0 */ {
      in_.consume(it.bytesRead());
      if (! handleResponse(response)) { // response ownership xfer
        return false;
      }
      if (it.eob()) {
        return true;
      }
    }
  }
}
开发者ID:Amortized,项目名称:Multithreading-Unleashed-in-a-HTTP-Server,代码行数:27,代码来源:http_connection.cpp


示例4:

void
UanHeaderRcCtsGlobal::Serialize (Buffer::Iterator start) const
{
  start.WriteU16 (m_rateNum);
  start.WriteU16 (m_retryRate);
  start.WriteU32 ( (uint32_t)(m_timeStampTx.GetSeconds () * 1000.0 + 0.5));
  start.WriteU32 ( (uint32_t)(m_winTime.GetSeconds () * 1000.0 + 0.5));
}
开发者ID:shuiziliuBUPT,项目名称:HelloWorld,代码行数:8,代码来源:uan-header-rc.cpp


示例5: GetSerializedSize

 uint32_t
 RrepAckHeader::Deserialize (Buffer::Iterator start )
 {
     Buffer::Iterator i = start;
     m_reserved = i.ReadU8 ();
     uint32_t dist = i.GetDistanceFrom (start);
     NS_ASSERT (dist == GetSerializedSize ());
     return dist;
 }
开发者ID:daemonSlayer,项目名称:qosManet,代码行数:9,代码来源:qodPacket.cpp


示例6: Seconds

uint32_t
UanHeaderRcData::Deserialize (Buffer::Iterator start)
{
  Buffer::Iterator rbuf = start;

  m_frameNo = start.ReadU8 ();
  m_propDelay = Seconds ( ((double) start.ReadU16 ()) / 1000.0 );

  return rbuf.GetDistanceFrom (start);
}
开发者ID:shuiziliuBUPT,项目名称:HelloWorld,代码行数:10,代码来源:uan-header-rc.cpp


示例7: WriteTo

 void
 RrepHeader::Serialize (Buffer::Iterator i) const
 {
     i.WriteU8 (m_flags);
     i.WriteU8 (m_prefixSize);
     i.WriteU8 (m_hopCount);
     WriteTo (i, m_dst);
     i.WriteHtonU32 (m_dstSeqNo);
     WriteTo (i, m_origin);
     i.WriteHtonU32 (m_lifeTime);
 }
开发者ID:daemonSlayer,项目名称:qosManet,代码行数:11,代码来源:qodPacket.cpp


示例8: WriteTo

void
IePerr::SerializeInformationField (Buffer::Iterator i) const
{
  i.WriteU8 (0);
  i.WriteU8 (m_addressUnits.size ());
  for (unsigned int j = 0; j < m_addressUnits.size (); j++)
    {
      WriteTo (i, m_addressUnits[j].destination);
      i.WriteHtolsbU32 (m_addressUnits[j].seqnum);
    }
}
开发者ID:shuiziliuBUPT,项目名称:HelloWorld,代码行数:11,代码来源:ie-dot11s-perr.cpp


示例9:

Buffer::Iterator
CapabilityInformation::Serialize (Buffer::Iterator start) const
{
  NS_LOG_FUNCTION (this << &start);
  start.WriteHtolsbU16 (m_capability);
  return start;
}
开发者ID:shuiziliuBUPT,项目名称:HelloWorld,代码行数:7,代码来源:capability-information.cpp


示例10: ReadFrom

uint8_t
IePerr::DeserializeInformationField (Buffer::Iterator start, uint8_t length)
{
  Buffer::Iterator i = start;
  i.Next (1); //Mode flags is not used now
  uint8_t numOfDest = i.ReadU8 ();
  NS_ASSERT ((2 + 10 * numOfDest ) == length);
  length = 0; //to avoid compiler warning in optimized builds
  for (unsigned int j = 0; j < numOfDest; j++)
    {
      HwmpProtocol::FailedDestination unit;
      ReadFrom (i, unit.destination);
      unit.seqnum = i.ReadLsbtohU32 ();
      m_addressUnits.push_back (unit);
    }
  return i.GetDistanceFrom (start);
}
开发者ID:shuiziliuBUPT,项目名称:HelloWorld,代码行数:17,代码来源:ie-dot11s-perr.cpp


示例11: readDone

bool HTTPServerConnection::readDone() {
  int rc;

  while (true) {
    request_.clear();
    Buffer::Iterator it = in_.begin();
    rc = Parser::parseRequest(&it, &request_);
    if (rc < 0) {
      LOG(LogMessage::ERROR) << "Error parsing request";
      return false;

    } else if (rc > 0) {
      return true;

    } else /* rc == 0 */ {
      in_.consume(it.bytesRead());
      if (! handleRequest(&request_)) {
        return false;
      }
    }
  }
}
开发者ID:taohe,项目名称:MCP_MemAlloc_Project,代码行数:22,代码来源:http_connection.cpp


示例12: switch

 uint32_t
 TypeHeader::Deserialize (Buffer::Iterator start)
 {
     Buffer::Iterator i = start;
     uint8_t type = i.ReadU8 ();
     m_valid = true;
     switch (type)
     {
         case AODVTYPE_RREQ:
         case AODVTYPE_RREP:
         case AODVTYPE_RERR:
         case AODVTYPE_RREP_ACK:
         {
             m_type = (MessageType) type;
             break;
         }
         default:
             m_valid = false;
     }
     uint32_t dist = i.GetDistanceFrom (start);
     NS_ASSERT (dist == GetSerializedSize ());
     return dist;
 }
开发者ID:daemonSlayer,项目名称:qosManet,代码行数:23,代码来源:qodPacket.cpp


示例13: UanAddress

uint32_t
UanHeaderRcCts::Deserialize (Buffer::Iterator start)
{
  Buffer::Iterator rbuf = start;
  m_address = UanAddress (rbuf.ReadU8 ());
  m_frameNo = rbuf.ReadU8 ();
  m_retryNo = rbuf.ReadU8 ();
  m_timeStampRts = Seconds ( ( (double) rbuf.ReadU32 ()) / 1000.0 );
  m_delay = Seconds ( ( (double) rbuf.ReadU32 ()) / 1000.0 );

  return rbuf.GetDistanceFrom (start);
}
开发者ID:shuiziliuBUPT,项目名称:HelloWorld,代码行数:12,代码来源:uan-header-rc.cpp


示例14: ReadFrom

        uint32_t
        RrepHeader::Deserialize (Buffer::Iterator start)
        {
            Buffer::Iterator i = start;

            m_flags = i.ReadU8 ();
            m_prefixSize = i.ReadU8 ();
            m_hopCount = i.ReadU8 ();
            ReadFrom (i, m_dst);
            m_dstSeqNo = i.ReadNtohU32 ();
            ReadFrom (i, m_origin);
            m_lifeTime = i.ReadNtohU32 ();

            uint32_t dist = i.GetDistanceFrom (start);
            NS_ASSERT (dist == GetSerializedSize ());
            return dist;
        }
开发者ID:daemonSlayer,项目名称:qosManet,代码行数:17,代码来源:qodPacket.cpp


示例15:

 void
 RrepAckHeader::Serialize (Buffer::Iterator i ) const
 {
     i.WriteU8 (m_reserved);
 }
开发者ID:daemonSlayer,项目名称:qosManet,代码行数:5,代码来源:qodPacket.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ buffer::Parameters类代码示例发布时间:2022-05-31
下一篇:
C++ bsonobjset::const_iterator类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap