5G-LENA nr-v3.3-161-gad18933f
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
3gpp-outdoor-calibration/rb-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 RB_OUTPUT_STATS_H
6#define RB_OUTPUT_STATS_H
7
8#include "ns3/sfnsf.h"
9#include "ns3/sqlite-output.h"
10
11#include <vector>
12
13namespace ns3
14{
15
24{
25 public:
30
54 void SetDb(SQLiteOutput* db, const std::string& tableName = "rbStats");
55
62 void SaveRbStats(const SfnSf& sfnSf,
63 uint8_t sym,
64 const std::vector<int> rbUsed,
65 uint16_t bwpId,
66 uint16_t cellId);
67
71 void EmptyCache();
72
73 private:
74 static void DeleteWhere(SQLiteOutput* p, uint32_t seed, uint32_t run, const std::string& table);
75
76 void WriteCache();
77
78 struct RbCache
79 {
80 SfnSf sfnSf;
81 uint8_t sym;
82 std::vector<int> rbUsed;
83 uint16_t cellId;
84 uint16_t bwpId;
85
86 uint32_t GetSize() const
87 {
88 return sizeof(RbCache) + (rbUsed.size() * sizeof(int));
89 }
90 };
91
92 SQLiteOutput* m_db;
93 std::vector<RbCache> m_slotCache;
94 std::string m_tableName;
95};
96
97} // namespace ns3
98
99#endif // RB_OUTPUT_STATS_H
Class to collect and store the Resource Block statistics from a simulation.
void EmptyCache()
Force the cache write to disk, emptying the cache itself.
void SetDb(SQLiteOutput *db, const std::string &tableName="rbStats")
Install the output database.
void SaveRbStats(const SfnSf &sfnSf, uint8_t sym, const std::vector< int > rbUsed, uint16_t bwpId, uint16_t cellId)
Save the slot statistics.
The SfnSf class.
Definition sfnsf.h:32