|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
131 template <
typename FN>
143 template <
typename MEM_PTR,
typename OBJ_PTR>
153 template <
typename... Ts>
276 template <
typename FN>
283 template <
typename MEM_PTR,
typename OBJ_PTR>
291 template <
typename... Ts>
297 NS_FATAL_ERROR (
"You cannot set the arguments of a Timer before setting its function.");
InternalSuspended
Internal bit marking the suspended state.
ns3::EventId declarations.
State
The possible states of the Timer.
EventId m_event
The future event scheduled to expire the timer.
NS_FATAL_x macro definitions.
An identifier for simulation events.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
@ EXPIRED
Timer has already expired.
int m_flags
Bitfield for Timer State, DestroyPolicy and InternalSuspended.
void SetArgs(T1 a1)
Set the arguments to be used when invoking the expire function.
ns3::TimerImpl declaration and implementation.
@ SUSPENDED
Timer is suspended.
@ CHECK_ON_DESTROY
This policy enforces a check from the destructor of the Timer to verify that the timer has already ex...
enum Timer::State GetState(void) const
Time m_delay
The delay configured for this Timer.
void Cancel(void)
Cancel the currently-running event if there is one.
Time GetDelayLeft(void) const
bool IsRunning(void) const
void Remove(void)
Remove from the simulation event-list the currently-running event if there is one.
A simple virtual Timer class.
ns3::IntToType template class.
TimerImpl * MakeTimerImpl(FN fn)
Make a TimerImpl from a function pointer taking varying numbers of arguments.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
void Resume(void)
Restart the timer to expire within the amount of time left saved during Suspend.
void Schedule(void)
Schedule a new event using the currently-configured delay, function, and arguments.
@ RUNNING
Timer is currently running.
Simulation virtual time values and global simulation resolution.
@ CANCEL_ON_DESTROY
This policy cancels the event from the destructor of the Timer or from Suspend().
The timer implementation underlying Timer and Watchdog.
Timer()
Create a timer with a default event lifetime management policy:
@ REMOVE_ON_DESTROY
This policy removes the event from the simulation event list when the destructor of the Timer is invo...
void SetDelay(const Time &delay)
bool IsSuspended(void) const
bool IsExpired(void) const
Declaration of classes ns3::Time and ns3::TimeWithUnit, and the TimeValue implementation classes.
void SetArguments(Ts... args)
TimerImpl * m_impl
The timer implementation, which contains the bound callback function and arguments.
void Suspend(void)
Pause the timer and save the amount of time left until it was set to expire.
DestroyPolicy
The policy to use to manager the internal timer when an instance of the Timer class is destroyed or s...
Time GetDelay(void) const
Time m_delayLeft
The amount of time left on the Timer while it is suspended.