A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
cc-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 Danilo Abrignani
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: Danilo Abrignani <danilo.abrignani@unibo.it>
18 */
19
20#ifndef CC_HELPER_H
21#define CC_HELPER_H
22
23#include <ns3/component-carrier.h>
24#include <ns3/config.h>
25#include <ns3/names.h>
26#include <ns3/net-device-container.h>
27#include <ns3/net-device.h>
28#include <ns3/node-container.h>
29#include <ns3/node.h>
30#include <ns3/simulator.h>
31
32#include <map>
33
34namespace ns3
35{
36
57class CcHelper : public Object
58{
59 public:
60 CcHelper();
61 ~CcHelper() override;
62
67 static TypeId GetTypeId();
68 void DoDispose() override;
69
80 ComponentCarrier DoCreateSingleCc(uint16_t ulBandwidth,
81 uint16_t dlBandwidth,
82 uint32_t ulEarfcn,
83 uint32_t dlEarfcn,
84 bool isPrimary);
85
92 void SetCcAttribute(std::string n, const AttributeValue& v);
93
108 std::map<uint8_t, ComponentCarrier> EquallySpacedCcs();
109
115 void SetNumberOfComponentCarriers(uint16_t nCc);
121 void SetUlEarfcn(uint32_t ulEarfcn);
127 void SetDlEarfcn(uint32_t dlEarfcn);
133 void SetDlBandwidth(uint16_t dlBandwidth);
139 void SetUlBandwidth(uint16_t ulBandwidth);
145 uint16_t GetNumberOfComponentCarriers() const;
151 uint32_t GetUlEarfcn() const;
157 uint32_t GetDlEarfcn() const;
163 uint16_t GetDlBandwidth() const;
169 uint16_t GetUlBandwidth() const;
170
171 protected:
172 // inherited from Object
173 void DoInitialize() override;
174
175 private:
187 ComponentCarrier CreateSingleCc(uint16_t ulBandwidth,
188 uint16_t dlBandwidth,
189 uint32_t ulEarfcn,
190 uint32_t dlEarfcn,
191 bool isPrimary) const;
192
195
198 uint16_t m_dlBandwidth;
199 uint16_t m_ulBandwidth;
201
202}; // end of `class LteHelper`
203
204} // namespace ns3
205
206#endif // LTE_HELPER_H
Hold a value for an Attribute.
Definition: attribute.h:70
Creation and configuration of Component Carrier entities.
Definition: cc-helper.h:58
uint32_t GetUlEarfcn() const
Get UL EARFCN.
Definition: cc-helper.cc:147
ObjectFactory m_ccFactory
Factory for each Carrier Component.
Definition: cc-helper.h:194
void SetNumberOfComponentCarriers(uint16_t nCc)
Set number of CCs.
Definition: cc-helper.cc:111
ComponentCarrier DoCreateSingleCc(uint16_t ulBandwidth, uint16_t dlBandwidth, uint32_t ulEarfcn, uint32_t dlEarfcn, bool isPrimary)
Create single CC.
Definition: cc-helper.cc:171
void SetDlEarfcn(uint32_t dlEarfcn)
Set DL EARFCN.
Definition: cc-helper.cc:123
void DoDispose() override
Destructor implementation.
Definition: cc-helper.cc:97
uint16_t GetDlBandwidth() const
Get DL bandwidth.
Definition: cc-helper.cc:159
uint32_t GetDlEarfcn() const
Get DL EARFCN.
Definition: cc-helper.cc:153
void SetUlBandwidth(uint16_t ulBandwidth)
Set UL bandwidth.
Definition: cc-helper.cc:135
~CcHelper() override
Definition: cc-helper.cc:91
void SetDlBandwidth(uint16_t dlBandwidth)
Set DL bandwidth.
Definition: cc-helper.cc:129
uint16_t m_numberOfComponentCarriers
Number of component carriers.
Definition: cc-helper.h:200
uint16_t GetUlBandwidth() const
Get UL bandwidth.
Definition: cc-helper.cc:165
uint16_t m_ulBandwidth
Uplink Bandwidth.
Definition: cc-helper.h:199
uint16_t m_dlBandwidth
Downlink Bandwidth.
Definition: cc-helper.h:198
static TypeId GetTypeId()
Register this type.
Definition: cc-helper.cc:55
std::map< uint8_t, ComponentCarrier > EquallySpacedCcs()
EquallySpacedCcs() create a valid std::map< uint8_t, Ptr<ComponentCarrier> > The Primary Component Ca...
Definition: cc-helper.cc:181
void SetUlEarfcn(uint32_t ulEarfcn)
Set UL EARFCN.
Definition: cc-helper.cc:117
uint16_t GetNumberOfComponentCarriers() const
Get number of component carriers.
Definition: cc-helper.cc:141
void DoInitialize() override
Initialize() implementation.
Definition: cc-helper.cc:49
uint32_t m_ulEarfcn
Uplink EARFCN.
Definition: cc-helper.h:196
uint32_t m_dlEarfcn
Downlink EARFCN.
Definition: cc-helper.h:197
void SetCcAttribute(std::string n, const AttributeValue &v)
Set an attribute for the Component Carrier to be created.
Definition: cc-helper.cc:104
ComponentCarrier CreateSingleCc(uint16_t ulBandwidth, uint16_t dlBandwidth, uint32_t ulEarfcn, uint32_t dlEarfcn, bool isPrimary) const
Create a single component carrier.
Definition: cc-helper.cc:230
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
Instantiate subclasses of ns3::Object.
A base class which provides memory management and object aggregation.
Definition: object.h:89
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.