A Discrete-Event Network Simulator
API
mac-stats-calculator.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
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: Jaume Nin <jnin@cttc.es>
18  * Modified by: Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015)
19  * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
20  */
21 
22 #ifndef MAC_STATS_CALCULATOR_H_
23 #define MAC_STATS_CALCULATOR_H_
24 
25 #include "lte-stats-calculator.h"
26 
27 #include "ns3/lte-enb-mac.h"
28 #include "ns3/nstime.h"
29 #include "ns3/uinteger.h"
30 
31 #include <fstream>
32 #include <string>
33 
34 namespace ns3
35 {
36 
51 {
52  public:
57 
61  ~MacStatsCalculator() override;
62 
63  // Inherited from ns3::Object
68  static TypeId GetTypeId();
69 
75  void SetUlOutputFilename(std::string outputFilename);
76 
81  std::string GetUlOutputFilename();
82 
88  void SetDlOutputFilename(std::string outputFilename);
89 
94  std::string GetDlOutputFilename();
95 
111  void DlScheduling(uint16_t cellId,
112  uint64_t imsi,
113  DlSchedulingCallbackInfo dlSchedulingCallbackInfo);
114 
126  void UlScheduling(uint16_t cellId,
127  uint64_t imsi,
128  uint32_t frameNo,
129  uint32_t subframeNo,
130  uint16_t rnti,
131  uint8_t mcsTb,
132  uint16_t sizeTb,
133  uint8_t componentCarrierId);
134 
143  static void DlSchedulingCallback(Ptr<MacStatsCalculator> macStats,
144  std::string path,
145  DlSchedulingCallbackInfo dlSchedulingCallbackInfo);
146 
159  static void UlSchedulingCallback(Ptr<MacStatsCalculator> macStats,
160  std::string path,
161  uint32_t frameNo,
162  uint32_t subframeNo,
163  uint16_t rnti,
164  uint8_t mcs,
165  uint16_t size,
166  uint8_t componentCarrierId);
167 
168  private:
176 
184 
188  std::ofstream m_dlOutFile;
189 
193  std::ofstream m_ulOutFile;
194 };
195 
196 } // namespace ns3
197 
198 #endif /* MAC_STATS_CALCULATOR_H_ */
Base class for ***StatsCalculator classes.
Takes care of storing the information generated at MAC layer.
~MacStatsCalculator() override
Destructor.
static TypeId GetTypeId()
Register this type.
std::ofstream m_dlOutFile
Downlink output trace file.
void UlScheduling(uint16_t cellId, uint64_t imsi, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcsTb, uint16_t sizeTb, uint8_t componentCarrierId)
Notifies the stats calculator that an uplink scheduling has occurred.
bool m_dlFirstWrite
When writing DL MAC statistics first time to file, columns description is added.
static void DlSchedulingCallback(Ptr< MacStatsCalculator > macStats, std::string path, DlSchedulingCallbackInfo dlSchedulingCallbackInfo)
Trace sink for the ns3::LteEnbMac::DlScheduling trace source.
void SetDlOutputFilename(std::string outputFilename)
Set the name of the file where the downlink statistics will be stored.
std::ofstream m_ulOutFile
Uplink output trace file.
std::string GetUlOutputFilename()
Get the name of the file where the uplink statistics will be stored.
static void UlSchedulingCallback(Ptr< MacStatsCalculator > macStats, std::string path, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t size, uint8_t componentCarrierId)
Trace sink for the ns3::LteEnbMac::UlScheduling trace source.
void DlScheduling(uint16_t cellId, uint64_t imsi, DlSchedulingCallbackInfo dlSchedulingCallbackInfo)
Notifies the stats calculator that an downlink scheduling has occurred.
void SetUlOutputFilename(std::string outputFilename)
Set the name of the file where the uplink statistics will be stored.
bool m_ulFirstWrite
When writing UL MAC statistics first time to file, columns description is added.
std::string GetDlOutputFilename()
Get the name of the file where the downlink statistics will be stored.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
DlSchedulingCallbackInfo structure.
Definition: lte-common.h:237