5G-LENA nr-v3.1-14-g738b08bc
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
ns3::NrChAccessManager Class Referenceabstract

The Channel Access Manager class. More...

#include "nr-ch-access-manager.h"

+ Inheritance diagram for ns3::NrChAccessManager:
+ Collaboration diagram for ns3::NrChAccessManager:

Public Types

typedef std::function< void()> AccessDeniedCallback
 A function that signal that the channel is denied and the request should be retried.
 
typedef std::function< void(const Time &time)> AccessGrantedCallback
 A function that signal that the channel has been earned.
 

Public Member Functions

 NrChAccessManager ()
 ChannelAccessManager constructor.
 
 ~NrChAccessManager () override
 ~ChannelAccessManager
 
virtual void Cancel ()=0
 Cancel a previously invoked request for accessing the channel.
 
Time GetGrantDuration () const
 Get grant duration time.
 
Ptr< NrGnbMacGetNrGnbMac ()
 Getter for MAC instance to which is connected this channel access manager.
 
Ptr< NrSpectrumPhyGetNrSpectrumPhy ()
 Getter for spectrum phy instance to which is connected this channel access manager.
 
virtual void RequestAccess ()=0
 RequestAccess.
 
virtual void SetAccessDeniedCallback (const AccessDeniedCallback &cb)=0
 Set Access-Denied Callback.
 
virtual void SetAccessGrantedCallback (const AccessGrantedCallback &cb)=0
 Set Access-Granted Callback.
 
void SetGrantDuration (Time grantDuration)
 Set duration of grant for transmission.
 
virtual void SetNrGnbMac (Ptr< NrGnbMac > mac)
 Set MAC instance for this channel access manager.
 
virtual void SetNrSpectrumPhy (Ptr< NrSpectrumPhy > spectrumPhy)
 Set spectrum phy instance for this channel access manager.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 

Detailed Description

The Channel Access Manager class.

This is the interface for any channel access manager. A channel access manager is responsible to listen to the channel, informing the PHY when it is free for transmitting.

Requesting the channel

The PHY would call the method RequestAccess(). Then, when the channel is available for transmission, the channel access manager would call the callback set with the method SetAccessGrantedCallback(). If the channel cannot be access, then the callback set with SetAccessDeniedCallback() will be called, instead. The request can be cancelled by calling Cancel().

Configuration

Any channel access manager attribute can be set through the helper methods NrHelper::SetUeChannelAccessManagerAttribute() or NrHelper::SetGnbChannelAccessManagerAttribute(). Another option is directly calling SetAttribute on the pointer. The list of attributes is reported below, in the Attributes section.

See also
NrAlwaysOnAccessManager

Introspection did not find any typical Config paths.

Attributes

  • GrantDuration: Duration of grant for transmitting.
    • Set with class: ns3::TimeValue
    • Underlying type: Time +9.22337e+18ns:+9.22337e+18ns
    • Initial value: +6e+10ns
    • Flags: construct write read

No TraceSources are defined for this type.
Size of this type is 80 bytes (on a 64-bit architecture).

Definition at line 46 of file nr-ch-access-manager.h.

Member Typedef Documentation

◆ AccessDeniedCallback

typedef std::function<void()> ns3::NrChAccessManager::AccessDeniedCallback

A function that signal that the channel is denied and the request should be retried.

Definition at line 85 of file nr-ch-access-manager.h.

◆ AccessGrantedCallback

typedef std::function<void(const Time& time)> ns3::NrChAccessManager::AccessGrantedCallback

A function that signal that the channel has been earned.

Definition at line 80 of file nr-ch-access-manager.h.

Constructor & Destructor Documentation

◆ NrChAccessManager()

ns3::NrChAccessManager::NrChAccessManager ( )

ChannelAccessManager constructor.

Definition at line 31 of file nr-ch-access-manager.cc.

◆ ~NrChAccessManager()

ns3::NrChAccessManager::~NrChAccessManager ( )
override

~ChannelAccessManager

Definition at line 36 of file nr-ch-access-manager.cc.

Member Function Documentation

◆ Cancel()

virtual void ns3::NrChAccessManager::Cancel ( )
pure virtual

Cancel a previously invoked request for accessing the channel.

Implemented in ns3::NrAlwaysOnAccessManager.

◆ GetGrantDuration()

Time ns3::NrChAccessManager::GetGrantDuration ( ) const

Get grant duration time.

Returns
default grant duration

Definition at line 49 of file nr-ch-access-manager.cc.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetNrGnbMac()

Ptr< NrGnbMac > ns3::NrChAccessManager::GetNrGnbMac ( )

Getter for MAC instance to which is connected this channel access manager.

Returns
pointer to MAC instance

Definition at line 77 of file nr-ch-access-manager.cc.

◆ GetNrSpectrumPhy()

Ptr< NrSpectrumPhy > ns3::NrChAccessManager::GetNrSpectrumPhy ( )

Getter for spectrum phy instance to which is connected this channel access manager.

Returns
pointer to spectrum phy instance

Definition at line 63 of file nr-ch-access-manager.cc.

◆ GetTypeId()

TypeId ns3::NrChAccessManager::GetTypeId ( )
static

Get the type ID.

Returns
the type id

Definition at line 17 of file nr-ch-access-manager.cc.

References GetGrantDuration(), and SetGrantDuration().

+ Here is the call graph for this function:

◆ RequestAccess()

virtual void ns3::NrChAccessManager::RequestAccess ( )
pure virtual

RequestAccess.

When the channel is granted, the callback set with SetAccessGrantedCallback() will be called.

Implemented in ns3::NrAlwaysOnAccessManager.

◆ SetAccessDeniedCallback()

virtual void ns3::NrChAccessManager::SetAccessDeniedCallback ( const AccessDeniedCallback cb)
pure virtual

Set Access-Denied Callback.

Parameters
cbthe callback to invoke when the channel access is denied

Implemented in ns3::NrAlwaysOnAccessManager.

◆ SetAccessGrantedCallback()

virtual void ns3::NrChAccessManager::SetAccessGrantedCallback ( const AccessGrantedCallback cb)
pure virtual

Set Access-Granted Callback.

Parameters
cbthe callback to invoke when the channel access is granted

Implemented in ns3::NrAlwaysOnAccessManager.

◆ SetGrantDuration()

void ns3::NrChAccessManager::SetGrantDuration ( Time  grantDuration)

Set duration of grant for transmission.

Parameters
grantDurationduration of grant

Definition at line 42 of file nr-ch-access-manager.cc.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetNrGnbMac()

void ns3::NrChAccessManager::SetNrGnbMac ( Ptr< NrGnbMac mac)
virtual

Set MAC instance for this channel access manager.

Parameters
macgNB mac instance

Definition at line 70 of file nr-ch-access-manager.cc.

◆ SetNrSpectrumPhy()

void ns3::NrChAccessManager::SetNrSpectrumPhy ( Ptr< NrSpectrumPhy spectrumPhy)
virtual

Set spectrum phy instance for this channel access manager.

Parameters
spectrumPhyspectrum phy instance

Definition at line 56 of file nr-ch-access-manager.cc.


The documentation for this class was generated from the following files: