This class will assign channel access for requests from higher layers. More...
#include "channel-scheduler.h"
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< Object > | GetObject () 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< Object > | GetObject (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... | |
SimpleRefCount & | operator= ([[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< WaveNetDevice > | m_device |
the device More... | |
Additional Inherited Members | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
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.
ns3::ChannelScheduler is accessible through the following paths with Config::Set and Config::Connect:
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.
ns3::ChannelScheduler::ChannelScheduler | ( | ) |
Definition at line 42 of file channel-scheduler.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 46 of file channel-scheduler.cc.
References NS_LOG_FUNCTION.
|
protectedpure virtual |
channelNumber | the specific channel |
immediate | indicate whether channel switch to channel |
This method will assign alternating access for SCHs and CCH.
Implemented in ns3::DefaultChannelScheduler.
Referenced by StartSch().
|
protectedpure virtual |
channelNumber | the specific channel |
immediate | indicate whether channel switch to channel |
This method will assign continuous access CCH.
Implemented in ns3::DefaultChannelScheduler.
Referenced by StartSch().
|
protectedpure virtual |
This method will assign default CCH access for CCH.
Implemented in ns3::DefaultChannelScheduler.
Referenced by DoInitialize().
|
protectedpure virtual |
channelNumber | the specific channel |
extends | extension duration |
immediate | indicate whether channel switch to channel |
This method will assign extended access for SCHs.
Implemented in ns3::DefaultChannelScheduler.
Referenced by StartSch().
|
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().
|
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().
|
pure virtual |
channelNumber | the specified channel number |
Implemented in ns3::DefaultChannelScheduler.
Referenced by IsAlternatingAccessAssigned(), IsCchAccessAssigned(), IsChannelAccessAssigned(), IsContinuousAccessAssigned(), IsDefaultCchAccessAssigned(), IsExtendedAccessAssigned(), and IsSchAccessAssigned().
|
static |
Get the type ID.
Definition at line 33 of file channel-scheduler.cc.
References ns3::TypeId::SetParent().
bool ns3::ChannelScheduler::IsAlternatingAccessAssigned | ( | uint32_t | channelNumber | ) | const |
channelNumber | the specified channel number |
Definition at line 95 of file channel-scheduler.cc.
References ns3::AlternatingAccess, GetAssignedAccessType(), and NS_LOG_FUNCTION.
bool ns3::ChannelScheduler::IsCchAccessAssigned | ( | void | ) | const |
Definition at line 73 of file channel-scheduler.cc.
References CCH, GetAssignedAccessType(), ns3::NoAccess, and NS_LOG_FUNCTION.
bool ns3::ChannelScheduler::IsChannelAccessAssigned | ( | uint32_t | channelNumber | ) | const |
channelNumber | the specified channel number |
Definition at line 66 of file channel-scheduler.cc.
References GetAssignedAccessType(), ns3::NoAccess, and NS_LOG_FUNCTION.
Referenced by StopSch().
bool ns3::ChannelScheduler::IsContinuousAccessAssigned | ( | uint32_t | channelNumber | ) | const |
channelNumber | the specified channel number |
Definition at line 89 of file channel-scheduler.cc.
References ns3::ContinuousAccess, GetAssignedAccessType(), and NS_LOG_FUNCTION.
bool ns3::ChannelScheduler::IsDefaultCchAccessAssigned | ( | void | ) | const |
Definition at line 107 of file channel-scheduler.cc.
References CCH, ns3::DefaultCchAccess, GetAssignedAccessType(), and NS_LOG_FUNCTION.
bool ns3::ChannelScheduler::IsExtendedAccessAssigned | ( | uint32_t | channelNumber | ) | const |
channelNumber | the specified channel number |
Definition at line 101 of file channel-scheduler.cc.
References ns3::ExtendedAccess, GetAssignedAccessType(), and NS_LOG_FUNCTION.
bool ns3::ChannelScheduler::IsSchAccessAssigned | ( | void | ) | const |
Definition at line 80 of file channel-scheduler.cc.
References GetAssignedAccessType(), ns3::NoAccess, NS_LOG_FUNCTION, SCH1, SCH2, SCH3, SCH4, SCH5, and SCH6.
|
protectedpure virtual |
channelNumber | indicating for which channel should release the assigned channel access resource. |
Implemented in ns3::DefaultChannelScheduler.
Referenced by StopSch().
|
virtual |
device | enable 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().
bool ns3::ChannelScheduler::StartSch | ( | const SchInfo & | schInfo | ) |
schInfo | the request information for assigning SCH access. |
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.
bool ns3::ChannelScheduler::StopSch | ( | uint32_t | channelNumber | ) |
channelNumber | indicating which channel should release the assigned channel access resource. |
Definition at line 147 of file channel-scheduler.cc.
References ns3::ChannelManager::IsCch(), IsChannelAccessAssigned(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ReleaseAccess().
|
protected |
the device
Definition at line 237 of file channel-scheduler.h.
Referenced by ns3::DefaultChannelScheduler::AssignDefaultCchAccess(), DoDispose(), ns3::DefaultChannelScheduler::NotifyGuardSlotStart(), SetWaveNetDevice(), StartSch(), and ns3::DefaultChannelScheduler::SwitchToNextChannel().