UlBacklogRegistry.h Source File

Simu5G: UlBacklogRegistry.h Source File
Simu5G
UlBacklogRegistry.h
1//
2// Simu5G
3//
4// Copyright (C) 2026 Andras Varga (OpenSim Ltd)
5//
6// This file is part of a software released under the license included in file
7// "license.pdf". Please read LICENSE and README files before using it.
8// The above files and the present reference are part of the software itself,
9// and cannot be removed from it.
10//
11
12#ifndef _LTE_ULBACKLOGREGISTRY_H_
13#define _LTE_ULBACKLOGREGISTRY_H_
14
15#include <functional>
16
17#include "simu5g/common/LteCommon.h"
18
19namespace simu5g {
20
21class LteMacBuffer;
22
41class UlBacklogRegistry
42{
43 public:
44 typedef std::function<void(MacCid)> BacklogCallback;
45
46 private:
47 std::map<MacCid, LteMacBuffer *> mirrors_;
48 BacklogCallback backlogCallback_;
49
50 public:
51 UlBacklogRegistry() {}
52 ~UlBacklogRegistry();
53
55 void setBacklogCallback(BacklogCallback callback) { backlogCallback_ = std::move(callback); }
56
62 void update(MacCid key, int64_t size, omnetpp::simtime_t timestamp);
63
66
67 bool hasMirror(MacCid key) const { return mirrors_.count(key) != 0; }
68
70 std::vector<MacCid> keys() const;
71
79 std::vector<LteMacBuffer *> ulMirrorsOf(MacNodeId nodeId) const;
80
82 void clearForNode(MacNodeId nodeId);
83
85 void eraseForNode(MacNodeId nodeId);
86
88 const std::map<MacCid, LteMacBuffer *>& mirrors() const { return mirrors_; }
89};
90
91} //namespace
92
93#endif
Buffers for MAC packets.
Definition LteMacBuffer.h:28
Definition LteTypes.h:153
LteMacBuffer * mirror(MacCid key) const
The mirror of a key; throws if no report has created it yet.
std::vector< LteMacBuffer * > ulMirrorsOf(MacNodeId nodeId) const
void eraseForNode(MacNodeId nodeId)
Deletes the node's mirrors outright (the node leaves the cell).
void setBacklogCallback(BacklogCallback callback)
Called with the key whenever a report leaves its mirror with backlog.
Definition UlBacklogRegistry.h:55
void update(MacCid key, int64_t size, omnetpp::simtime_t timestamp)
std::vector< MacCid > keys() const
All keys reports have created so far (drained ones included).
void clearForNode(MacNodeId nodeId)
Empties the node's mirrors, keeping them registered (bearer teardown).
const std::map< MacCid, LteMacBuffer * > & mirrors() const
Read-only view for inspection (WATCH).
Definition UlBacklogRegistry.h:88
Definition AlertReceiver.h:24