5G-LENA  nr-v3.0-25-g90be5d1
The 5G/NR module for the ns-3 simulator
ns3::NrMacHarqVector Class Reference

Data structure to save all the HARQ process of an UE. More...

#include "nr-mac-harq-vector.h"

+ Inheritance diagram for ns3::NrMacHarqVector:
+ Collaboration diagram for ns3::NrMacHarqVector:

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...
 
HarqProcessGet (uint8_t id)
 Get a reference to a process. More...
 
const HarqProcessGet (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)
 

Detailed Description

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.

See also
HarqProcess

Definition at line 31 of file nr-mac-harq-vector.h.

Member Function Documentation

◆ Begin()

const iterator ns3::NrMacHarqVector::Begin ( )
inline

Begin of the vector.

Returns
an iterator to the first element

Definition at line 94 of file nr-mac-harq-vector.h.

◆ CanInsert()

bool ns3::NrMacHarqVector::CanInsert ( ) const
inline

Can an ID be inserted?

Returns
true if there is space to insert a new process, false otherwise

Definition at line 180 of file nr-mac-harq-vector.h.

References Size().

+ Here is the call graph for this function:

◆ CBegin()

const_iterator ns3::NrMacHarqVector::CBegin ( )
inline

Const begin of the vector.

Returns
a const iterator to the first element

Definition at line 112 of file nr-mac-harq-vector.h.

◆ CEnd()

const_iterator ns3::NrMacHarqVector::CEnd ( )
inline

Const end of the vector.

Returns
a const iterator to the end() element

Definition at line 121 of file nr-mac-harq-vector.h.

◆ End()

const iterator ns3::NrMacHarqVector::End ( )
inline

End of the vector.

Returns
an iterator to the end() element

Definition at line 103 of file nr-mac-harq-vector.h.

◆ Erase()

bool ns3::NrMacHarqVector::Erase ( uint8_t  id)

Erase the selected process.

Parameters
idID of the process to erase
Returns
true if the process was erased successfully

Definition at line 13 of file nr-mac-harq-vector.cc.

◆ Exist()

bool ns3::NrMacHarqVector::Exist ( uint8_t  id) const
inline

Check if the ID exists in the map.

Parameters
idID to check
Returns
true if the ID exists, false if the ID is outside the maximum number of stored elements

Definition at line 132 of file nr-mac-harq-vector.h.

Referenced by Get().

+ Here is the caller graph for this function:

◆ Find()

const iterator ns3::NrMacHarqVector::Find ( uint8_t  key)
inline

Find a process.

Parameters
keyID of the process to find
Returns
an iterator to the process

Definition at line 85 of file nr-mac-harq-vector.h.

◆ FirstAvailableId()

uint8_t ns3::NrMacHarqVector::FirstAvailableId ( ) const
inline

Find the first (INACTIVE) ID.

Returns
an usable ID, or 255 in case no ID are available

Definition at line 164 of file nr-mac-harq-vector.h.

Referenced by Insert().

+ Here is the caller graph for this function:

◆ Get() [1/2]

HarqProcess& ns3::NrMacHarqVector::Get ( uint8_t  id)
inline

Get a reference to a process.

Parameters
idID of the process
Returns
a reference to the process identified by the parameter id

Definition at line 143 of file nr-mac-harq-vector.h.

References Exist().

+ Here is the call graph for this function:

◆ Get() [2/2]

const HarqProcess& ns3::NrMacHarqVector::Get ( uint8_t  id) const
inline

Get a const reference to a process.

Parameters
idID of the process
Returns
a const reference to the process identified by the parameter id

Definition at line 154 of file nr-mac-harq-vector.h.

References Exist().

+ Here is the call graph for this function:

◆ Insert()

bool ns3::NrMacHarqVector::Insert ( uint8_t *  id,
const HarqProcess element 
)

Insert a process.

Parameters
idWill be overwritten with process ID
elementprocess to store
Returns
true if the process was stored successfully

Definition at line 31 of file nr-mac-harq-vector.cc.

References FirstAvailableId(), and ns3::HarqProcess::m_active.

+ Here is the call graph for this function:

◆ SetMaxSize()

void ns3::NrMacHarqVector::SetMaxSize ( uint8_t  size)
inline

Set and reserve the size of the vector.

Parameters
sizethe vector size

The method will reserve and create the necessary processes.

Definition at line 55 of file nr-mac-harq-vector.h.

◆ Size()

uint32_t ns3::NrMacHarqVector::Size ( ) const
inline

Get the used size of the vector.

Returns
the real size occupied by ACTIVE processes.

Definition at line 189 of file nr-mac-harq-vector.h.

Referenced by CanInsert().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: