Skip to content

Commit e96a4c5

Browse files
committed
Pdcp: getOrCreateTxEntity() / getOrCreateRxEntity() inlined
1 parent d1d8419 commit e96a4c5

2 files changed

Lines changed: 6 additions & 29 deletions

File tree

src/simu5g/stack/pdcp/LtePdcp.cc

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ void LtePdcpBase::fromDataPort(cPacket *pktAux)
195195

196196
// get the PDCP entity for this LCID and process the packet
197197
EV << "Processing packet with CID " << cid << "\n";
198-
LteTxPdcpEntity *entity = getOrCreateTxEntity(cid);
198+
LteTxPdcpEntity *entity = lookupTxEntity(cid);
199+
if (entity == nullptr)
200+
entity = createTxEntity(cid);
199201
entity->handlePacketFromUpperLayer(pkt);
200202
}
201203

@@ -212,7 +214,9 @@ void LtePdcpBase::fromLowerLayer(cPacket *pktAux)
212214

213215
MacCid cid = MacCid(lteInfo->getSourceId(), lteInfo->getLcid()); // TODO: check if you have to get master node id
214216

215-
LteRxPdcpEntity *entity = getOrCreateRxEntity(cid);
217+
LteRxPdcpEntity *entity = lookupRxEntity(cid);
218+
if (entity == nullptr)
219+
entity = createRxEntity(cid);
216220
entity->handlePacketFromLowerLayer(pkt);
217221
}
218222

@@ -368,13 +372,6 @@ LteTxPdcpEntity *LtePdcpBase::createTxEntity(MacCid cid)
368372
return txEnt;
369373
}
370374

371-
LteTxPdcpEntity *LtePdcpBase::getOrCreateTxEntity(MacCid cid)
372-
{
373-
LteTxPdcpEntity *entity = lookupTxEntity(cid);
374-
if (entity == nullptr)
375-
entity = createTxEntity(cid);
376-
return entity;
377-
}
378375

379376
LteRxPdcpEntity *LtePdcpBase::lookupRxEntity(MacCid cid)
380377
{
@@ -394,13 +391,6 @@ LteRxPdcpEntity *LtePdcpBase::createRxEntity(MacCid cid)
394391
return rxEnt;
395392
}
396393

397-
LteRxPdcpEntity *LtePdcpBase::getOrCreateRxEntity(MacCid cid)
398-
{
399-
LteRxPdcpEntity *entity = lookupRxEntity(cid);
400-
if (entity == nullptr)
401-
entity = createRxEntity(cid);
402-
return entity;
403-
}
404394

405395
void LtePdcpBase::finish()
406396
{

src/simu5g/stack/pdcp/LtePdcp.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,6 @@ class LtePdcpBase : public cSimpleModule
142142
static simsignal_t sentPacketToLowerLayerSignal_;
143143

144144
protected:
145-
/**
146-
* getTxEntity() and getRxEntity() are used to gather the PDCP entity
147-
* for that LCID. If the entity was already present, a reference
148-
* is returned; otherwise, a new entity is created,
149-
* added to the entities map, and a reference is returned as well.
150-
*
151-
* @param lcid Logical CID
152-
* @return pointer to the PDCP entity for the CID of the flow
153-
*
154-
*/
155-
virtual LteTxPdcpEntity *getOrCreateTxEntity(MacCid cid);
156-
157-
virtual LteRxPdcpEntity *getOrCreateRxEntity(MacCid cid);
158145

159146
/**
160147
* lookupTxEntity() searches for an existing TX PDCP entity for the given CID.

0 commit comments

Comments
 (0)