A Discrete-Event Network Simulator
API
ns3::EventId Class Reference

An identifier for simulation events. More...

#include "event-id.h"

+ Collaboration diagram for ns3::EventId:

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. More...
 
 EventId (const Ptr< EventImpl > &impl, uint64_t ts, uint32_t context, uint32_t uid)
 Construct a real event. More...
 
void Cancel ()
 This method is syntactic sugar for the ns3::Simulator::Cancel method. More...
 
bool IsExpired () const
 This method is syntactic sugar for the ns3::Simulator::IsExpired method. More...
 
bool IsRunning () const
 This method is syntactic sugar for !IsExpired(). More...
 
void Remove ()
 This method is syntactic sugar for the ns3::Simulator::Remove method. More...
 
Scheduler Helpers.

These methods are normally invoked only by subclasses of the Scheduler base class.

EventImplPeekEventImpl () const
 
uint64_t GetTs () const
 
uint32_t GetContext () const
 
uint32_t GetUid () const
 

Private Attributes

uint32_t m_context
 The context. More...
 
Ptr< EventImplm_eventImpl
 The underlying event implementation. More...
 
uint64_t m_ts
 The virtual time stamp. More...
 
uint32_t m_uid
 The unique id. More...
 

Friends

bool operator!= (const EventId &a, const EventId &b)
 Test if two EventId's are not equal. More...
 
bool operator< (const EventId &a, const EventId &b)
 Less than operator for two EventId's, based on time stamps. More...
 
bool operator== (const EventId &a, const EventId &b)
 Test if two EventId's are equal. More...
 

Detailed Description

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.

Member Enumeration Documentation

◆ 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.

Constructor & Destructor Documentation

◆ EventId() [1/2]

ns3::EventId::EventId ( )

Default constructor.

This EventId does nothing.

Definition at line 36 of file event-id.cc.

References NS_LOG_FUNCTION.

◆ EventId() [2/2]

ns3::EventId::EventId ( const Ptr< EventImpl > &  impl,
uint64_t  ts,
uint32_t  context,
uint32_t  uid 
)

Construct a real event.

Parameters
[in]implThe implementation of this event.
[in]tsThe virtual time stamp this event should occur.
[in]contextThe execution context for this event.
[in]uidThe unique id for this EventId.

Definition at line 45 of file event-id.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ Cancel()

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::EhtFrameExchangeManager::DoDispose(), ns3::EmlsrManager::DoDispose(), ns3::HeFrameExchangeManager::DoDispose(), ns3::MultiUserScheduler::DoDispose(), ns3::QosFrameExchangeManager::DoDispose(), ns3::WifiDefaultAssocManager::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::WifiRadioEnergyModel::HandleEnergyChanged(), ns3::Icmpv6L4Protocol::HandleRA(), ns3::TcpSocketBase::LastAckTimeout(), ns3::DhcpClient::LinkStateHandler(), ns3::StaWifiMac::MissedBeacons(), 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::WifiRadioEnergyModelPhyListener::NotifyTxStart(), ns3::DhcpClient::OfferHandler(), ns3::LrWpanMac::PdDataConfirm(), ns3::LrWpanMac::PdDataIndication(), ns3::TcpWestwoodPlus::PktsAcked(), ns3::LrWpanMac::PlmeSetAttributeConfirm(), ns3::LrWpanPhy::PlmeSetAttributeRequest(), ns3::LrWpanPhy::PlmeSetTRXStateRequest(), ns3::EhtFrameExchangeManager::PostProcessFrame(), ns3::LrWpanMac::PrepareRetransmission(), ns3::TcpSocketBase::ProcessSynRcvd(), ns3::TcpSocketBase::ProcessSynSent(), ns3::V4TraceRoute::Receive(), ns3::StaWifiMac::ReceiveAssocResp(), 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::TrickleTimer::Reset(), ns3::LteSpectrumPhy::Reset(), ns3::FrameExchangeManager::Reset(), ns3::WifiPhy::Reset(), ns3::HeFrameExchangeManager::Reset(), ns3::ChannelAccessManager::ResetAllBackoffs(), ns3::LteUeRrc::ResetRlfParams(), ns3::ChannelAccessManager::ResetState(), ns3::FrameExchangeManager::RxStartIndication(), ns3::HeFrameExchangeManager::RxStartIndication(), ns3::UanMacRc::ScheduleData(), 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::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::GenericBatteryModel::UpdateEnergySource(), ns3::LiIonEnergySource::UpdateEnergySource(), ns3::RvBatteryModel::UpdateEnergySource(), ns3::BasicEnergyHarvester::UpdateHarvestedPower(), ns3::EhtFrameExchangeManager::UpdateTxopEndOnRxEnd(), ns3::EhtFrameExchangeManager::UpdateTxopEndOnRxStartIndication(), and ns3::EhtFrameExchangeManager::UpdateTxopEndOnTxStart().

+ Here is the call graph for this function:

◆ GetContext()

uint32_t ns3::EventId::GetContext ( ) const
Returns
The event context.

Definition at line 97 of file event-id.cc.

References m_context, and NS_LOG_FUNCTION.

◆ GetTs()

uint64_t ns3::EventId::GetTs ( ) const
Returns
The virtual time stamp.

Definition at line 90 of file event-id.cc.

References m_ts, and NS_LOG_FUNCTION.

◆ GetUid()

uint32_t ns3::EventId::GetUid ( ) const
Returns
The unique id.

Definition at line 104 of file event-id.cc.

References m_uid, and NS_LOG_FUNCTION.

Referenced by ns3::dsdv::RoutingProtocol::RecvDsdv().

+ Here is the caller graph for this function:

◆ IsExpired()

bool ns3::EventId::IsExpired ( ) const

◆ IsRunning()

bool ns3::EventId::IsRunning ( ) const

This method is syntactic sugar for !IsExpired().

Returns
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::UanMacRc::Associate(), ns3::UanMacRc::AssociateTimeout(), ns3::WifiDefaultAssocManager::CanBeInserted(), ns3::OnOffApplication::CancelEvents(), ns3::QosFrameExchangeManager::CancelPifsRecovery(), ns3::LrWpanMac::CheckQueue(), ns3::TcpSocketBase::CloseAndNotify(), ns3::EhtFrameExchangeManager::CtsAfterMuRtsTimeout(), 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::EndTx(), ns3::UanPhyGen::EnergyDepletionHandler(), ns3::UanMacRc::Enqueue(), ns3::ArpCache::Flush(), ns3::MeshWifiInterfaceMac::GetBeaconGeneration(), ns3::TrickleTimer::GetDelayLeft(), ns3::TrickleTimer::GetIntervalLeft(), ns3::Icmpv6L4Protocol::HandleRA(), ns3::QKDApp004::HandleReadFromKMS(), ns3::WifiPhy::IsReceivingPhyHeader(), ns3::Timer::IsRunning(), ns3::WifiTxTimer::IsRunning(), ns3::StaWifiMac::MissedBeacons(), ns3::LrWpanMac::MlmeScanRequest(), ns3::LrWpanMac::MlmeSyncRequest(), ns3::MultiUserScheduler::NotifyAccessGranted(), ns3::EmlsrManager::NotifyMgtFrameReceived(), ns3::ChannelAccessManager::NotifyOffNow(), ns3::ChannelAccessManager::NotifySleepNow(), ns3::LrWpanMac::PdDataIndication(), ns3::LrWpanPhy::PdDataRequest(), ns3::SSLinkManager::PerformRanging(), ns3::Watchdog::Ping(), ns3::LrWpanMac::PlmeSetTRXStateConfirm(), ns3::EhtFrameExchangeManager::PostProcessFrame(), TcpZeroWindowTest::ProcessedAck(), ns3::Txop::Queue(), ns3::StaWifiMac::ReceiveAssocResp(), ns3::WifiTxTimer::Reschedule(), ns3::FrameExchangeManager::Reset(), ns3::HeFrameExchangeManager::Reset(), ns3::ChannelAccessManager::ResetState(), 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::QKDApp004::StopApplication(), ns3::QKDApp014::StopApplication(), ns3::QosFrameExchangeManager::TransmissionFailed(), ns3::Ipv4L3Protocol::UpdateDuplicate(), ns3::EhtFrameExchangeManager::UpdateTxopEndOnRxEnd(), ns3::EhtFrameExchangeManager::UpdateTxopEndOnRxStartIndication(), and ns3::EhtFrameExchangeManager::UpdateTxopEndOnTxStart().

+ Here is the call graph for this function:

◆ PeekEventImpl()

EventImpl * ns3::EventId::PeekEventImpl ( ) const
Returns
The underlying EventImpl pointer.

Definition at line 83 of file event-id.cc.

References m_eventImpl, NS_LOG_FUNCTION, and ns3::PeekPointer().

Referenced by ns3::EmlsrManager::NotifyMgtFrameReceived().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Remove()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const EventId a,
const EventId b 
)
friend

Test if two EventId's are not equal.

Parameters
[in]aThe first EventId.
[in]bThe second EventId.
Returns
true if the a and b are not the same event.

Definition at line 164 of file event-id.h.

◆ operator<

bool operator< ( const EventId a,
const EventId b 
)
friend

Less than operator for two EventId's, based on time stamps.

Parameters
[in]aThe first EventId.
[in]bThe second EventId.
Returns
true if a occurs before b.

Definition at line 169 of file event-id.h.

◆ operator==

bool operator== ( const EventId a,
const EventId b 
)
friend

Test if two EventId's are equal.

Parameters
[in]aThe first EventId.
[in]bThe second EventId.
Returns
true if the a and b represent the same event.

Definition at line 157 of file event-id.h.

Member Data Documentation

◆ m_context

uint32_t ns3::EventId::m_context
private

The context.

Definition at line 148 of file event-id.h.

Referenced by GetContext().

◆ m_eventImpl

Ptr<EventImpl> ns3::EventId::m_eventImpl
private

The underlying event implementation.

Definition at line 146 of file event-id.h.

Referenced by PeekEventImpl().

◆ m_ts

uint64_t ns3::EventId::m_ts
private

The virtual time stamp.

Definition at line 147 of file event-id.h.

Referenced by GetTs().

◆ m_uid

uint32_t ns3::EventId::m_uid
private

The unique id.

Definition at line 149 of file event-id.h.

Referenced by GetUid().


The documentation for this class was generated from the following files: