ChannelCoordinator deals with channel coordination in data plane (see 1609.4 chapter 5.2) More...
#include "channel-coordinator.h"
Public Member Functions | |
ChannelCoordinator () | |
virtual | ~ChannelCoordinator () |
Time | GetCchInterval (void) const |
Time | GetGuardInterval (void) const |
Time | GetIntervalTime (Time duration=Seconds(0.0)) const |
Time | GetRemainTime (Time duration=Seconds(0.0)) const |
Time | GetSchInterval (void) const |
Time | GetSyncInterval (void) const |
bool | IsCchInterval (Time duration=Seconds(0.0)) const |
bool | IsGuardInterval (Time duration=Seconds(0.0)) const |
bool | IsSchInterval (Time duration=Seconds(0.0)) const |
bool | IsValidConfig (void) const |
Time | NeedTimeToCchInterval (Time duration=Seconds(0.0)) const |
Time | NeedTimeToGuardInterval (Time duration=Seconds(0.0)) const |
Time | NeedTimeToSchInterval (Time duration=Seconds(0.0)) const |
void | RegisterListener (Ptr< ChannelCoordinationListener > listener) |
void | SetCchInterval (Time cchi) |
void | SetGuardInterval (Time guardi) |
void | SetSchInterval (Time schi) |
void | UnregisterAllListeners (void) |
Remove all listeners. More... | |
void | UnregisterListener (Ptr< ChannelCoordinationListener > listener) |
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<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. 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) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (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 Time | GetDefaultCchInterval (void) |
static Time | GetDefaultGuardInterval (void) |
static Time | GetDefaultSchInterval (void) |
static Time | GetDefaultSyncInterval (void) |
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... | |
Private Types | |
typedef std::vector< Ptr< ChannelCoordinationListener > > | Listeners |
Listeners typdef. More... | |
typedef std::vector< Ptr< ChannelCoordinationListener > >::iterator | ListenersI |
Listeners iterator typedef. More... | |
Private Member Functions | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
Time | GetCchSlot (void) const |
Time | GetSchSlot (void) const |
void | NotifyCchSlot (void) |
notify listeners of a CCH slot start More... | |
void | NotifyGuardSlot (void) |
notify listeners of a guard slot start More... | |
void | NotifySchSlot (void) |
notify listeners of a SCH slot start More... | |
void | StartChannelCoordination (void) |
start to make channel coordination events More... | |
void | StopChannelCoordination (void) |
stop channel coordination events More... | |
Private Attributes | |
Time | m_cchi |
CchInterval. More... | |
EventId | m_coordination |
coordination event More... | |
Time | m_gi |
GuardInterval. More... | |
uint32_t | m_guardCount |
guard count More... | |
Listeners | m_listeners |
listeners More... | |
Time | m_schi |
SchInterval. More... | |
Additional Inherited Members | |
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... | |
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... | |
ChannelCoordinator deals with channel coordination in data plane (see 1609.4 chapter 5.2)
<---------— --—SYNCI--------------—> <----------------—SYNCI---------------—> CCHI SCHI CCHI SCHI |..************|..************|..************|..************| GI GI GI GI
The relation among CCHI(CCH Interval), SCHI(SCH Interval), GI(Guard Interval), SYNCI(Sync Interval):
ns3::ChannelCoordinator is accessible through the following paths with Config::Set and Config::Connect:
No TraceSources are defined for this type.
Size of this type is 112 bytes (on a 64-bit architecture).
Definition at line 71 of file channel-coordinator.h.
|
private |
Listeners typdef.
Definition at line 244 of file channel-coordinator.h.
|
private |
Listeners iterator typedef.
Definition at line 246 of file channel-coordinator.h.
ns3::ChannelCoordinator::ChannelCoordinator | ( | ) |
Definition at line 61 of file channel-coordinator.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 67 of file channel-coordinator.cc.
References NS_LOG_FUNCTION.
|
privatevirtual |
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.
Definition at line 80 of file channel-coordinator.cc.
References NS_LOG_FUNCTION, StopChannelCoordination(), and UnregisterAllListeners().
|
privatevirtual |
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.
Definition at line 73 of file channel-coordinator.cc.
References NS_LOG_FUNCTION, and StartChannelCoordination().
Time ns3::ChannelCoordinator::GetCchInterval | ( | void | ) | const |
Definition at line 131 of file channel-coordinator.cc.
References m_cchi, and NS_LOG_FUNCTION.
Referenced by ChannelCoordinationTestCase::DoRun(), GetSyncInterval(), IsValidConfig(), NeedTimeToGuardInterval(), NeedTimeToSchInterval(), ChannelCoordinationTestCase::NotifyGuardStartNow(), and ChannelCoordinationTestCase::NotifySchStartNow().
|
private |
Definition at line 180 of file channel-coordinator.cc.
References m_cchi, m_gi, and NS_LOG_FUNCTION.
Referenced by NotifyCchSlot().
|
static |
Definition at line 88 of file channel-coordinator.cc.
References ns3::MilliSeconds(), and NS_LOG_FUNCTION_NOARGS.
Referenced by GetDefaultSyncInterval(), and GetTypeId().
|
static |
Definition at line 113 of file channel-coordinator.cc.
References ns3::MilliSeconds(), and NS_LOG_FUNCTION_NOARGS.
Referenced by GetTypeId().
|
static |
Definition at line 97 of file channel-coordinator.cc.
References ns3::MilliSeconds(), and NS_LOG_FUNCTION_NOARGS.
Referenced by GetDefaultSyncInterval(), and GetTypeId().
|
static |
Definition at line 106 of file channel-coordinator.cc.
References GetDefaultCchInterval(), GetDefaultSchInterval(), and NS_LOG_FUNCTION_NOARGS.
Time ns3::ChannelCoordinator::GetGuardInterval | ( | void | ) | const |
Definition at line 166 of file channel-coordinator.cc.
References m_gi, and NS_LOG_FUNCTION.
Referenced by ChannelCoordinationTestCase::DoRun(), IsValidConfig(), ChannelCoordinationTestCase::NotifyCchStartNow(), NotifyGuardSlot(), and ChannelCoordinationTestCase::NotifySchStartNow().
duration | the future time after duration |
Definition at line 282 of file channel-coordinator.cc.
References ns3::Time::GetMilliSeconds(), GetSyncInterval(), ns3::MilliSeconds(), sample-rng-plot::n, ns3::Now(), and NS_LOG_FUNCTION.
Referenced by GetRemainTime(), IsCchInterval(), IsGuardInterval(), NeedTimeToCchInterval(), NeedTimeToGuardInterval(), and NeedTimeToSchInterval().
duration | the future time after duration |
Definition at line 292 of file channel-coordinator.cc.
References GetIntervalTime(), GetSyncInterval(), and NS_LOG_FUNCTION.
Time ns3::ChannelCoordinator::GetSchInterval | ( | void | ) | const |
Definition at line 145 of file channel-coordinator.cc.
References m_schi, and NS_LOG_FUNCTION.
Referenced by ChannelCoordinationTestCase::DoRun(), GetSyncInterval(), and IsValidConfig().
|
private |
Definition at line 173 of file channel-coordinator.cc.
References m_gi, m_schi, and NS_LOG_FUNCTION.
Referenced by NotifySchSlot().
Time ns3::ChannelCoordinator::GetSyncInterval | ( | void | ) | const |
Definition at line 152 of file channel-coordinator.cc.
References GetCchInterval(), GetSchInterval(), and NS_LOG_FUNCTION.
Referenced by ns3::DefaultChannelScheduler::AssignExtendedAccess(), ChannelCoordinationTestCase::DoRun(), GetIntervalTime(), GetRemainTime(), IsValidConfig(), NeedTimeToCchInterval(), NeedTimeToGuardInterval(), ChannelCoordinationTestCase::NotifyCchStartNow(), ChannelCoordinationTestCase::NotifyGuardStartNow(), and ChannelCoordinationTestCase::NotifySchStartNow().
|
static |
Get the type ID.
Definition at line 39 of file channel-coordinator.cc.
References GetDefaultCchInterval(), GetDefaultGuardInterval(), GetDefaultSchInterval(), m_cchi, m_gi, m_schi, ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), and ns3::TypeId::SetParent().
duration | the future time after duration |
Definition at line 187 of file channel-coordinator.cc.
References GetIntervalTime(), m_cchi, and NS_LOG_FUNCTION.
Referenced by IsSchInterval(), NeedTimeToCchInterval(), NeedTimeToGuardInterval(), and ChannelCoordinationTestCase::TestIntervalAfter().
duration | the future time after duration |
Definition at line 202 of file channel-coordinator.cc.
References GetIntervalTime(), m_cchi, m_gi, and NS_LOG_FUNCTION.
Referenced by NeedTimeToGuardInterval(), and ChannelCoordinationTestCase::TestIntervalAfter().
duration | the future time after duration |
Definition at line 195 of file channel-coordinator.cc.
References IsCchInterval(), and NS_LOG_FUNCTION.
Referenced by ns3::DefaultChannelScheduler::AssignAlternatingAccess(), ns3::DefaultChannelScheduler::AssignContinuousAccess(), ns3::DefaultChannelScheduler::AssignExtendedAccess(), NeedTimeToSchInterval(), and ChannelCoordinationTestCase::TestIntervalAfter().
bool ns3::ChannelCoordinator::IsValidConfig | ( | void | ) | const |
If users set the channel intervals different from default values here, it should be better to test whether the configuration is valid.
Definition at line 212 of file channel-coordinator.cc.
References GetCchInterval(), GetGuardInterval(), GetSchInterval(), GetSyncInterval(), NS_LOG_FUNCTION, and NS_LOG_WARN.
Referenced by ChannelCoordinationTestCase::DoRun(), and StartChannelCoordination().
duration | the future time after duration |
Definition at line 243 of file channel-coordinator.cc.
References GetIntervalTime(), GetSyncInterval(), IsCchInterval(), ns3::MilliSeconds(), and NS_LOG_FUNCTION.
Referenced by ns3::DefaultChannelScheduler::AssignExtendedAccess(), and ns3::VsaManager::DoSendVsa().
duration | the future time after duration |
Definition at line 265 of file channel-coordinator.cc.
References GetCchInterval(), GetIntervalTime(), GetSyncInterval(), IsCchInterval(), IsGuardInterval(), ns3::MilliSeconds(), and NS_LOG_FUNCTION.
Referenced by ns3::WaveMacLow::StartTransmission().
duration | the future time after duration |
Definition at line 254 of file channel-coordinator.cc.
References GetCchInterval(), GetIntervalTime(), IsSchInterval(), ns3::MilliSeconds(), and NS_LOG_FUNCTION.
Referenced by ns3::DefaultChannelScheduler::AssignContinuousAccess(), ns3::DefaultChannelScheduler::AssignExtendedAccess(), and ns3::VsaManager::DoSendVsa().
|
private |
notify listeners of a CCH slot start
Definition at line 368 of file channel-coordinator.cc.
References GetCchSlot(), m_coordination, m_listeners, NotifyGuardSlot(), NS_LOG_FUNCTION, and ns3::Simulator::Schedule().
Referenced by NotifyGuardSlot().
|
private |
notify listeners of a guard slot start
Definition at line 379 of file channel-coordinator.cc.
References GetGuardInterval(), m_coordination, m_guardCount, m_listeners, NotifyCchSlot(), NotifySchSlot(), NS_LOG_FUNCTION, and ns3::Simulator::Schedule().
Referenced by NotifyCchSlot(), NotifySchSlot(), and StartChannelCoordination().
|
private |
notify listeners of a SCH slot start
Definition at line 357 of file channel-coordinator.cc.
References GetSchSlot(), m_coordination, m_listeners, NotifyGuardSlot(), NS_LOG_FUNCTION, and ns3::Simulator::Schedule().
Referenced by NotifyGuardSlot().
void ns3::ChannelCoordinator::RegisterListener | ( | Ptr< ChannelCoordinationListener > | listener | ) |
listener | the new listener for channel coordination events. |
Add the input listener to the list of objects to be notified of channel coordination events.
Definition at line 299 of file channel-coordinator.cc.
References m_listeners, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ChannelCoordinationTestCase::DoRun(), and ns3::DefaultChannelScheduler::SetWaveNetDevice().
void ns3::ChannelCoordinator::SetCchInterval | ( | Time | cchi | ) |
cchi | the CCH interval for multi-channel operation. |
Definition at line 124 of file channel-coordinator.cc.
References m_cchi, and NS_LOG_FUNCTION.
Referenced by ChannelCoordinationTestCase::DoRun().
void ns3::ChannelCoordinator::SetGuardInterval | ( | Time | guardi | ) |
guardi | the guard interval for multi-channel operation. |
Definition at line 159 of file channel-coordinator.cc.
References m_gi, and NS_LOG_FUNCTION.
Referenced by ChannelCoordinationTestCase::DoRun().
void ns3::ChannelCoordinator::SetSchInterval | ( | Time | schi | ) |
schi | the SCH interval for multi-channel operation. |
Definition at line 138 of file channel-coordinator.cc.
References m_schi, and NS_LOG_FUNCTION.
Referenced by ChannelCoordinationTestCase::DoRun().
|
private |
start to make channel coordination events
Definition at line 329 of file channel-coordinator.cc.
References ns3::Time::GetMilliSeconds(), IsValidConfig(), m_guardCount, NotifyGuardSlot(), ns3::Now(), NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Referenced by DoInitialize().
|
private |
stop channel coordination events
Definition at line 347 of file channel-coordinator.cc.
References ns3::EventId::Cancel(), ns3::EventId::IsExpired(), m_coordination, and m_guardCount.
Referenced by DoDispose().
void ns3::ChannelCoordinator::UnregisterAllListeners | ( | void | ) |
Remove all listeners.
Definition at line 322 of file channel-coordinator.cc.
References m_listeners, and NS_LOG_FUNCTION.
Referenced by DoDispose().
void ns3::ChannelCoordinator::UnregisterListener | ( | Ptr< ChannelCoordinationListener > | listener | ) |
listener | the current attached listener |
Remove the specified listener.
Definition at line 307 of file channel-coordinator.cc.
References m_listeners, NS_ASSERT, and NS_LOG_FUNCTION.
|
private |
CchInterval.
Definition at line 239 of file channel-coordinator.h.
Referenced by GetCchInterval(), GetCchSlot(), GetTypeId(), IsCchInterval(), IsGuardInterval(), and SetCchInterval().
|
private |
coordination event
Definition at line 250 of file channel-coordinator.h.
Referenced by NotifyCchSlot(), NotifyGuardSlot(), NotifySchSlot(), and StopChannelCoordination().
|
private |
GuardInterval.
Definition at line 241 of file channel-coordinator.h.
Referenced by GetCchSlot(), GetGuardInterval(), GetSchSlot(), GetTypeId(), IsGuardInterval(), and SetGuardInterval().
|
private |
guard count
Definition at line 249 of file channel-coordinator.h.
Referenced by NotifyGuardSlot(), StartChannelCoordination(), and StopChannelCoordination().
|
private |
listeners
Definition at line 247 of file channel-coordinator.h.
Referenced by NotifyCchSlot(), NotifyGuardSlot(), NotifySchSlot(), RegisterListener(), UnregisterAllListeners(), and UnregisterListener().
|
private |
SchInterval.
Definition at line 240 of file channel-coordinator.h.
Referenced by GetSchInterval(), GetSchSlot(), GetTypeId(), and SetSchInterval().