5G-LENA nr-v3.3-49-g235218b1
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
lena-lte-comparison/slot-output-stats.h
1// Copyright (c) 2020 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#ifndef SLOT_OUTPUT_STATS_H
6#define SLOT_OUTPUT_STATS_H
7
8#include <ns3/sfnsf.h>
9#include <ns3/sqlite-output.h>
10
11#include <vector>
12
13namespace ns3
14{
15
27class SlotOutputStats
28{
29 public:
34
60 void SetDb(SQLiteOutput* db, const std::string& tableName = "slotStats");
61
73 void SaveSlotStats(const SfnSf& sfnSf,
74 uint32_t scheduledUe,
75 uint32_t usedReg,
76 uint32_t usedSym,
77 uint32_t availableRb,
78 uint32_t availableSym,
79 uint16_t bwpId,
80 uint16_t cellId);
81
85 void EmptyCache();
86
87 private:
88 static void DeleteWhere(SQLiteOutput* p, uint32_t seed, uint32_t run, const std::string& table);
89
90 void WriteCache();
91
92 struct SlotCache
93 {
94 SfnSf sfnSf;
95 uint32_t scheduledUe;
96 uint32_t usedReg;
97 uint32_t usedSym;
98 uint32_t availableRb;
99 uint32_t availableSym;
100 uint16_t bwpId;
101 uint16_t cellId;
102 };
103
104 SQLiteOutput* m_db;
105 std::vector<SlotCache> m_slotCache;
106 std::string m_tableName;
107};
108
109} // namespace ns3
110
111#endif // SLOT_OUTPUT_STATS_H
The SfnSf class.
Definition sfnsf.h:32
SlotOutputStats()
Constructor.
void EmptyCache()
Force the cache write to disk, emptying the cache itself.
void SaveSlotStats(const SfnSf &sfnSf, uint32_t scheduledUe, uint32_t usedReg, uint32_t usedSym, uint32_t availableRb, uint32_t availableSym, uint16_t bwpId, uint16_t cellId)
Save the slot statistics.
void SetDb(SQLiteOutput *db, const std::string &tableName="slotStats")
Install the output database.