5G-LENA
nr-v3.0-25-g90be5d1
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. More... | |
bool | CanInsert () const |
Can an ID be inserted? More... | |
const_iterator | CBegin () |
Const begin of the vector. More... | |
const_iterator | CEnd () |
Const end of the vector. More... | |
const iterator | End () |
End of the vector. More... | |
bool | Erase (uint8_t id) |
Erase the selected process. More... | |
bool | Exist (uint8_t id) const |
Check if the ID exists in the map. More... | |
const iterator | Find (uint8_t key) |
Find a process. More... | |
uint8_t | FirstAvailableId () const |
Find the first (INACTIVE) ID. More... | |
HarqProcess & | Get (uint8_t id) |
Get a reference to a process. More... | |
const HarqProcess & | Get (uint8_t id) const |
Get a const reference to a process. More... | |
bool | Insert (uint8_t *id, const HarqProcess &element) |
Insert a process. More... | |
void | SetMaxSize (uint8_t size) |
Set and reserve the size of the vector. More... | |
uint32_t | Size () const |
Get the used size of the vector. More... | |
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 31 of file nr-mac-harq-vector.h.
|
inline |
Begin of the vector.
Definition at line 94 of file nr-mac-harq-vector.h.
|
inline |
Can an ID be inserted?
Definition at line 180 of file nr-mac-harq-vector.h.
References Size().
|
inline |
Const begin of the vector.
Definition at line 112 of file nr-mac-harq-vector.h.
|
inline |
Const end of the vector.
Definition at line 121 of file nr-mac-harq-vector.h.
|
inline |
End of the vector.
Definition at line 103 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 13 of file nr-mac-harq-vector.cc.
|
inline |
Check if the ID exists in the map.
id | ID to check |
Definition at line 132 of file nr-mac-harq-vector.h.
Referenced by Get().
|
inline |
Find a process.
key | ID of the process to find |
Definition at line 85 of file nr-mac-harq-vector.h.
|
inline |
Find the first (INACTIVE) ID.
Definition at line 164 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 143 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 154 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 31 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 55 of file nr-mac-harq-vector.h.
|
inline |
Get the used size of the vector.
Definition at line 189 of file nr-mac-harq-vector.h.
Referenced by CanInsert().