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 "ns3/lte-enb-mac.h"
26 #include "ns3/lte-stats-calculator.h"
27 #include "ns3/nstime.h"
28 #include "ns3/uinteger.h"
29 
30 #include <fstream>
31 #include <string>
32 
33 namespace ns3
34 {
35 
50 {
51  public:
56 
60  ~MacStatsCalculator() override;
61 
62  // Inherited from ns3::Object
67  static TypeId GetTypeId();
68 
74  void SetUlOutputFilename(std::string outputFilename);
75 
80  std::string GetUlOutputFilename();
81 
87  void SetDlOutputFilename(std::string outputFilename);
88 
93  std::string GetDlOutputFilename();
94 
110  void DlScheduling(uint16_t cellId,
111  uint64_t imsi,
112  DlSchedulingCallbackInfo dlSchedulingCallbackInfo);
113 
125  void UlScheduling(uint16_t cellId,
126  uint64_t imsi,
127  uint32_t frameNo,
128  uint32_t subframeNo,
129  uint16_t rnti,
130  uint8_t mcsTb,
131  uint16_t sizeTb,
132  uint8_t componentCarrierId);
133 
142  static void DlSchedulingCallback(Ptr<MacStatsCalculator> macStats,
143  std::string path,
144  DlSchedulingCallbackInfo dlSchedulingCallbackInfo);
145 
158  static void UlSchedulingCallback(Ptr<MacStatsCalculator> macStats,
159  std::string path,
160  uint32_t frameNo,
161  uint32_t subframeNo,
162  uint16_t rnti,
163  uint8_t mcs,
164  uint16_t size,
165  uint8_t componentCarrierId);
166 
167  private:
175 
183 
187  std::ofstream m_dlOutFile;
188 
192  std::ofstream m_ulOutFile;
193 };
194 
195 } // namespace ns3
196 
197 #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:78
a unique identifier for an interface.
Definition: type-id.h:60
Every class exported by the ns3 library is enclosed in the ns3 namespace.
DlSchedulingCallbackInfo structure.
Definition: lte-common.h:231