![]() |
5G-LENA nr-v3.3-120-gdac69c56
The 5G/NR module for the ns-3 simulator
|
Data structure to save all the HARQ process of an UE. More...
#include "nr-mac-harq-vector.h"
Public Types | |
typedef std::unordered_map< uint8_t, HarqProcess >::const_iterator | const_iterator |
const_iterator of the map | |
typedef std::unordered_map< uint8_t, HarqProcess >::iterator | iterator |
iterator of the map | |
Public Member Functions | |
NrMacHarqVector ()=default | |
Default constructor. | |
const iterator | Begin () |
Begin of the vector. | |
bool | CanInsert () const |
Can an ID be inserted? | |
const_iterator | CBegin () |
Const begin of the vector. | |
const_iterator | CEnd () |
Const end of the vector. | |
const iterator | End () |
End of the vector. | |
bool | Erase (uint8_t id) |
Erase the selected process. | |
bool | Exist (uint8_t id) const |
Check if the ID exists in the map. | |
const iterator | Find (uint8_t key) |
Find a process. | |
uint8_t | FirstAvailableId () const |
Find the first (INACTIVE) ID. | |
HarqProcess & | Get (uint8_t id) |
Get a reference to a process. | |
const HarqProcess & | Get (uint8_t id) const |
Get a const reference to a process. | |
bool | Insert (uint8_t *id, const HarqProcess &element) |
Insert a process. | |
void | SetMaxSize (uint8_t size) |
Set and reserve the size of the vector. | |
uint32_t | Size () const |
Get the used size of the vector. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const NrMacHarqVector &item) |
Data structure to save all the HARQ process of an UE.
The data is stored as an unordered_map between the process ID and the real data, saved in the structure HarqProcess. The vector (yes, it is an improper name) is always full (i.e., it always contains almost 20 HARQ processes) but they can be inactive (i.e., no data is stored there). The duty of finding an empty spot is split between Insert and FirstAvailableId.
The class does not support going "out of space", or in other words, if all the spots are filled with active processes, the next insert will fail.
Definition at line 29 of file nr-mac-harq-vector.h.
typedef std::unordered_map<uint8_t,HarqProcess>::const_iterator ns3::NrMacHarqVector::const_iterator |
const_iterator of the map
Definition at line 40 of file nr-mac-harq-vector.h.
typedef std::unordered_map<uint8_t,HarqProcess>::iterator ns3::NrMacHarqVector::iterator |
iterator of the map
Definition at line 36 of file nr-mac-harq-vector.h.
|
inline |
Begin of the vector.
Definition at line 92 of file nr-mac-harq-vector.h.
|
inline |
Can an ID be inserted?
Definition at line 178 of file nr-mac-harq-vector.h.
References Size().
|
inline |
Const begin of the vector.
Definition at line 110 of file nr-mac-harq-vector.h.
|
inline |
Const end of the vector.
Definition at line 119 of file nr-mac-harq-vector.h.
|
inline |
End of the vector.
Definition at line 101 of file nr-mac-harq-vector.h.
bool ns3::NrMacHarqVector::Erase | ( | uint8_t | id | ) |
Erase the selected process.
id | ID of the process to erase |
Definition at line 11 of file nr-mac-harq-vector.cc.
|
inline |
Check if the ID exists in the map.
id | ID to check |
Definition at line 130 of file nr-mac-harq-vector.h.
Referenced by Get(), and Get().
|
inline |
Find a process.
key | ID of the process to find |
Definition at line 83 of file nr-mac-harq-vector.h.
|
inline |
Find the first (INACTIVE) ID.
Definition at line 162 of file nr-mac-harq-vector.h.
Referenced by Insert().
|
inline |
Get a reference to a process.
id | ID of the process |
Definition at line 141 of file nr-mac-harq-vector.h.
References Exist().
|
inline |
Get a const reference to a process.
id | ID of the process |
Definition at line 152 of file nr-mac-harq-vector.h.
References Exist().
bool ns3::NrMacHarqVector::Insert | ( | uint8_t * | id, |
const HarqProcess & | element | ||
) |
Insert a process.
id | Will be overwritten with process ID |
element | process to store |
Definition at line 29 of file nr-mac-harq-vector.cc.
References FirstAvailableId(), and ns3::HarqProcess::m_active.
|
inline |
Set and reserve the size of the vector.
size | the vector size |
The method will reserve and create the necessary processes.
Definition at line 53 of file nr-mac-harq-vector.h.
|
inline |
Get the used size of the vector.
Definition at line 187 of file nr-mac-harq-vector.h.
Referenced by CanInsert().
|
friend |
Definition at line 54 of file nr-mac-harq-vector.cc.