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) |
![]() | |
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 |
Implement the GetInstanceTypeId method defined in ObjectBase. 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. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
![]() | |
SimpleRefCount () | |
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. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
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) |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Types | |
typedef std::vector< Ptr< ChannelCoordinationListener > > | Listeners |
typedef std::vector< Ptr< ChannelCoordinationListener > >::iterator | ListenersI |
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) |
void | NotifyGuardSlot (void) |
void | NotifySchSlot (void) |
void | StartChannelCoordination (void) |
start to make channel coordination events More... | |
void | StopChannelCoordination (void) |
stop channel coordination events More... | |
Private Attributes | |
Time | m_cchi |
EventId | m_coordination |
Time | m_gi |
uint32_t | m_guardCount |
Listeners | m_listeners |
Time | m_schi |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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 70 of file channel-coordinator.h.
|
private |
Definition at line 230 of file channel-coordinator.h.
|
private |
Definition at line 231 of file channel-coordinator.h.
ns3::ChannelCoordinator::ChannelCoordinator | ( | ) |
Definition at line 60 of file channel-coordinator.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 66 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 overriden 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 79 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 72 of file channel-coordinator.cc.
References NS_LOG_FUNCTION, and StartChannelCoordination().
Time ns3::ChannelCoordinator::GetCchInterval | ( | void | ) | const |
Definition at line 130 of file channel-coordinator.cc.
References m_cchi, and NS_LOG_FUNCTION.
Referenced by ChannelCoordinationTestCase::DoRun(), GetSyncInterval(), IsValidConfig(), NeedTimeToGuardInterval(), NeedTimeToSchInterval(), ChannelCoordinationTestCase::NotifyCchStartNow(), ChannelCoordinationTestCase::NotifyGuardStartNow(), and ChannelCoordinationTestCase::NotifySchStartNow().
|
private |
Definition at line 179 of file channel-coordinator.cc.
References m_cchi, m_gi, and NS_LOG_FUNCTION.
Referenced by NotifyCchSlot().
|
static |
Definition at line 87 of file channel-coordinator.cc.
References ns3::MilliSeconds(), and NS_LOG_FUNCTION_NOARGS.
Referenced by GetDefaultSyncInterval(), and GetTypeId().
|
static |
Definition at line 112 of file channel-coordinator.cc.
References ns3::MilliSeconds(), and NS_LOG_FUNCTION_NOARGS.
Referenced by GetTypeId().
|
static |
Definition at line 96 of file channel-coordinator.cc.
References ns3::MilliSeconds(), and NS_LOG_FUNCTION_NOARGS.
Referenced by GetDefaultSyncInterval(), and GetTypeId().
|
static |
Definition at line 105 of file channel-coordinator.cc.
References GetDefaultCchInterval(), GetDefaultSchInterval(), and NS_LOG_FUNCTION_NOARGS.
Time ns3::ChannelCoordinator::GetGuardInterval | ( | void | ) | const |
Definition at line 165 of file channel-coordinator.cc.
References m_gi, and NS_LOG_FUNCTION.
Referenced by ChannelCoordinationTestCase::DoRun(), IsValidConfig(), ChannelCoordinationTestCase::NotifyCchStartNow(), NotifyGuardSlot(), ChannelCoordinationTestCase::NotifyGuardStartNow(), and ChannelCoordinationTestCase::NotifySchStartNow().
duration | the future time after duration |
Definition at line 281 of file channel-coordinator.cc.
References ns3::Time::GetMilliSeconds(), GetSyncInterval(), ns3::MilliSeconds(), ns3::Now(), and NS_LOG_FUNCTION.
Referenced by GetRemainTime(), IsCchInterval(), IsGuardInterval(), NeedTimeToCchInterval(), NeedTimeToGuardInterval(), and NeedTimeToSchInterval().
duration | the future time after duration |
Definition at line 291 of file channel-coordinator.cc.
References GetIntervalTime(), GetSyncInterval(), and NS_LOG_FUNCTION.
Time ns3::ChannelCoordinator::GetSchInterval | ( | void | ) | const |
Definition at line 144 of file channel-coordinator.cc.
References m_schi, and NS_LOG_FUNCTION.
Referenced by ChannelCoordinationTestCase::DoRun(), GetSyncInterval(), IsValidConfig(), and ChannelCoordinationTestCase::NotifySchStartNow().
|
private |
Definition at line 172 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 151 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 |
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 186 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 201 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 194 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 211 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 242 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 264 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 253 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 |
Definition at line 367 of file channel-coordinator.cc.
References GetCchSlot(), m_coordination, m_listeners, NotifyGuardSlot(), NS_LOG_FUNCTION, and ns3::Simulator::Schedule().
Referenced by NotifyGuardSlot().
|
private |
Definition at line 378 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 |
Definition at line 356 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 298 of file channel-coordinator.cc.
References m_listeners, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::DefaultChannelScheduler::SetWaveNetDevice().
void ns3::ChannelCoordinator::SetCchInterval | ( | Time | cchi | ) |
cchi | the CCH interval for multi-channel operation. |
Definition at line 123 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 158 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 137 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 328 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 346 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 321 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 306 of file channel-coordinator.cc.
References m_listeners, NS_ASSERT, and NS_LOG_FUNCTION.
|
private |
Definition at line 226 of file channel-coordinator.h.
Referenced by GetCchInterval(), GetCchSlot(), GetTypeId(), IsCchInterval(), IsGuardInterval(), and SetCchInterval().
|
private |
Definition at line 235 of file channel-coordinator.h.
Referenced by NotifyCchSlot(), NotifyGuardSlot(), NotifySchSlot(), and StopChannelCoordination().
|
private |
Definition at line 228 of file channel-coordinator.h.
Referenced by GetCchSlot(), GetGuardInterval(), GetSchSlot(), GetTypeId(), IsGuardInterval(), and SetGuardInterval().
|
private |
Definition at line 234 of file channel-coordinator.h.
Referenced by NotifyGuardSlot(), StartChannelCoordination(), and StopChannelCoordination().
|
private |
Definition at line 232 of file channel-coordinator.h.
Referenced by NotifyCchSlot(), NotifyGuardSlot(), NotifySchSlot(), RegisterListener(), UnregisterAllListeners(), and UnregisterListener().
|
private |
Definition at line 227 of file channel-coordinator.h.
Referenced by GetSchInterval(), GetSchSlot(), GetTypeId(), and SetSchInterval().