7#include "nr-mac-harq-process.h"
9#include <unordered_map>
32 friend std::ostream& operator<<(std::ostream& os,
const NrMacHarqVector& item);
36 typedef typename std::unordered_map<uint8_t, HarqProcess>::iterator
iterator;
40 typedef typename std::unordered_map<uint8_t, HarqProcess>::const_iterator
const_iterator;
57 for (
auto i = 0; i < size; ++i)
68 bool Erase(uint8_t
id);
85 return this->find(key);
112 return this->cbegin();
133 return find(
id) != end();
143 NS_ASSERT(
Exist(
id));
144 return find(
id)->second;
154 NS_ASSERT(
Exist(
id));
155 return find(
id)->second;
164 for (
const auto& it : *
this)
166 if (!it.second.m_active)
180 return Size() < m_maxSize;
193 uint8_t m_maxSize{0};
194 uint8_t m_usedSize{0};
203std::ostream& operator<<(std::ostream& os,
const HarqProcess& item);
Data structure to save all the HARQ process of an UE.
const iterator Begin()
Begin of the vector.
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.
uint32_t Size() const
Get the used size of the vector.
const_iterator CEnd()
Const end of the vector.
uint8_t FirstAvailableId() const
Find the first (INACTIVE) ID.
std::unordered_map< uint8_t, HarqProcess >::const_iterator const_iterator
const_iterator of the map
NrMacHarqVector()=default
Default constructor.
const iterator End()
End of the vector.
std::unordered_map< uint8_t, HarqProcess >::iterator iterator
iterator of the map
bool CanInsert() const
Can an ID be inserted?
const_iterator CBegin()
Const begin of the vector.
bool Exist(uint8_t id) const
Check if the ID exists in the map.
const iterator Find(uint8_t key)
Find a process.
bool Erase(uint8_t id)
Erase the selected process.
void SetMaxSize(uint8_t size)
Set and reserve the size of the vector.
HarqProcess & Get(uint8_t id)
Get a reference to a process.