LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2009 University of Washington | 3 * Copyright (c) 2009 University of Washington |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 m_transmitted (false) | 50 m_transmitted (false) |
51 { | 51 { |
52 | 52 |
53 } | 53 } |
54 | 54 |
55 Reservation::Reservation (std::list<std::pair <Ptr<Packet>, UanAddress > > &list
, uint8_t frameNo, uint32_t maxPkts) | 55 Reservation::Reservation (std::list<std::pair <Ptr<Packet>, UanAddress > > &list
, uint8_t frameNo, uint32_t maxPkts) |
56 : m_frameNo (frameNo), | 56 : m_frameNo (frameNo), |
57 m_retryNo (0), | 57 m_retryNo (0), |
58 m_transmitted (false) | 58 m_transmitted (false) |
59 { | 59 { |
60 uint32_t numPkts = (maxPkts) ? maxPkts : list.size (); | 60 uint32_t numPkts = (maxPkts) ? maxPkts : static_cast<uint32_t>(list.size ()); |
61 uint32_t length = 0; | 61 uint32_t length = 0; |
62 UanHeaderRcData dh; | 62 UanHeaderRcData dh; |
63 UanHeaderCommon ch; | 63 UanHeaderCommon ch; |
64 | 64 |
65 for (uint32_t i = 0; i < numPkts; i++) | 65 for (uint32_t i = 0; i < numPkts; i++) |
66 { | 66 { |
67 length += list.front ().first->GetSize () + | 67 length += list.front ().first->GetSize () + |
68 ch.GetSerializedSize () + | 68 ch.GetSerializedSize () + |
69 dh.GetSerializedSize (); | 69 dh.GetSerializedSize (); |
70 m_pktList.push_back (list.front ()); | 70 m_pktList.push_back (list.front ()); |
71 list.pop_front (); | 71 list.pop_front (); |
72 } | 72 } |
73 m_length = length; | 73 m_length = length; |
74 } | 74 } |
75 | 75 |
76 Reservation::~Reservation () | 76 Reservation::~Reservation () |
77 { | 77 { |
78 std::list<std::pair <Ptr<Packet>, UanAddress > >::iterator it; | 78 std::list<std::pair <Ptr<Packet>, UanAddress > >::iterator it; |
79 for (it = m_pktList.begin (); it != m_pktList.end (); it++) | 79 for (it = m_pktList.begin (); it != m_pktList.end (); it++) |
80 { | 80 { |
81 it->first = Ptr<Packet> ((Packet *) 0); | 81 it->first = Ptr<Packet> ((Packet *) 0); |
82 } | 82 } |
83 m_pktList.clear (); | 83 m_pktList.clear (); |
84 m_timestamp.clear (); | 84 m_timestamp.clear (); |
85 } | 85 } |
86 uint32_t | 86 uint32_t |
87 Reservation::GetNoFrames () const | 87 Reservation::GetNoFrames () const |
88 { | 88 { |
89 return m_pktList.size (); | 89 return static_cast<uint32_t>(m_pktList.size ()); |
90 } | 90 } |
91 | 91 |
92 uint32_t | 92 uint32_t |
93 Reservation::GetLength () const | 93 Reservation::GetLength () const |
94 { | 94 { |
95 return m_length; | 95 return m_length; |
96 } | 96 } |
97 | 97 |
98 const std::list<std::pair <Ptr<Packet>, UanAddress > > & | 98 const std::list<std::pair <Ptr<Packet>, UanAddress > > & |
99 Reservation::GetPktList (void) const | 99 Reservation::GetPktList (void) const |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 m_rtsEvent = Simulator::Schedule (Seconds (timeout), &UanMacRc::RtsTimeout, th
is); | 773 m_rtsEvent = Simulator::Schedule (Seconds (timeout), &UanMacRc::RtsTimeout, th
is); |
774 } | 774 } |
775 | 775 |
776 void· | 776 void· |
777 UanMacRc::BlockRtsing (void) | 777 UanMacRc::BlockRtsing (void) |
778 { | 778 { |
779 m_rtsBlocked = true; | 779 m_rtsBlocked = true; |
780 } | 780 } |
781 | 781 |
782 } // namespace ns3 | 782 } // namespace ns3 |
LEFT | RIGHT |