12#ifndef STACK_RLC_AM_BUFFER_RLCRETRANSMISSIONBUFFER_H_
13#define STACK_RLC_AM_BUFFER_RLCRETRANSMISSIONBUFFER_H_
33 bool operator<(
const RetxTask &other)
const {
34 if (sn != other.sn)
return sn < other.sn;
35 if (soStart != other.soStart)
return soStart < other.soStart;
36 return soEnd < other.soEnd;
40class RlcRetransmissionBuffer
43 RlcRetransmissionBuffer(uint32_t threshold);
44 virtual ~RlcRetransmissionBuffer();
56 virtual void beginRetxRound() {
57 for (
auto &[sn, state] : retxCounters_)
58 state.incrementedInCurrentRound =
false;
67 virtual bool addNack(uint32_t sn,
bool isWhole, uint32_t start, uint32_t end);
70 virtual bool getNextRetxTask(RetxTask &outTask) {
71 if (pendingRetx_.empty())
73 outTask = *pendingRetx_.begin();
78 virtual uint64_t getRetxPendingBytes();
81 const std::set<RetxTask>& getPendingRetx()
const {
return pendingRetx_; }
84 void markRetransmitted(
const RetxTask &task) { pendingRetx_.erase(task); }
87 virtual void clearSn(uint32_t sn);
91 uint32_t retxCount = 0;
92 bool incrementedInCurrentRound =
false;
95 std::map<uint32_t, RetxState> retxCounters_;
96 std::set<RetxTask> pendingRetx_;
97 uint32_t maxRetxThreshold_;
Definition AlertReceiver.h:24
Represents a specific segment or a whole data unit pending for retransmission. The unit the sequence ...
Definition RlcRetransmissionBuffer.h:27