LEFT | RIGHT |
(no file at all) | |
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) 2006 Georgia Tech Research Corporation | 3 // Copyright (c) 2006 Georgia Tech Research Corporation |
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 } | 222 } |
223 | 223 |
224 bool DataRate::operator != (const DataRate& rhs) const | 224 bool DataRate::operator != (const DataRate& rhs) const |
225 { | 225 { |
226 return m_bps!=rhs.m_bps; | 226 return m_bps!=rhs.m_bps; |
227 } | 227 } |
228 | 228 |
229 double DataRate::CalculateTxTime (uint32_t bytes) const | 229 double DataRate::CalculateTxTime (uint32_t bytes) const |
230 { | 230 { |
231 NS_LOG_FUNCTION (this << bytes); | 231 NS_LOG_FUNCTION (this << bytes); |
232 return static_cast<double>(bytes)*8/m_bps; | 232 return static_cast<double> (bytes)*8/m_bps; |
233 } | 233 } |
234 | 234 |
235 Time DataRate::CalculateBytesTxTime (uint32_t bytes) const | 235 Time DataRate::CalculateBytesTxTime (uint32_t bytes) const |
236 { | 236 { |
237 NS_LOG_FUNCTION (this << bytes); | 237 NS_LOG_FUNCTION (this << bytes); |
238 // \todo avoid to use double (if possible). | 238 // \todo avoid to use double (if possible). |
239 return Seconds (static_cast<double>(bytes)*8/m_bps); | 239 return Seconds (static_cast<double> (bytes)*8/m_bps); |
240 } | 240 } |
241 | 241 |
242 Time DataRate::CalculateBitsTxTime (uint32_t bits) const | 242 Time DataRate::CalculateBitsTxTime (uint32_t bits) const |
243 { | 243 { |
244 NS_LOG_FUNCTION (this << bits); | 244 NS_LOG_FUNCTION (this << bits); |
245 // \todo avoid to use double (if possible). | 245 // \todo avoid to use double (if possible). |
246 return Seconds (static_cast<double>(bits)/m_bps); | 246 return Seconds (static_cast<double> (bits)/m_bps); |
247 } | 247 } |
248 | 248 |
249 uint64_t DataRate::GetBitRate () const | 249 uint64_t DataRate::GetBitRate () const |
250 { | 250 { |
251 NS_LOG_FUNCTION (this); | 251 NS_LOG_FUNCTION (this); |
252 return m_bps; | 252 return m_bps; |
253 } | 253 } |
254 | 254 |
255 DataRate::DataRate (std::string rate) | 255 DataRate::DataRate (std::string rate) |
256 { | 256 { |
(...skipping 30 matching lines...) Expand all Loading... |
287 { | 287 { |
288 return rhs.GetSeconds ()*lhs.GetBitRate (); | 288 return rhs.GetSeconds ()*lhs.GetBitRate (); |
289 } | 289 } |
290 | 290 |
291 double operator* (const Time& lhs, const DataRate& rhs) | 291 double operator* (const Time& lhs, const DataRate& rhs) |
292 { | 292 { |
293 return lhs.GetSeconds ()*rhs.GetBitRate (); | 293 return lhs.GetSeconds ()*rhs.GetBitRate (); |
294 } | 294 } |
295 | 295 |
296 } // namespace ns3 | 296 } // namespace ns3 |
LEFT | RIGHT |