5G-LENA nr-v3.3-120-gdac69c56
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-fh-phy-sap.h
1// Copyright (c) 2023 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#ifndef NR_FH_PHY_SAP_H
6#define NR_FH_PHY_SAP_H
7
8#include "nr-gnb-phy.h"
9
10namespace ns3
11{
12
24{
25 public:
26 virtual ~NrFhPhySapProvider();
27
28 virtual uint8_t GetFhControlMethod() = 0;
29 virtual bool DoesAllocationFit(uint16_t bwpId,
30 uint32_t mcs,
31 uint32_t nRegs,
32 uint8_t dlRank) = 0;
33 virtual void UpdateTracesBasedOnDroppedData(uint16_t bwpId,
34 uint32_t mcs,
35 uint32_t nRbgs,
36 uint32_t nSymb,
37 uint8_t dlRank) = 0;
38 virtual void NotifyEndSlot(uint16_t bwpId, SfnSf currentSlot) = 0;
39};
40
52{
53 public:
54 virtual ~NrFhPhySapUser();
55
56 virtual uint16_t GetNumerology() const = 0;
57};
58
63template <class C>
65{
66 public:
73
74 MemberNrFhPhySapProvider() = delete;
75
76 uint8_t GetFhControlMethod() override;
77 bool DoesAllocationFit(uint16_t bwpId, uint32_t mcs, uint32_t nRegs, uint8_t dlRank) override;
78 void UpdateTracesBasedOnDroppedData(uint16_t bwpId,
79 uint32_t mcs,
80 uint32_t nRbgs,
81 uint32_t nSymb,
82 uint8_t dlRank) override;
83 void NotifyEndSlot(uint16_t bwpId, SfnSf currentSlot) override;
84
85 private:
86 C* m_owner;
87
88}; // end of class MemberNrFhPhySapProvider
89
90template <class C>
92 : m_owner(owner)
93{
94}
95
96template <class C>
97uint8_t
99{
100 return m_owner->DoGetFhControlMethod();
101}
102
103template <class C>
104bool
105MemberNrFhPhySapProvider<C>::DoesAllocationFit(uint16_t bwpId,
106 uint32_t mcs,
107 uint32_t nRegs,
108 uint8_t dlRank)
109{
110 return m_owner->DoGetDoesAllocationFit(bwpId, mcs, nRegs, dlRank);
111}
112
113template <class C>
114void
115MemberNrFhPhySapProvider<C>::UpdateTracesBasedOnDroppedData(uint16_t bwpId,
116 uint32_t mcs,
117 uint32_t nRbgs,
118 uint32_t nSymb,
119 uint8_t dlRank)
120{
121 return m_owner->DoUpdateTracesBasedOnDroppedData(bwpId, mcs, nRbgs, nSymb, dlRank);
122}
123
124template <class C>
125void
126MemberNrFhPhySapProvider<C>::NotifyEndSlot(uint16_t bwpId, SfnSf currentSlot)
127{
128 return m_owner->DoNotifyEndSlot(bwpId, currentSlot);
129}
130
136template <class C>
138{
139 public:
145 MemberNrFhPhySapUser(C* owner);
146
147 MemberNrFhPhySapUser() = delete;
148
149 uint16_t GetNumerology() const override;
150
151 private:
152 C* m_owner;
153
154}; // end of class NrFhPhySapUser
155
156template <class C>
158 : m_owner(owner)
159{
160}
161
162template <class C>
163uint16_t
165{
166 return m_owner->GetNumerology();
167}
168
169} // namespace ns3
170#endif // NR_FH_PHY_SAP_H
Template for the implementation of the NrFhPhySapProvider as a member of an owner class of type C to ...
Template for the implementation of the NrFhPhySapUser as a member of an owner class of type C to whic...
Service Access Point (SAP) offered by the FhControl instance to the gnb PHY instance.
Service Access Point (SAP) offered by the gnb PHY instance to the FhControl instance.
The SfnSf class.
Definition sfnsf.h:32