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 (void)
 This method is syntactic sugar for the ns3::Simulator::Cancel method. More...
 
bool IsExpired (void) const
 This method is syntactic sugar for the ns3::Simulator::IsExpired method. More...
 
bool IsRunning (void) const
 This method is syntactic sugar for !IsExpired(). More...
 
void Remove (void)
 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 (void) const
 
uint64_t GetTs (void) const
 
uint32_t GetContext (void) const
 
uint32_t GetUid (void) 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 53 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 35 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 44 of file event-id.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ Cancel()

void ns3::EventId::Cancel ( void  )

This method is syntactic sugar for the ns3::Simulator::Cancel method.

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

References ns3::Simulator::Cancel(), and NS_LOG_FUNCTION.

Referenced by 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::DefaultChannelScheduler::AssignContinuousAccess(), ns3::DefaultChannelScheduler::AssignExtendedAccess(), 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::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::Ipv6ExtensionFragment::DoDispose(), ns3::Rip::DoDispose(), ns3::RipNg::DoDispose(), ns3::LteRlcAm::DoDispose(), ns3::LteRlcTm::DoDispose(), ns3::LteRlcUm::DoDispose(), ns3::dot11s::HwmpProtocol::DoDispose(), ns3::dot11s::PeerLink::DoDispose(), ns3::MeshWifiInterfaceMac::DoDispose(), ns3::HeFrameExchangeManager::DoDispose(), ns3::QosFrameExchangeManager::DoDispose(), ns3::DhcpClient::DoDispose(), ns3::ArpCache::DoDispose(), ns3::Ipv4L3Protocol::DoDispose(), ns3::LrWpanMac::DoDispose(), ns3::LrWpanPhy::DoDispose(), ns3::Application::DoDispose(), ns3::SimpleNetDevice::DoDispose(), ns3::SixLowPanNetDevice::DoDispose(), ns3::WaveformGenerator::DoDispose(), ns3::PieQueueDisc::DoDispose(), ns3::DefaultChannelScheduler::DoDispose(), ns3::WifiPhy::DoDispose(), ns3::ApWifiMac::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::LteRlcAm::DoTransmitPdcpPdu(), ns3::LteRlcTm::DoTransmitPdcpPdu(), ns3::LteRlcUm::DoTransmitPdcpPdu(), ns3::RandomWalk2dOutdoorMobilityModel::DoWalk(), ns3::RandomWalk2dMobilityModel::DoWalk(), ns3::PhyEntity::EndPreambleDetectionPeriod(), ns3::ArpCache::Flush(), ns3::WifiPhy::GetDelayUntilChannelSwitch(), ns3::WifiRadioEnergyModel::HandleEnergyChanged(), ns3::TcpSocketBase::LastAckTimeout(), ns3::DhcpClient::LinkStateHandler(), ns3::StaWifiMac::MissedBeacons(), ns3::LrWpanMac::MlmeSyncRequest(), ns3::DhcpClient::NetHandler(), ns3::TcpSocketBase::NewAck(), TcpNewRenoCongAvoidNormalTest::NormalClose(), TcpPacingTest::NormalClose(), ns3::WifiRadioEnergyModelPhyListener::NotifyMaybeCcaBusyStart(), 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::TcpWestwood::PktsAcked(), ns3::LrWpanPhy::PlmeSetAttributeRequest(), ns3::LrWpanPhy::PlmeSetTRXStateRequest(), ns3::TcpSocketBase::ProcessSynRcvd(), ns3::TcpSocketBase::ProcessSynSent(), ns3::V4TraceRoute::Receive(), ns3::StaWifiMac::Receive(), ns3::TcpSocketBase::ReceivedData(), ns3::LteUeMac::RecvRaResponse(), ns3::UeManager::RecvRrcConnectionReconfigurationCompleted(), ns3::UeManager::RecvRrcConnectionReestablishmentRequest(), ns3::UeManager::RecvRrcConnectionRequest(), ns3::UeManager::RecvRrcConnectionSetupCompleted(), ns3::UeManager::RecvUeContextRelease(), ns3::DefaultChannelScheduler::ReleaseAccess(), ns3::DhcpClient::RemoveAndStart(), ns3::WifiTxTimer::Reschedule(), ns3::RadioBearerStatsCalculator::RescheduleEndEpoch(), ns3::TrickleTimer::Reset(), ns3::LteSpectrumPhy::Reset(), ns3::FrameExchangeManager::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::WifiPhy::SetOffMode(), ns3::StaWifiMac::StartScanning(), ns3::TrickleTimer::Stop(), ns3::LteTestRrc::Stop(), ns3::WaveformGenerator::Stop(), ns3::DhcpClient::StopApplication(), ns3::DhcpServer::StopApplication(), ns3::V4Ping::StopApplication(), ns3::V4TraceRoute::StopApplication(), ns3::ChannelCoordinator::StopChannelCoordination(), ns3::Timer::Suspend(), ns3::UanTransducerHd::Transmit(), ns3::dot11s::HwmpProtocol::UnsetRoot(), ns3::LiIonEnergySource::UpdateEnergySource(), ns3::RvBatteryModel::UpdateEnergySource(), and ns3::BasicEnergyHarvester::UpdateHarvestedPower().

+ Here is the call graph for this function:

◆ GetContext()

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

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

References m_context, and NS_LOG_FUNCTION.

◆ GetTs()

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

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

References m_ts, and NS_LOG_FUNCTION.

◆ GetUid()

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

Definition at line 95 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 ( void  ) const

This method is syntactic sugar for the ns3::Simulator::IsExpired method.

Returns
true if the event has expired, false otherwise.

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

References ns3::Simulator::IsExpired(), and NS_LOG_FUNCTION.

Referenced by ns3::DefaultChannelScheduler::AssignContinuousAccess(), ns3::DefaultChannelScheduler::AssignExtendedAccess(), ns3::LrWpanPhy::CancelEd(), ns3::dsdv::RoutingTable::DeleteIpv4Event(), SimulatorEventsTestCase::Destroy(), ns3::TbfQueueDisc::DoDequeue(), ns3::DefaultChannelScheduler::DoDispose(), 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::DefaultChannelScheduler::ReleaseAccess(), ns3::StaWifiMac::RestartBeaconWatchdog(), ns3::Ping6::Send(), 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(), ns3::ChannelCoordinator::StopChannelCoordination(), and ns3::BasicEnergySource::UpdateEnergySource().

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

◆ IsRunning()

bool ns3::EventId::IsRunning ( void  ) const

This method is syntactic sugar for !IsExpired().

Returns
true if the event has not expired, false otherwise.

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

References IsExpired(), and NS_LOG_FUNCTION.

Referenced by ns3::Timer::~Timer(), ns3::WifiPhy::AbortCurrentReception(), ns3::dsdv::RoutingTable::AnyRunningEvent(), ns3::UanMacRc::Associate(), ns3::UanMacRc::AssociateTimeout(), ns3::OnOffApplication::CancelEvents(), ns3::QosFrameExchangeManager::CancelPifsRecovery(), ns3::LrWpanMac::CheckQueue(), ns3::TcpSocketBase::CloseAndNotify(), TcpNewRenoCongAvoidNormalTest::CWndTrace(), ns3::dsdv::RoutingTable::DeleteIpv4Event(), ns3::Ipv6ExtensionFragment::DoDispose(), ns3::V4Ping::DoDispose(), ns3::V4TraceRoute::DoDispose(), ns3::ArpCache::DoDispose(), ns3::Ipv4L3Protocol::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::QKDApp004::HandleReadFromKMS(), ns3::Timer::IsRunning(), ns3::WifiTxTimer::IsRunning(), ns3::StaWifiMac::MissedBeacons(), ns3::LrWpanMac::MlmeSyncRequest(), ns3::ChannelAccessManager::NotifyOffNow(), ns3::ChannelAccessManager::NotifySleepNow(), ns3::ChannelAccessManager::NotifySwitchingStartNow(), ns3::LrWpanMac::PdDataIndication(), ns3::LrWpanPhy::PdDataRequest(), ns3::SSLinkManager::PerformRanging(), ns3::Watchdog::Ping(), TcpZeroWindowTest::ProcessedAck(), ns3::StaWifiMac::Receive(), ns3::WifiTxTimer::Reschedule(), ns3::FrameExchangeManager::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::WaveformGenerator::Start(), ns3::FdReader::Start(), ns3::LrWpanPhy::StartRx(), ns3::StaWifiMac::StartScanning(), ns3::QosFrameExchangeManager::StartTransmission(), ns3::SimpleNetDevice::StartTransmission(), ns3::V4TraceRoute::StartWaitReplyTimer(), ns3::ArpCache::StartWaitReplyTimer(), ns3::WaveformGenerator::Stop(), MyApp::StopApplication(), ns3::QKDApp004::StopApplication(), ns3::QKDApp014::StopApplication(), ns3::V4Ping::StopApplication(), ns3::V4TraceRoute::StopApplication(), ns3::QosFrameExchangeManager::TransmissionFailed(), and ns3::Ipv4L3Protocol::UpdateDuplicate().

+ Here is the call graph for this function:

◆ PeekEventImpl()

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

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

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

+ Here is the call graph for this function:

◆ Remove()

void ns3::EventId::Remove ( void  )

This method is syntactic sugar for the ns3::Simulator::Remove method.

Definition at line 59 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 169 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 175 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 158 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: