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


C++ Iterator::GetDistanceFrom方法代码示例

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


在下文中一共展示了Iterator::GetDistanceFrom方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3:

uint32_t
PeerLinkFrameStart::Deserialize (Buffer::Iterator start)
{
  Buffer::Iterator i = start;
  NS_ASSERT (m_subtype < 3);
  {
    uint8_t id = i.ReadU8 ();
    uint8_t length = i.ReadU8 ();
    m_protocol.DeserializeInformationField (i, length);
    if ((m_protocol.ElementId () != (WifiInformationElementId) id) || (m_protocol.GetInformationFieldSize () != length))
      {
        NS_FATAL_ERROR ("Broken frame: Element ID does not match IE itself!");
      }
    i.Next (m_protocol.GetInformationFieldSize ());
  }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CLOSE) != m_subtype)
    {
      m_capability = i.ReadLsbtohU16 ();
    }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CONFIRM) == m_subtype)
    {
      m_aid = i.ReadLsbtohU16 ();
    }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CLOSE) != m_subtype)
    {
      i = m_rates.Deserialize (i);
      i = m_rates.extended.DeserializeIfPresent (i);
    }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CONFIRM) != m_subtype)
    {
      uint8_t id = i.ReadU8 ();
      uint8_t length = i.ReadU8 ();
      m_meshId.DeserializeInformationField (i, length);
      if ((m_meshId.ElementId () != (WifiInformationElementId) id) || (m_meshId.GetInformationFieldSize () != length))
        {
          NS_FATAL_ERROR ("Broken frame: Element ID does not match IE itself!");
        }
      i.Next (m_meshId.GetInformationFieldSize ());
    }
  if ((uint8_t)(WifiActionHeader::PEER_LINK_CLOSE) != m_subtype)
    {
      uint8_t id = i.ReadU8 ();
      uint8_t length = i.ReadU8 ();
      m_config.DeserializeInformationField (i, length);
      if ((m_config.ElementId () != (WifiInformationElementId) id) || (m_config.GetInformationFieldSize () != length))
        {
          NS_FATAL_ERROR ("Broken frame: Element ID does not match IE itself!");
        }
      i.Next (m_config.GetInformationFieldSize ());
    }
  else
    {
      m_reasonCode = i.ReadLsbtohU16 ();
    }
  return i.GetDistanceFrom (start);
}
开发者ID:shuiziliuBUPT,项目名称:HelloWorld,代码行数:56,代码来源:peer-link-frame.cpp

示例4: 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

示例5: 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

示例6:

uint32_t
UanHeaderRcAck::Deserialize (Buffer::Iterator start)
{
  Buffer::Iterator rbuf = start;
  m_frameNo = rbuf.ReadU8 ();
  uint8_t noAcks = rbuf.ReadU8 ();
  m_nackedFrames.clear ();
  for (uint32_t i = 0; i < noAcks; i++)
    {
      m_nackedFrames.insert (rbuf.ReadU8 ());
    }
  return rbuf.GetDistanceFrom (start);
}
开发者ID:shuiziliuBUPT,项目名称:HelloWorld,代码行数:13,代码来源:uan-header-rc.cpp

示例7: 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

示例8: 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

示例9: 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


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