A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
data-rate.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
//
3
// Copyright (c) 2006 Georgia Tech Research Corporation
4
//
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
7
// published by the Free Software Foundation;
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
//
18
// Author: Rajib Bhattacharjea<raj.b@gatech.edu>
19
//
20
21
#ifndef DATA_RATE_H
22
#define DATA_RATE_H
23
24
#include <string>
25
#include <iostream>
26
#include <stdint.h>
27
#include "ns3/nstime.h"
28
#include "ns3/attribute.h"
29
#include "ns3/attribute-helper.h"
30
#include "ns3/deprecated.h"
31
32
namespace
ns3 {
33
88
class
DataRate
89
{
90
public
:
91
DataRate
();
100
DataRate
(uint64_t bps);
119
DataRate
(std::string rate);
120
126
bool
operator <
(
const
DataRate
& rhs)
const
;
127
133
bool
operator <=
(
const
DataRate
& rhs)
const
;
134
140
bool
operator >
(
const
DataRate
& rhs)
const
;
141
147
bool
operator >=
(
const
DataRate
& rhs)
const
;
148
154
bool
operator ==
(
const
DataRate
& rhs)
const
;
155
161
bool
operator !=
(
const
DataRate
& rhs)
const
;
162
170
Time
CalculateBytesTxTime
(uint32_t bytes)
const
;
171
179
Time
CalculateBitsTxTime
(uint32_t bits)
const
;
180
191
double
CalculateTxTime
(uint32_t bytes)
const
NS_DEPRECATED
;
192
197
uint64_t
GetBitRate
()
const
;
198
199
private
:
200
215
static
bool
DoParse
(
const
std::string s, uint64_t *v);
216
217
// Uses DoParse
218
friend
std::istream &
operator >>
(std::istream &is,
DataRate
&rate);
219
220
uint64_t
m_bps
;
221
};
222
230
std::ostream &
operator <<
(std::ostream &os,
const
DataRate
&rate);
231
239
std::istream &
operator >>
(std::istream &is,
DataRate
&rate);
240
241
ATTRIBUTE_HELPER_HEADER
(
DataRate
);
242
243
252
double
operator*
(
const
DataRate
& lhs,
const
Time
& rhs);
261
double
operator*
(
const
Time
& lhs,
const
DataRate
& rhs);
262
263
264
}
// namespace ns3
265
266
#endif
/* DATA_RATE_H */
ns3::operator>>
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
Definition:
angles.cc:48
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:102
ns3::DataRate::CalculateBytesTxTime
Time CalculateBytesTxTime(uint32_t bytes) const
Calculate transmission time.
Definition:
data-rate.cc:235
ns3::DataRate::CalculateTxTime
double CalculateTxTime(uint32_t bytes) const NS_DEPRECATED
Calculate transmission time.
Definition:
data-rate.cc:229
ns3::DataRate::operator<
bool operator<(const DataRate &rhs) const
Definition:
data-rate.cc:199
ns3::DataRate::operator>
bool operator>(const DataRate &rhs) const
Definition:
data-rate.cc:209
ns3::ATTRIBUTE_HELPER_HEADER
ATTRIBUTE_HELPER_HEADER(BleAccessAddress)
ns3::DataRate::m_bps
uint64_t m_bps
data rate [bps]
Definition:
data-rate.h:220
ns3::DataRate::DoParse
static bool DoParse(const std::string s, uint64_t *v)
Parse a string representing a DataRate into an uint64_t.
Definition:
data-rate.cc:34
ns3::DataRate
Class for representing data rates.
Definition:
data-rate.h:88
ns3::operator*
int64x64_t operator*(const int64x64_t &lhs, const int64x64_t &rhs)
Multiplication operator.
Definition:
int64x64.h:108
ns3::DataRate::operator>>
friend std::istream & operator>>(std::istream &is, DataRate &rate)
Stream extraction operator.
Definition:
data-rate.cc:272
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition:
angles.cc:42
ns3::DataRate::GetBitRate
uint64_t GetBitRate() const
Get the underlying bitrate.
Definition:
data-rate.cc:249
ns3::DataRate::CalculateBitsTxTime
Time CalculateBitsTxTime(uint32_t bits) const
Calculate transmission time.
Definition:
data-rate.cc:242
ns3::DataRate::DataRate
DataRate()
Definition:
data-rate.cc:187
NS_DEPRECATED
#define NS_DEPRECATED
Mark a function as deprecated.
Definition:
deprecated.h:47
ns3::DataRate::operator<=
bool operator<=(const DataRate &rhs) const
Definition:
data-rate.cc:204
ns3::DataRate::operator>=
bool operator>=(const DataRate &rhs) const
Definition:
data-rate.cc:214
ns3::DataRate::operator!=
bool operator!=(const DataRate &rhs) const
Definition:
data-rate.cc:224
ns3::DataRate::operator==
bool operator==(const DataRate &rhs) const
Definition:
data-rate.cc:219
src
network
utils
data-rate.h
Generated on Wed Jul 6 2016 17:11:37 for ns-3 by
1.8.6