36 : m_flags (CHECK_ON_DESTROY),
45 : m_flags (destroyPolicy),
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
Simulation virtual time values and global simulation resolution.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Timer()
Create a timer with a default event lifetime management policy:
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
This policy enforces a check from the destructor of the Timer to verify that the timer has already ex...
#define NS_FATAL_ERROR(msg)
Fatal error handling.
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
ns3::SimulationSingleton declaration and template implementation.
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
ns3::Simulator declaration.
bool IsRunning(void) const
Time m_delay
The delay configured for this Timer.
ns3::Timer class declaration.
Timer has already expired.
void Schedule(void)
Schedule a new event using the currently-configured delay, function, and arguments.
void Remove(void)
Remove from the simulation event-list the currently-running event if there is one.
virtual EventId Schedule(const Time &delay)=0
Schedule the callback for a future time.
Time m_delayLeft
The amount of time left on the Timer while it is suspended.
void SetDelay(const Time &delay)
int m_flags
Bitfield for Timer State, DestroyPolicy and InternalSuspended.
enum Timer::State GetState(void) const
static void Remove(const EventId &id)
Remove an event from the event list.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
State
The possible states of the Timer.
void Resume(void)
Restart the timer to expire within the amount of time left saved during Suspend.
Time TimeStep(uint64_t ts)
Time GetDelay(void) const
This policy removes the event from the simulation event list when the destructor of the Timer is invo...
Timer is currently running.
TimerImpl * m_impl
The timer implementation, which contains the bound callback function and arguments.
EventId m_event
The future event scheduled to expire the timer.
void Cancel(void)
Cancel the currently-running event if there is one.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
bool IsExpired(void) const
void Suspend(void)
Cancel the timer and save the amount of time left until it was set to expire.
Time FemtoSeconds(uint64_t value)
Construct a Time in the indicated unit.
bool IsSuspended(void) const
Time GetDelayLeft(void) const
This policy cancels the event from the destructor of the Timer to verify that the event has already e...
bool IsExpired(void) const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
DestroyPolicy
The policy to use to manager the internal timer when an instance of the Timer class is destroyed...