A Discrete-Event Network Simulator
QKDNetSim v2.0 (NS-3 v3.41) @ (+)
API
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
bs-uplink-scheduler.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007,2008 INRIA
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18  */
19 
20 #include "bs-uplink-scheduler.h"
21 
22 #include "bandwidth-manager.h"
23 #include "bs-link-manager.h"
24 #include "bs-net-device.h"
25 #include "burst-profile-manager.h"
26 #include "cid.h"
27 #include "service-flow-record.h"
28 #include "service-flow.h"
29 #include "ss-manager.h"
30 #include "ss-record.h"
31 
32 #include "ns3/log.h"
33 #include "ns3/simulator.h"
34 #include "ns3/uinteger.h"
35 
36 namespace ns3
37 {
38 
39 NS_LOG_COMPONENT_DEFINE("UplinkScheduler");
40 
41 NS_OBJECT_ENSURE_REGISTERED(UplinkScheduler);
42 
44  : m_bs(nullptr),
45  m_timeStampIrInterval(Seconds(0)),
46  m_nrIrOppsAllocated(0),
47  m_isIrIntrvlAllocated(false),
48  m_isInvIrIntrvlAllocated(false),
49  m_dcdTimeStamp(Simulator::Now()),
50  m_ucdTimeStamp(Simulator::Now())
51 {
52 }
53 
55  : m_bs(bs),
56  m_timeStampIrInterval(Seconds(0)),
57  m_nrIrOppsAllocated(0),
58  m_isIrIntrvlAllocated(false),
59  m_isInvIrIntrvlAllocated(false),
60  m_dcdTimeStamp(Simulator::Now()),
61  m_ucdTimeStamp(Simulator::Now())
62 {
63 }
64 
66 {
67  m_bs = nullptr;
68  m_uplinkAllocations.clear();
69 }
70 
71 void
73 {
74 }
75 
76 TypeId
78 {
79  static TypeId tid = TypeId("ns3::UplinkScheduler").SetParent<Object>().SetGroupName("Wimax");
80  return tid;
81 }
82 
83 uint8_t
85 {
86  return m_nrIrOppsAllocated;
87 }
88 
89 void
90 UplinkScheduler::SetNrIrOppsAllocated(uint8_t nrIrOppsAllocated)
91 {
92  m_nrIrOppsAllocated = nrIrOppsAllocated;
93 }
94 
95 bool
97 {
98  return m_isIrIntrvlAllocated;
99 }
100 
101 void
103 {
104  m_isIrIntrvlAllocated = isIrIntrvlAllocated;
105 }
106 
107 bool
109 {
111 }
112 
113 void
114 UplinkScheduler::SetIsInvIrIntrvlAllocated(bool isInvIrIntrvlAllocated)
115 {
116  m_isInvIrIntrvlAllocated = isInvIrIntrvlAllocated;
117 }
118 
119 Time
121 {
122  return m_dcdTimeStamp;
123 }
124 
125 void
127 {
128  m_dcdTimeStamp = dcdTimeStamp;
129 }
130 
131 Time
133 {
134  return m_ucdTimeStamp;
135 }
136 
137 void
139 {
140  m_ucdTimeStamp = ucdTimeStamp;
141 }
142 
143 std::list<OfdmUlMapIe>
145 {
146  return m_uplinkAllocations;
147 }
148 
149 Time
151 {
152  return m_timeStampIrInterval;
153 }
154 
155 void
157 {
158  m_timeStampIrInterval = timeStampIrInterval;
159 }
160 
163 {
164  return m_bs;
165 }
166 
167 void
169 {
170  m_bs = bs;
171 }
172 } // namespace ns3
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Control the scheduling of simulation events.
Definition: simulator.h:68
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:931
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Time Now()
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:305
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1326
Every class exported by the ns3 library is enclosed in the ns3 namespace.