A Discrete-Event Network Simulator
API
ns3::ChannelScheduler Class Referenceabstract

This class will assign channel access for requests from higher layers. More...

#include "channel-scheduler.h"

+ Inheritance diagram for ns3::ChannelScheduler:
+ Collaboration diagram for ns3::ChannelScheduler:

Public Member Functions

 ChannelScheduler ()
 
virtual ~ChannelScheduler ()
 
virtual enum ChannelAccess GetAssignedAccessType (uint32_t channelNumber) const =0
 
bool IsAlternatingAccessAssigned (uint32_t channelNumber) const
 
bool IsCchAccessAssigned (void) const
 
bool IsChannelAccessAssigned (uint32_t channelNumber) const
 
bool IsContinuousAccessAssigned (uint32_t channelNumber) const
 
bool IsDefaultCchAccessAssigned (void) const
 
bool IsExtendedAccessAssigned (uint32_t channelNumber) const
 
bool IsSchAccessAssigned (void) const
 
virtual void SetWaveNetDevice (Ptr< WaveNetDevice > device)
 
bool StartSch (const SchInfo &schInfo)
 
bool StopSch (uint32_t channelNumber)
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= ([[maybe_unused]] const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Protected Member Functions

virtual bool AssignAlternatingAccess (uint32_t channelNumber, bool immediate)=0
 
virtual bool AssignContinuousAccess (uint32_t channelNumber, bool immediate)=0
 
virtual bool AssignDefaultCchAccess (void)=0
 This method will assign default CCH access for CCH. More...
 
virtual bool AssignExtendedAccess (uint32_t channelNumber, uint32_t extends, bool immediate)=0
 
virtual void DoDispose (void)
 Destructor implementation. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
virtual bool ReleaseAccess (uint32_t channelNumber)=0
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Protected Attributes

Ptr< WaveNetDevicem_device
 the device More...
 

Additional Inherited Members

Detailed Description

This class will assign channel access for requests from higher layers.

The channel access options include (1) continuous access for SCHs, (2) alternating CCH and SCH access, (3) extended access for SCHs and (4) default continuous CCH access. The options except (4) have an immediate parameter to enable immediate access assignment without the need for waiting. Its sub-class can use different mechanism to assign the channel access.

Config Paths

ns3::ChannelScheduler is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::WaveNetDevice/ChannelScheduler"

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

Definition at line 129 of file channel-scheduler.h.

Constructor & Destructor Documentation

◆ ChannelScheduler()

ns3::ChannelScheduler::ChannelScheduler ( )

Definition at line 42 of file channel-scheduler.cc.

References NS_LOG_FUNCTION.

◆ ~ChannelScheduler()

ns3::ChannelScheduler::~ChannelScheduler ( )
virtual

Definition at line 46 of file channel-scheduler.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AssignAlternatingAccess()

virtual bool ns3::ChannelScheduler::AssignAlternatingAccess ( uint32_t  channelNumber,
bool  immediate 
)
protectedpure virtual
Parameters
channelNumberthe specific channel
immediateindicate whether channel switch to channel
Returns
whether the channel access is assigned successfully

This method will assign alternating access for SCHs and CCH.

Implemented in ns3::DefaultChannelScheduler.

Referenced by StartSch().

+ Here is the caller graph for this function:

◆ AssignContinuousAccess()

virtual bool ns3::ChannelScheduler::AssignContinuousAccess ( uint32_t  channelNumber,
bool  immediate 
)
protectedpure virtual
Parameters
channelNumberthe specific channel
immediateindicate whether channel switch to channel
Returns
whether the channel access is assigned successfully

This method will assign continuous access CCH.

Implemented in ns3::DefaultChannelScheduler.

Referenced by StartSch().

+ Here is the caller graph for this function:

◆ AssignDefaultCchAccess()

virtual bool ns3::ChannelScheduler::AssignDefaultCchAccess ( void  )
protectedpure virtual

This method will assign default CCH access for CCH.

Returns
whether the channel access is assigned successfully

Implemented in ns3::DefaultChannelScheduler.

Referenced by DoInitialize().

+ Here is the caller graph for this function:

◆ AssignExtendedAccess()

virtual bool ns3::ChannelScheduler::AssignExtendedAccess ( uint32_t  channelNumber,
uint32_t  extends,
bool  immediate 
)
protectedpure virtual
Parameters
channelNumberthe specific channel
extendsextension duration
immediateindicate whether channel switch to channel
Returns
whether the channel access is assigned successfully

This method will assign extended access for SCHs.

Implemented in ns3::DefaultChannelScheduler.

Referenced by StartSch().

+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::ChannelScheduler::DoDispose ( void  )
protectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Reimplemented in ns3::DefaultChannelScheduler.

Definition at line 164 of file channel-scheduler.cc.

References m_device, and NS_LOG_FUNCTION.

Referenced by ns3::DefaultChannelScheduler::DoDispose().

+ Here is the caller graph for this function:

◆ DoInitialize()

void ns3::ChannelScheduler::DoInitialize ( void  )
protectedvirtual

Initialize() implementation.

This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.

Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.

Reimplemented from ns3::Object.

Reimplemented in ns3::DefaultChannelScheduler.

Definition at line 52 of file channel-scheduler.cc.

References AssignDefaultCchAccess().

Referenced by ns3::DefaultChannelScheduler::DoInitialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAssignedAccessType()

virtual enum ChannelAccess ns3::ChannelScheduler::GetAssignedAccessType ( uint32_t  channelNumber) const
pure virtual
Parameters
channelNumberthe specified channel number
Returns
the type of current assigned channel access for the specific channel.

Implemented in ns3::DefaultChannelScheduler.

Referenced by IsAlternatingAccessAssigned(), IsCchAccessAssigned(), IsChannelAccessAssigned(), IsContinuousAccessAssigned(), IsDefaultCchAccessAssigned(), IsExtendedAccessAssigned(), and IsSchAccessAssigned().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::ChannelScheduler::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 33 of file channel-scheduler.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ IsAlternatingAccessAssigned()

bool ns3::ChannelScheduler::IsAlternatingAccessAssigned ( uint32_t  channelNumber) const
Parameters
channelNumberthe specified channel number
Returns
whether the continuous access is assigned for the specific channel.

Definition at line 95 of file channel-scheduler.cc.

References ns3::AlternatingAccess, GetAssignedAccessType(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ IsCchAccessAssigned()

bool ns3::ChannelScheduler::IsCchAccessAssigned ( void  ) const
Returns
whether CCH channel access is assigned.

Definition at line 73 of file channel-scheduler.cc.

References CCH, GetAssignedAccessType(), ns3::NoAccess, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ IsChannelAccessAssigned()

bool ns3::ChannelScheduler::IsChannelAccessAssigned ( uint32_t  channelNumber) const
Parameters
channelNumberthe specified channel number
Returns
whether channel access is assigned for the channel.

Definition at line 66 of file channel-scheduler.cc.

References GetAssignedAccessType(), ns3::NoAccess, and NS_LOG_FUNCTION.

Referenced by StopSch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsContinuousAccessAssigned()

bool ns3::ChannelScheduler::IsContinuousAccessAssigned ( uint32_t  channelNumber) const
Parameters
channelNumberthe specified channel number
Returns
whether the continuous access is assigned for the specific channel.

Definition at line 89 of file channel-scheduler.cc.

References ns3::ContinuousAccess, GetAssignedAccessType(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ IsDefaultCchAccessAssigned()

bool ns3::ChannelScheduler::IsDefaultCchAccessAssigned ( void  ) const
Returns
whether the continuous access is assigned for CCHl.

Definition at line 107 of file channel-scheduler.cc.

References CCH, ns3::DefaultCchAccess, GetAssignedAccessType(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ IsExtendedAccessAssigned()

bool ns3::ChannelScheduler::IsExtendedAccessAssigned ( uint32_t  channelNumber) const
Parameters
channelNumberthe specified channel number
Returns
whether the continuous access is assigned for the specific channel.

Definition at line 101 of file channel-scheduler.cc.

References ns3::ExtendedAccess, GetAssignedAccessType(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ IsSchAccessAssigned()

bool ns3::ChannelScheduler::IsSchAccessAssigned ( void  ) const
Returns
whether SCH channel access is assigned.

Definition at line 80 of file channel-scheduler.cc.

References GetAssignedAccessType(), ns3::NoAccess, NS_LOG_FUNCTION, SCH1, SCH2, SCH3, SCH4, SCH5, and SCH6.

+ Here is the call graph for this function:

◆ ReleaseAccess()

virtual bool ns3::ChannelScheduler::ReleaseAccess ( uint32_t  channelNumber)
protectedpure virtual
Parameters
channelNumberindicating for which channel should release the assigned channel access resource.
Returns
whether the channel access is released successfully

Implemented in ns3::DefaultChannelScheduler.

Referenced by StopSch().

+ Here is the caller graph for this function:

◆ SetWaveNetDevice()

void ns3::ChannelScheduler::SetWaveNetDevice ( Ptr< WaveNetDevice device)
virtual
Parameters
deviceenable channel scheduler associated with WaveNetDevice

Reimplemented in ns3::DefaultChannelScheduler.

Definition at line 59 of file channel-scheduler.cc.

References m_device, and NS_LOG_FUNCTION.

Referenced by ns3::DefaultChannelScheduler::GetAssignedAccessType().

+ Here is the caller graph for this function:

◆ StartSch()

bool ns3::ChannelScheduler::StartSch ( const SchInfo schInfo)
Parameters
schInfothe request information for assigning SCH access.
Returns
whether the channel access is assigned successfully.

This method is called to assign channel access for sending packets.

Definition at line 113 of file channel-scheduler.cc.

References ns3::EdcaParameter::aifsn, AssignAlternatingAccess(), AssignContinuousAccess(), AssignExtendedAccess(), ns3::SchInfo::channelNumber, ns3::EdcaParameter::cwmax, ns3::EdcaParameter::cwmin, ns3::SchInfo::edcaParameters, EXTENDED_ALTERNATING, EXTENDED_CONTINUOUS, ns3::SchInfo::extendedAccess, ns3::WaveNetDevice::GetMac(), ns3::SchInfo::immediateAccess, ns3::ChannelManager::IsCch(), m_device, third::mac, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ StopSch()

bool ns3::ChannelScheduler::StopSch ( uint32_t  channelNumber)
Parameters
channelNumberindicating which channel should release the assigned channel access resource.
Returns
true if successful.

Definition at line 147 of file channel-scheduler.cc.

References ns3::ChannelManager::IsCch(), IsChannelAccessAssigned(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ReleaseAccess().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_device


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