An identifier for simulation events. More...
#include "event-id.h"
Public Types | |
enum | UID { INVALID = 0 , NOW = 1 , DESTROY = 2 , RESERVED = 3 , VALID = 4 } |
Special values of the event UID. More... | |
Public Member Functions | |
EventId () | |
Default constructor. | |
EventId (const Ptr< EventImpl > &impl, uint64_t ts, uint32_t context, uint32_t uid) | |
Construct a real event. | |
void | Cancel () |
This method is syntactic sugar for the ns3::Simulator::Cancel method. | |
bool | IsExpired () const |
This method is syntactic sugar for the ns3::Simulator::IsExpired method. | |
bool | IsRunning () const |
This method is syntactic sugar for !IsExpired(). | |
void | Remove () |
This method is syntactic sugar for the ns3::Simulator::Remove method. | |
Scheduler Helpers. | |
These methods are normally invoked only by subclasses of the Scheduler base class. | |
EventImpl * | PeekEventImpl () const |
uint64_t | GetTs () const |
uint32_t | GetContext () const |
uint32_t | GetUid () const |
Private Attributes | |
uint32_t | m_context |
The context. | |
Ptr< EventImpl > | m_eventImpl |
The underlying event implementation. | |
uint64_t | m_ts |
The virtual time stamp. | |
uint32_t | m_uid |
The unique id. | |
Friends | |
bool | operator!= (const EventId &a, const EventId &b) |
Test if two EventId's are not equal. | |
bool | operator< (const EventId &a, const EventId &b) |
Less than operator for two EventId's, based on time stamps. | |
bool | operator== (const EventId &a, const EventId &b) |
Test if two EventId's are equal. | |
An identifier for simulation events.
Each EventId identifies a unique event scheduled with one of the many Simulator::Schedule() methods. This EventId can be used to cancel or remove events after they are scheduled with Cancel(), Remove(), or Simulator::Cancel() or Simulator::Remove().
The important thing to remember about this class is that every variable of this type is always in a valid state, even when it has not been assigned an EventId coming from a Simulator::Schedule() method: calling Simulator::Cancel(), IsRunning(), IsExpired() or passing around instances of this object will not result in crashes or memory leaks.
Definition at line 54 of file event-id.h.
enum ns3::EventId::UID |
Special values of the event UID.
Enumerator | |
---|---|
INVALID | Invalid UID value. |
NOW | ScheduleNow() events. |
DESTROY | ScheduleDestroy() events. |
RESERVED | Reserved UID. |
VALID | Schedule(), etc. events. |
Definition at line 58 of file event-id.h.
ns3::EventId::EventId | ( | ) |
Default constructor.
This EventId does nothing.
Definition at line 36 of file event-id.cc.
References NS_LOG_FUNCTION.
ns3::EventId::EventId | ( | const Ptr< EventImpl > & | impl, |
uint64_t | ts, | ||
uint32_t | context, | ||
uint32_t | uid | ||
) |
Construct a real event.
[in] | impl | The implementation of this event. |
[in] | ts | The virtual time stamp this event should occur. |
[in] | context | The execution context for this event. |
[in] | uid | The unique id for this EventId. |
Definition at line 45 of file event-id.cc.
References NS_LOG_FUNCTION.
void ns3::EventId::Cancel | ( | ) |
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition at line 55 of file event-id.cc.
References ns3::Simulator::Cancel(), and NS_LOG_FUNCTION.
Referenced by ns3::ApWifiMac::ApLinkEntity::~ApLinkEntity(), ns3::BlockAckAgreement::~BlockAckAgreement(), ns3::Timer::~Timer(), ns3::TrickleTimer::~TrickleTimer(), ns3::Watchdog::~Watchdog(), ns3::WifiTxTimer::~WifiTxTimer(), ns3::WifiPhy::AbortCurrentReception(), ns3::HalfDuplexIdealPhy::AbortRx(), ns3::DhcpClient::AcceptAck(), ns3::RandomDirection2dMobilityModel::BeginPause(), ns3::RandomWaypointMobilityModel::BeginWalk(), ns3::Timer::Cancel(), ns3::LrWpanCsmaCa::Cancel(), ns3::WifiTxTimer::Cancel(), ns3::TcpSocketBase::CancelAllTimers(), ns3::LrWpanPhy::CancelEd(), ns3::UeManager::CancelPendingEvents(), ns3::QosFrameExchangeManager::CancelPifsRecovery(), ns3::LrWpanPhy::CcaCancel(), ns3::WifiRadioEnergyModel::ChangeState(), ns3::UanMacCw::Clear(), ns3::UanMacRc::Clear(), ns3::UanTransducerHd::Clear(), ns3::dot11s::PeerLink::ClearConfirmTimer(), ns3::dot11s::PeerLink::ClearHoldingTimer(), ns3::dot11s::PeerLink::ClearRetryTimer(), ns3::TcpSocketBase::CloseAndNotify(), ns3::StaWifiMac::Disassociated(), ns3::DhcpClient::DoDispose(), ns3::ArpCache::DoDispose(), ns3::Ipv4L3Protocol::DoDispose(), ns3::Ipv6ExtensionFragment::DoDispose(), ns3::Rip::DoDispose(), ns3::RipNg::DoDispose(), ns3::LrWpanMac::DoDispose(), ns3::LrWpanPhy::DoDispose(), ns3::LteRlcAm::DoDispose(), ns3::LteRlcTm::DoDispose(), ns3::LteRlcUm::DoDispose(), ns3::dot11s::HwmpProtocol::DoDispose(), ns3::dot11s::PeerLink::DoDispose(), ns3::MeshWifiInterfaceMac::DoDispose(), ns3::Application::DoDispose(), ns3::SimpleNetDevice::DoDispose(), ns3::SixLowPanNetDevice::DoDispose(), ns3::WaveformGenerator::DoDispose(), ns3::PieQueueDisc::DoDispose(), ns3::EmlsrManager::DoDispose(), ns3::HeFrameExchangeManager::DoDispose(), ns3::MultiUserScheduler::DoDispose(), ns3::QosFrameExchangeManager::DoDispose(), ns3::WifiDefaultAssocManager::DoDispose(), ns3::WifiPhy::DoDispose(), ns3::TcpSocketBase::DoForwardUp(), ns3::MeshWifiInterfaceMac::DoInitialize(), ns3::ApWifiMac::DoInitialize(), ns3::LteRlcAm::DoNotifyTxOpportunity(), ns3::LteRlcTm::DoNotifyTxOpportunity(), ns3::LteRlcUm::DoNotifyTxOpportunity(), ns3::LteRlcAm::DoReceivePdu(), ns3::LteRlcUm::DoReceivePdu(), ns3::LteUeRrc::DoRecvRrcConnectionReject(), ns3::LteUeRrc::DoRecvRrcConnectionSetup(), ns3::LteUeMac::DoReset(), ns3::LteUePhy::DoReset(), ns3::ChannelAccessManager::DoRestartAccessTimeoutIfNeeded(), SimulatorEventsTestCase::DoRun(), ns3::GaussMarkovMobilityModel::DoSetPosition(), ns3::RandomDirection2dMobilityModel::DoSetPosition(), ns3::RandomWalk2dMobilityModel::DoSetPosition(), ns3::RandomWaypointMobilityModel::DoSetPosition(), ns3::SteadyStateRandomWaypointMobilityModel::DoSetPosition(), ns3::WifiDefaultAssocManager::DoStartScanning(), ns3::LteRlcAm::DoTransmitPdcpPdu(), ns3::LteRlcTm::DoTransmitPdcpPdu(), ns3::LteRlcUm::DoTransmitPdcpPdu(), ns3::RandomWalk2dOutdoorMobilityModel::DoWalk(), ns3::RandomWalk2dMobilityModel::DoWalk(), ns3::PhyEntity::EndPreambleDetectionPeriod(), ns3::LrWpanMac::EndStartRequest(), ns3::ArpCache::Flush(), ns3::WifiPhy::GetDelayUntilChannelSwitch(), ns3::WifiRadioEnergyModel::HandleEnergyChanged(), ns3::Icmpv6L4Protocol::HandleRA(), ns3::TcpSocketBase::LastAckTimeout(), ns3::DhcpClient::LinkStateHandler(), ns3::LrWpanMac::MlmeScanRequest(), ns3::LrWpanMac::MlmeSyncRequest(), ns3::DhcpClient::NetHandler(), ns3::TcpSocketBase::NewAck(), TcpNewRenoCongAvoidNormalTest::NormalClose(), TcpPacingTest::NormalClose(), ns3::MultiUserScheduler::NotifyAccessGranted(), ns3::WifiRadioEnergyModelPhyListener::NotifyCcaBusyStart(), ns3::EmlsrManager::NotifyMgtFrameReceived(), ns3::WifiRadioEnergyModelPhyListener::NotifyOff(), ns3::ChannelAccessManager::NotifyOffNow(), ns3::WifiRadioEnergyModelPhyListener::NotifyRxStart(), ns3::WifiRadioEnergyModelPhyListener::NotifySleep(), ns3::ChannelAccessManager::NotifySleepNow(), ns3::WifiRadioEnergyModelPhyListener::NotifySwitchingStart(), ns3::ChannelAccessManager::NotifySwitchingStartNow(), ns3::WifiRadioEnergyModelPhyListener::NotifyTxStart(), ns3::DhcpClient::OfferHandler(), ns3::LrWpanMac::PdDataConfirm(), ns3::LrWpanMac::PdDataIndication(), ns3::TcpWestwoodPlus::PktsAcked(), ns3::LrWpanMac::PlmeSetAttributeConfirm(), ns3::LrWpanPhy::PlmeSetAttributeRequest(), ns3::LrWpanPhy::PlmeSetTRXStateRequest(), ns3::LrWpanMac::PrepareRetransmission(), ns3::TcpSocketBase::ProcessSynRcvd(), ns3::TcpSocketBase::ProcessSynSent(), ns3::V4TraceRoute::Receive(), ns3::StaWifiMac::ReceiveAssocResp(), ns3::TcpSocketBase::ReceivedData(), ns3::UeManager::RecvHandoverCancel(), ns3::UeManager::RecvHandoverPreparationFailure(), ns3::LteUeMac::RecvRaResponse(), ns3::UeManager::RecvRrcConnectionReconfigurationCompleted(), ns3::UeManager::RecvRrcConnectionReestablishmentRequest(), ns3::UeManager::RecvRrcConnectionRequest(), ns3::UeManager::RecvRrcConnectionSetupCompleted(), ns3::UeManager::RecvUeContextRelease(), ns3::DhcpClient::RemoveAndStart(), ns3::WifiTxTimer::Reschedule(), ns3::RadioBearerStatsCalculator::RescheduleEndEpoch(), ns3::TrickleTimer::Reset(), ns3::LteSpectrumPhy::Reset(), ns3::FrameExchangeManager::Reset(), ns3::HeFrameExchangeManager::Reset(), ns3::LteUeRrc::ResetRlfParams(), ns3::FrameExchangeManager::RxStartIndication(), ns3::UanMacRc::ScheduleData(), ns3::WifiPhy::Send(), ns3::StaWifiMac::SendAssociationRequest(), ns3::TcpSocketBase::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), ns3::TcpSocketBase::SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), ns3::Rip::SendUnsolicitedRouteUpdate(), ns3::RipNg::SendUnsolicitedRouteUpdate(), ns3::ApWifiMac::SetBeaconGeneration(), ns3::dot11s::PeerLink::SetBeaconInformation(), ns3::RandomDirection2dMobilityModel::SetDirectionAndSpeed(), ns3::WifiRadioEnergyModel::SetEnergySource(), ns3::LrWpanMac::SetLrWpanMacState(), ns3::WifiPhy::SetOffMode(), ns3::HeFrameExchangeManager::SetWifiPhy(), ns3::TrickleTimer::Stop(), ns3::LteTestRrc::Stop(), ns3::WaveformGenerator::Stop(), ns3::DhcpClient::StopApplication(), ns3::DhcpServer::StopApplication(), ns3::Ping::StopApplication(), ns3::V4TraceRoute::StopApplication(), ns3::Timer::Suspend(), ns3::UanTransducerHd::Transmit(), ns3::dot11s::HwmpProtocol::UnsetRoot(), ns3::LiIonEnergySource::UpdateEnergySource(), ns3::RvBatteryModel::UpdateEnergySource(), and ns3::BasicEnergyHarvester::UpdateHarvestedPower().
uint32_t ns3::EventId::GetContext | ( | ) | const |
Definition at line 97 of file event-id.cc.
References m_context, and NS_LOG_FUNCTION.
uint64_t ns3::EventId::GetTs | ( | ) | const |
Definition at line 90 of file event-id.cc.
References m_ts, and NS_LOG_FUNCTION.
uint32_t ns3::EventId::GetUid | ( | ) | const |
Definition at line 104 of file event-id.cc.
References m_uid, and NS_LOG_FUNCTION.
Referenced by EmlsrDlTxopTest::CheckBlockAck(), and ns3::dsdv::RoutingProtocol::RecvDsdv().
bool ns3::EventId::IsExpired | ( | ) | const |
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
true
if the event has expired, false
otherwise. Definition at line 69 of file event-id.cc.
References ns3::Simulator::IsExpired(), and NS_LOG_FUNCTION.
Referenced by ns3::LrWpanPhy::CancelEd(), ns3::dsdv::RoutingTable::DeleteIpv4Event(), SimulatorEventsTestCase::Destroy(), ns3::TbfQueueDisc::DoDequeue(), ns3::TcpSocketBase::DoForwardUp(), ns3::ChannelAccessManager::DoRestartAccessTimeoutIfNeeded(), SimulatorEventsTestCase::DoRun(), ns3::PhyEntity::EndPreambleDetectionPeriod(), ns3::PhyEntity::EndReceiveField(), ns3::LrWpanPhy::EndRx(), ns3::Timer::IsExpired(), IsRunning(), ns3::LrWpanMac::PdDataConfirm(), ns3::LrWpanPhy::PlmeSetTRXStateRequest(), ns3::TcpSocketBase::ReceivedData(), ns3::UdpClient::Send(), ns3::UdpEchoClient::Send(), ns3::UdpTraceClient::Send(), EpsBearerTagUdpClient::Send(), ns3::PacketSocketClient::Send(), ns3::WifiPhy::Send(), ns3::TcpSocketBase::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), ns3::TcpSocketBase::SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), ns3::OnOffApplication::SendPacket(), ns3::PhyEntity::StartReceiveField(), ns3::PhyEntity::StartReceivePayload(), ns3::LrWpanPhy::StartRx(), and ns3::BasicEnergySource::UpdateEnergySource().
bool ns3::EventId::IsRunning | ( | ) | const |
This method is syntactic sugar for !IsExpired().
true
if the event has not expired, false
otherwise. Definition at line 76 of file event-id.cc.
References IsExpired(), and NS_LOG_FUNCTION.
Referenced by ns3::Timer::~Timer(), ns3::WifiPhy::AbortCurrentReception(), ns3::UanMacRc::Associate(), ns3::UanMacRc::AssociateTimeout(), ns3::WifiDefaultAssocManager::CanBeInserted(), ns3::OnOffApplication::CancelEvents(), ns3::QosFrameExchangeManager::CancelPifsRecovery(), ns3::LrWpanMac::CheckQueue(), ns3::TcpSocketBase::CloseAndNotify(), TcpNewRenoCongAvoidNormalTest::CWndTrace(), ns3::dsdv::RoutingTable::DeleteIpv4Event(), ns3::V4TraceRoute::DoDispose(), ns3::ArpCache::DoDispose(), ns3::Ipv4L3Protocol::DoDispose(), ns3::Ipv6ExtensionFragment::DoDispose(), ns3::SimpleNetDevice::DoDispose(), ns3::SixLowPanNetDevice::DoDispose(), ns3::WaveformGenerator::DoDispose(), ns3::TcpSocketBase::DoForwardUp(), ns3::MeshWifiInterfaceMac::DoInitialize(), ns3::SteadyStateRandomWaypointMobilityModel::DoInitializePrivate(), ns3::LteUeRrc::DoNotifyOutOfSync(), ns3::LteRlcAm::DoNotifyTxOpportunity(), ns3::SubscriberStationNetDevice::DoReceive(), ns3::LteRlcAm::DoReceivePdu(), ns3::LteRlcUm::DoReceivePdu(), ns3::LteUeRrc::DoRecvRrcConnectionReconfiguration(), ns3::LteRlcAm::DoReportBufferStatus(), ns3::ChannelAccessManager::DoRestartAccessTimeoutIfNeeded(), ns3::LrWpanPhy::EndRx(), ns3::LrWpanPhy::EndTx(), ns3::UanPhyGen::EnergyDepletionHandler(), ns3::UanMacRc::Enqueue(), ns3::ArpCache::Flush(), ns3::MeshWifiInterfaceMac::GetBeaconGeneration(), ns3::TrickleTimer::GetDelayLeft(), ns3::TrickleTimer::GetIntervalLeft(), ns3::Icmpv6L4Protocol::HandleRA(), ns3::Timer::IsRunning(), ns3::WifiTxTimer::IsRunning(), ns3::LrWpanMac::MlmeScanRequest(), ns3::LrWpanMac::MlmeSyncRequest(), ns3::MultiUserScheduler::NotifyAccessGranted(), ns3::EmlsrManager::NotifyMgtFrameReceived(), ns3::ChannelAccessManager::NotifyOffNow(), ns3::ChannelAccessManager::NotifySleepNow(), ns3::ChannelAccessManager::NotifySwitchingStartNow(), ns3::LrWpanMac::PdDataIndication(), ns3::LrWpanPhy::PdDataRequest(), ns3::SSLinkManager::PerformRanging(), ns3::Watchdog::Ping(), ns3::LrWpanMac::PlmeSetTRXStateConfirm(), TcpZeroWindowTest::ProcessedAck(), ns3::StaWifiMac::ReceiveAssocResp(), ns3::WifiTxTimer::Reschedule(), ns3::FrameExchangeManager::Reset(), ns3::HeFrameExchangeManager::Reset(), ns3::UanMacRc::RtsTimeout(), ns3::FrameExchangeManager::RxStartIndication(), ns3::Timer::Schedule(), ns3::UanMacRc::ScheduleData(), ns3::SsServiceFlowManager::ScheduleDsaReq(), ns3::BsServiceFlowManager::ScheduleDsaRsp(), ns3::TcpSocketBase::Send(), ns3::StaWifiMac::SendAssociationRequest(), ns3::MeshWifiInterfaceMac::SendBeacon(), ns3::SimpleNetDevice::SendFrom(), ns3::dot11s::HwmpProtocolMac::SendMyPerr(), ns3::dot11s::HwmpProtocolMac::SendMyPreq(), ns3::UanMacRc::SendRts(), ns3::Rip::SendTriggeredRouteUpdate(), ns3::RipNg::SendTriggeredRouteUpdate(), ns3::Rip::SendUnsolicitedRouteUpdate(), ns3::RipNg::SendUnsolicitedRouteUpdate(), ns3::LrWpanMac::SetLrWpanMacState(), ns3::WaveformGenerator::Start(), ns3::FdReader::Start(), ns3::LrWpanPhy::StartRx(), ns3::SimpleNetDevice::StartTransmission(), ns3::QosFrameExchangeManager::StartTransmission(), ns3::V4TraceRoute::StartWaitReplyTimer(), ns3::ArpCache::StartWaitReplyTimer(), ns3::WaveformGenerator::Stop(), ns3::TutorialApp::StopApplication(), ns3::Ping::StopApplication(), ns3::V4TraceRoute::StopApplication(), ns3::QosFrameExchangeManager::TransmissionFailed(), and ns3::Ipv4L3Protocol::UpdateDuplicate().
EventImpl * ns3::EventId::PeekEventImpl | ( | ) | const |
Definition at line 83 of file event-id.cc.
References m_eventImpl, NS_LOG_FUNCTION, and ns3::PeekPointer().
Referenced by ns3::EmlsrManager::NotifyMgtFrameReceived().
void ns3::EventId::Remove | ( | ) |
This method is syntactic sugar for the ns3::Simulator::Remove method.
Definition at line 62 of file event-id.cc.
References NS_LOG_FUNCTION, and ns3::Simulator::Remove().
Referenced by ns3::Timer::~Timer(), ns3::Timer::Remove(), and ns3::Timer::Suspend().
Test if two EventId's are not equal.
true
if the a and b are not the same event. Definition at line 164 of file event-id.h.
Less than operator for two EventId's, based on time stamps.
true
if a occurs before b. Definition at line 169 of file event-id.h.
Test if two EventId's are equal.
true
if the a and b represent the same event. Definition at line 157 of file event-id.h.
|
private |
The underlying event implementation.
Definition at line 146 of file event-id.h.
Referenced by PeekEventImpl().
|
private |
|
private |