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 | IsPending () const |
This method is syntactic sugar for !IsExpired(). | |
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(), IsPending(), IsExpired() or passing around instances of this object will not result in crashes or memory leaks.
Definition at line 44 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 48 of file event-id.h.
ns3::EventId::EventId | ( | ) |
Default constructor.
This EventId does nothing.
Definition at line 25 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 34 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 44 of file event-id.cc.
References ns3::Simulator::Cancel(), and NS_LOG_FUNCTION.
Referenced by ns3::ApWifiMac::ApLinkEntity::~ApLinkEntity(), ns3::BlockAckAgreement::~BlockAckAgreement(), ns3::GaussMarkovMobilityModel::~GaussMarkovMobilityModel(), ns3::RandomDirection2dMobilityModel::~RandomDirection2dMobilityModel(), ns3::RandomWalk2dMobilityModel::~RandomWalk2dMobilityModel(), ns3::RandomWaypointMobilityModel::~RandomWaypointMobilityModel(), ns3::SteadyStateRandomWaypointMobilityModel::~SteadyStateRandomWaypointMobilityModel(), ns3::Timer::~Timer(), ns3::TrickleTimer::~TrickleTimer(), ns3::Watchdog::~Watchdog(), ns3::WaypointMobilityModel::~WaypointMobilityModel(), ns3::WifiTxTimer::~WifiTxTimer(), ns3::HalfDuplexIdealPhy::AbortRx(), ns3::DhcpClient::AcceptAck(), ns3::RandomDirection2dMobilityModel::BeginPause(), ns3::RandomWaypointMobilityModel::BeginWalk(), ns3::lrwpan::LrWpanCsmaCa::Cancel(), ns3::Timer::Cancel(), ns3::WifiTxTimer::Cancel(), ns3::TcpSocketBase::CancelAllTimers(), ns3::lrwpan::LrWpanPhy::CancelEd(), ns3::UeManager::CancelPendingEvents(), ns3::QosFrameExchangeManager::CancelPifsRecovery(), ns3::lrwpan::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::dsdv::RoutingTable::DeleteIpv4Event(), ns3::StaWifiMac::Disassociated(), ns3::Application::DoDispose(), ns3::ArpCache::DoDispose(), ns3::DhcpClient::DoDispose(), ns3::dot11s::HwmpProtocol::DoDispose(), ns3::dot11s::PeerLink::DoDispose(), ns3::EhtFrameExchangeManager::DoDispose(), ns3::EmlsrManager::DoDispose(), ns3::HeFrameExchangeManager::DoDispose(), ns3::Ipv4L3Protocol::DoDispose(), ns3::Ipv6ExtensionFragment::DoDispose(), ns3::lrwpan::LrWpanMac::DoDispose(), ns3::lrwpan::LrWpanPhy::DoDispose(), ns3::LteRlcAm::DoDispose(), ns3::LteRlcTm::DoDispose(), ns3::LteRlcUm::DoDispose(), ns3::MeshWifiInterfaceMac::DoDispose(), ns3::PieQueueDisc::DoDispose(), ns3::QosFrameExchangeManager::DoDispose(), ns3::Rip::DoDispose(), ns3::RipNg::DoDispose(), ns3::SimpleNetDevice::DoDispose(), ns3::SixLowPanNetDevice::DoDispose(), ns3::WaveformGenerator::DoDispose(), ns3::WifiDefaultAssocManager::DoDispose(), ns3::TcpSocketBase::DoForwardUp(), ns3::ApWifiMac::DoInitialize(), ns3::MeshWifiInterfaceMac::DoInitialize(), ns3::AdvancedEmlsrManager::DoNotifyTxopEnd(), 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::RandomWalk2dMobilityModel::DoWalk(), ns3::RandomWalk2dOutdoorMobilityModel::DoWalk(), ns3::PhyEntity::EndPreambleDetectionPeriod(), ns3::lrwpan::LrWpanMac::EndStartRequest(), ns3::ArpCache::Flush(), ns3::WifiRadioEnergyModel::HandleEnergyChanged(), ns3::Icmpv6L4Protocol::HandleRA(), ns3::TcpSocketBase::LastAckTimeout(), ns3::DhcpClient::LinkStateHandler(), ns3::StaWifiMac::MissedBeacons(), ns3::lrwpan::LrWpanMac::MlmeScanRequest(), ns3::lrwpan::LrWpanMac::MlmeSyncRequest(), ns3::DhcpClient::NetHandler(), ns3::TcpSocketBase::NewAck(), TcpNewRenoCongAvoidNormalTest::NormalClose(), TcpPacingTest::NormalClose(), ns3::WifiRadioEnergyModelPhyListener::NotifyCcaBusyStart(), ns3::DefaultEmlsrManager::NotifyMainPhySwitch(), ns3::EmlsrManager::NotifyMgtFrameReceived(), ns3::WifiRadioEnergyModelPhyListener::NotifyOff(), ns3::ChannelAccessManager::NotifyOffNow(), ns3::WifiRadioEnergyModelPhyListener::NotifyRxStart(), ns3::WifiRadioEnergyModelPhyListener::NotifySleep(), ns3::WifiRadioEnergyModelPhyListener::NotifySwitchingStart(), ns3::ChannelAccessManager::NotifySwitchingStartNow(), ns3::WifiRadioEnergyModelPhyListener::NotifyTxStart(), ns3::DhcpClient::OfferHandler(), ns3::lrwpan::LrWpanMac::PdDataConfirm(), ns3::lrwpan::LrWpanMac::PdDataIndication(), ns3::TcpWestwoodPlus::PktsAcked(), ns3::lrwpan::LrWpanMac::PlmeSetAttributeConfirm(), ns3::lrwpan::LrWpanPhy::PlmeSetAttributeRequest(), ns3::lrwpan::LrWpanPhy::PlmeSetTRXStateRequest(), ns3::EhtFrameExchangeManager::PostProcessFrame(), ns3::lrwpan::LrWpanMac::PrepareRetransmission(), ns3::TcpSocketBase::ProcessSynRcvd(), ns3::TcpSocketBase::ProcessSynSent(), ns3::V4TraceRoute::Receive(), ns3::StaWifiMac::ReceiveAssocResp(), ns3::lrwpan::LrWpanMac::ReceiveBeacon(), ns3::TcpSocketBase::ReceivedData(), ns3::EhtFrameExchangeManager::ReceiveMpdu(), 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::FrameExchangeManager::Reset(), ns3::HeFrameExchangeManager::Reset(), ns3::LteSpectrumPhy::Reset(), ns3::TrickleTimer::Reset(), ns3::ChannelAccessManager::ResetAllBackoffs(), ns3::LteUeRrc::ResetRlfParams(), ns3::FrameExchangeManager::RxStartIndication(), ns3::HeFrameExchangeManager::RxStartIndication(), ns3::UanMacRc::ScheduleData(), ns3::StaWifiMac::SendAssociationRequest(), ns3::TcpSocketBase::SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::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::lrwpan::LrWpanMac::SetLrWpanMacState(), ns3::EhtFrameExchangeManager::StartTransmission(), ns3::LteTestRrc::Stop(), ns3::TrickleTimer::Stop(), ns3::WaveformGenerator::Stop(), ns3::DhcpClient::StopApplication(), ns3::DhcpServer::StopApplication(), ns3::Ping::StopApplication(), ns3::V4TraceRoute::StopApplication(), ns3::Timer::Suspend(), ns3::DefaultEmlsrManager::SwitchMainPhyBackToPrimaryLink(), ns3::UanTransducerHd::Transmit(), ns3::dot11s::HwmpProtocol::UnsetRoot(), ns3::energy::GenericBatteryModel::UpdateEnergySource(), ns3::energy::LiIonEnergySource::UpdateEnergySource(), ns3::energy::RvBatteryModel::UpdateEnergySource(), ns3::energy::BasicEnergyHarvester::UpdateHarvestedPower(), ns3::EhtFrameExchangeManager::UpdateTxopEndOnRxEnd(), ns3::EhtFrameExchangeManager::UpdateTxopEndOnRxStartIndication(), and ns3::EhtFrameExchangeManager::UpdateTxopEndOnTxStart().
uint32_t ns3::EventId::GetContext | ( | ) | const |
Definition at line 92 of file event-id.cc.
References m_context, and NS_LOG_FUNCTION.
uint64_t ns3::EventId::GetTs | ( | ) | const |
Definition at line 85 of file event-id.cc.
References m_ts, and NS_LOG_FUNCTION.
uint32_t ns3::EventId::GetUid | ( | ) | const |
Definition at line 99 of file event-id.cc.
References m_uid, and NS_LOG_FUNCTION.
Referenced by 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 58 of file event-id.cc.
References ns3::Simulator::IsExpired(), and NS_LOG_FUNCTION.
Referenced by ns3::lrwpan::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::lrwpan::LrWpanPhy::EndRx(), ns3::Timer::IsExpired(), IsPending(), ns3::lrwpan::LrWpanMac::PdDataConfirm(), ns3::lrwpan::LrWpanPhy::PlmeSetTRXStateRequest(), ns3::TcpSocketBase::ReceivedData(), ns3::StaWifiMac::RestartBeaconWatchdog(), EpsBearerTagUdpClient::Send(), ns3::PacketSocketClient::Send(), ns3::UdpClient::Send(), ns3::UdpEchoClient::Send(), ns3::UdpTraceClient::Send(), ns3::TcpSocketBase::SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), ns3::TcpSocketBase::SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), ns3::OnOffApplication::SendPacket(), ns3::PhyEntity::StartReceiveField(), ns3::PhyEntity::StartReceivePayload(), ns3::lrwpan::LrWpanPhy::StartRx(), and ns3::energy::BasicEnergySource::UpdateEnergySource().
bool ns3::EventId::IsPending | ( | ) | const |
This method is syntactic sugar for !IsExpired().
true
if the event has not expired, false
otherwise. Definition at line 65 of file event-id.cc.
References IsExpired(), and NS_LOG_FUNCTION.
Referenced by ns3::Timer::~Timer(), ns3::dsdv::RoutingTable::AnyRunningEvent(), ns3::UanMacRc::Associate(), ns3::UanMacRc::AssociateTimeout(), ns3::WifiDefaultAssocManager::CanBeInserted(), ns3::OnOffApplication::CancelEvents(), ns3::QosFrameExchangeManager::CancelPifsRecovery(), ns3::EhtFrameExchangeManager::CheckEmlsrClientStartingTxop(), ns3::lrwpan::LrWpanMac::CheckQueue(), ns3::TcpSocketBase::CloseAndNotify(), TcpNewRenoCongAvoidNormalTest::CWndTrace(), ns3::dsdv::RoutingTable::DeleteIpv4Event(), ns3::ArpCache::DoDispose(), ns3::Ipv4L3Protocol::DoDispose(), ns3::Ipv6ExtensionFragment::DoDispose(), ns3::SimpleNetDevice::DoDispose(), ns3::SixLowPanNetDevice::DoDispose(), ns3::V4TraceRoute::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::lrwpan::LrWpanPhy::EndTx(), ns3::UanPhyGen::EnergyDepletionHandler(), ns3::UanMacRc::Enqueue(), ns3::ArpCache::Flush(), ns3::MeshWifiInterfaceMac::GetBeaconGeneration(), ns3::TrickleTimer::GetDelayLeft(), ns3::TrickleTimer::GetIntervalLeft(), ns3::Icmpv6L4Protocol::HandleRA(), IsRunning(), ns3::Timer::IsRunning(), ns3::WifiTxTimer::IsRunning(), ns3::StaWifiMac::MissedBeacons(), ns3::lrwpan::LrWpanMac::MlmeScanRequest(), ns3::lrwpan::LrWpanMac::MlmeSyncRequest(), ns3::EhtFrameExchangeManager::NotifyChannelReleased(), ns3::EmlsrManager::NotifyMgtFrameReceived(), ns3::ChannelAccessManager::NotifyOffNow(), ns3::ChannelAccessManager::NotifySwitchingStartNow(), ns3::lrwpan::LrWpanMac::PdDataIndication(), ns3::lrwpan::LrWpanPhy::PdDataRequest(), ns3::SSLinkManager::PerformRanging(), ns3::Watchdog::Ping(), ns3::lrwpan::LrWpanMac::PlmeSetTRXStateConfirm(), ns3::EhtFrameExchangeManager::PostProcessFrame(), TcpZeroWindowTest::ProcessedAck(), ns3::StaWifiMac::ReceiveAssocResp(), ns3::lrwpan::LrWpanMac::ReceiveBeacon(), 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::lrwpan::LrWpanMac::SetLrWpanMacState(), ns3::FdReader::Start(), ns3::WaveformGenerator::Start(), ns3::lrwpan::LrWpanPhy::StartRx(), ns3::QosFrameExchangeManager::StartTransmission(), ns3::QosFrameExchangeManager::StartTransmission(), ns3::SimpleNetDevice::StartTransmission(), ns3::ArpCache::StartWaitReplyTimer(), ns3::V4TraceRoute::StartWaitReplyTimer(), ns3::WaveformGenerator::Stop(), ns3::Ping::StopApplication(), ns3::TutorialApp::StopApplication(), ns3::V4TraceRoute::StopApplication(), ns3::QosFrameExchangeManager::TransmissionFailed(), ns3::Ipv4L3Protocol::UpdateDuplicate(), ns3::EhtFrameExchangeManager::UpdateTxopEndOnRxEnd(), ns3::EhtFrameExchangeManager::UpdateTxopEndOnRxStartIndication(), and ns3::EhtFrameExchangeManager::UpdateTxopEndOnTxStart().
bool ns3::EventId::IsRunning | ( | ) | const |
This method is syntactic sugar for !IsExpired().
true
if the event has not expired, false
otherwise. Definition at line 72 of file event-id.cc.
References IsPending().
EventImpl * ns3::EventId::PeekEventImpl | ( | ) | const |
Definition at line 78 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 51 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 162 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 167 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 155 of file event-id.h.
|
private |
The underlying event implementation.
Definition at line 144 of file event-id.h.
Referenced by PeekEventImpl().
|
private |
|
private |