5G-LENA nr-v3.3-120-gdac69c56
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
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.
 
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.
 
HarqProcessGet (uint8_t id)
 Get a reference to a process.
 
const HarqProcessGet (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)
 

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 29 of file nr-mac-harq-vector.h.

Member Typedef Documentation

◆ const_iterator

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.

◆ iterator

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.

Member Function Documentation

◆ Begin()

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

Begin of the vector.

Returns
an iterator to the first element

Definition at line 92 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 178 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 110 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 119 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 101 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 11 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 130 of file nr-mac-harq-vector.h.

Referenced by Get(), and 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 83 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 162 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 141 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 152 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 29 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 53 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 187 of file nr-mac-harq-vector.h.

Referenced by CanInsert().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const NrMacHarqVector item 
)
friend

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


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