New design of the MAC SAP

This commit is contained in:
Manuel Requena
2011-06-22 11:48:13 +02:00
parent 4dbb5f714d
commit fe610d8477
4 changed files with 44 additions and 39 deletions

View File

@@ -33,6 +33,7 @@
#include <ns3/lte-mac-tag.h>
#include <ns3/lte-ue-phy.h>
#include "ns3/lte-mac-sap.h"
NS_LOG_COMPONENT_DEFINE ("LteEnbMac");
@@ -103,41 +104,6 @@ EnbMacMemberLteEnbCmacSapProvider::ReleaseLc (uint16_t rnti, uint8_t lcid)
class EnbMacMemberLteMacSapProvider : public LteMacSapProvider
{
public:
EnbMacMemberLteMacSapProvider (LteEnbMac* mac);
// inherited from LteMacSapProvider
virtual void TransmitPdu (TransmitPduParameters params);
virtual void ReportBufferStatus (ReportBufferStatusParameters params);
private:
LteEnbMac* m_mac;
};
EnbMacMemberLteMacSapProvider::EnbMacMemberLteMacSapProvider (LteEnbMac* mac)
: m_mac (mac)
{
}
void
EnbMacMemberLteMacSapProvider::TransmitPdu (TransmitPduParameters params)
{
m_mac->DoTransmitPdu (params);
}
void
EnbMacMemberLteMacSapProvider::ReportBufferStatus (ReportBufferStatusParameters params)
{
m_mac->DoReportBufferStatus (params);
}
class EnbMacMemberFfMacSchedSapUser : public FfMacSchedSapUser
{
public:
@@ -314,7 +280,7 @@ LteEnbMac::GetTypeId (void)
LteEnbMac::LteEnbMac ()
{
NS_LOG_FUNCTION (this);
m_macSapProvider = new EnbMacMemberLteMacSapProvider (this);
m_macSapProvider = new EnbMacMemberLteMacSapProvider<LteEnbMac> (this);
m_cmacSapProvider = new EnbMacMemberLteEnbCmacSapProvider (this);
m_schedSapUser = new EnbMacMemberFfMacSchedSapUser (this);
m_cschedSapUser = new EnbMacMemberFfMacCschedSapUser (this);

View File

@@ -48,7 +48,7 @@ class PdcchMapIdealControlMessage;
class LteEnbMac : public Object
{
friend class EnbMacMemberLteEnbCmacSapProvider;
friend class EnbMacMemberLteMacSapProvider;
friend class EnbMacMemberLteMacSapProvider<LteEnbMac>;
friend class EnbMacMemberFfMacSchedSapUser;
friend class EnbMacMemberFfMacCschedSapUser;
friend class EnbMacMemberLteEnbPhySapUser;

View File

@@ -19,7 +19,7 @@
*/
#include "lte-mac-sap.h"
#include "ns3/lte-mac-sap.h"
namespace ns3 {
@@ -33,4 +33,7 @@ LteMacSapUser::~LteMacSapUser ()
{
}
} // namespace ns3

View File

@@ -46,7 +46,7 @@ public:
{
Ptr<Packet> pdu; /**< the RLC PDU */
uint16_t rnti; /**< the C-RNTI identifying the UE */
uint8_t lcid; /**< the logical channel id corresponding to the sendingx RLC instance */
uint8_t lcid; /**< the logical channel id corresponding to the sending RLC instance */
};
/**
@@ -119,6 +119,42 @@ public:
};
///////////////////////////////////////
template <class C>
class EnbMacMemberLteMacSapProvider : public LteMacSapProvider
{
public:
EnbMacMemberLteMacSapProvider (C* mac);
// inherited from LteMacSapProvider
virtual void TransmitPdu (TransmitPduParameters params);
virtual void ReportBufferStatus (ReportBufferStatusParameters params);
private:
C* m_mac;
};
template <class C>
EnbMacMemberLteMacSapProvider<C>::EnbMacMemberLteMacSapProvider (C* mac)
: m_mac (mac)
{
}
template <class C>
void EnbMacMemberLteMacSapProvider<C>::TransmitPdu (TransmitPduParameters params)
{
m_mac->DoTransmitPdu (params);
}
template <class C>
void EnbMacMemberLteMacSapProvider<C>::ReportBufferStatus (ReportBufferStatusParameters params)
{
m_mac->DoReportBufferStatus (params);
}
} // namespace ns3