A Discrete-Event Network Simulator
API
Virtual Time Timer and Watchdog

The Timer and Watchdog objects both facilitate scheduling functions to execute a specified virtual time in the future. More...

+ Collaboration diagram for Virtual Time Timer and Watchdog:

Modules

 TimerImpl Implementation
 

Files

file  timer-impl.h
 ns3::TimerImpl declaration and implementation.
 
file  timer.cc
 ns3::Timer implementation.
 
file  timer.h
 ns3::Timer class declaration.
 
file  watchdog-test-suite.cc
 Watchdog test suite.
 
file  watchdog.cc
 ns3::Watchdog timer class implementation.
 
file  watchdog.h
 ns3::Watchdog timer class declaration.
 

Classes

class  ns3::Timer
 A simple Timer class. More...
 
class  ns3::TimerImpl
 The timer implementation underlying Timer and Watchdog. More...
 
class  ns3::Watchdog
 A very simple watchdog operating in virtual time. More...
 

Enumerations

enum  ns3::Timer::DestroyPolicy { ns3::Timer::CANCEL_ON_DESTROY = (1 << 3), ns3::Timer::REMOVE_ON_DESTROY = (1 << 4), ns3::Timer::CHECK_ON_DESTROY = (1 << 5) }
 The policy to use to manager the internal timer when an instance of the Timer class is destroyed. More...
 
enum  ns3::Timer::InternalSuspended { ns3::Timer::TIMER_SUSPENDED = (1 << 7) }
 Internal bit marking the suspended state. More...
 
enum  ns3::Timer::State { ns3::Timer::RUNNING, ns3::Timer::EXPIRED, ns3::Timer::SUSPENDED }
 The possible states of the Timer. More...
 

Detailed Description

The Timer and Watchdog objects both facilitate scheduling functions to execute a specified virtual time in the future.

A Watchdog timer cannot be paused or cancelled once it has been started, however it can be lengthened (delayed). A Watchdog takes no action when it is destroyed.

A Timer can be suspended, resumed, cancelled and queried for time left, but it can't be extended (except by suspending and resuming). In addition, it can be configured to take different actions when the Timer is destroyed.

Enumeration Type Documentation

The policy to use to manager the internal timer when an instance of the Timer class is destroyed.

Enumerator
CANCEL_ON_DESTROY 

This policy cancels the event from the destructor of the Timer to verify that the event has already expired.

REMOVE_ON_DESTROY 

This policy removes the event from the simulation event list when the destructor of the Timer is invoked.

CHECK_ON_DESTROY 

This policy enforces a check from the destructor of the Timer to verify that the timer has already expired.

Definition at line 80 of file timer.h.

Internal bit marking the suspended state.

Enumerator
TIMER_SUSPENDED 

Definition at line 267 of file timer.h.

The possible states of the Timer.

Enumerator
RUNNING 
EXPIRED 

Timer is currently running.

SUSPENDED 

Timer has already expired.

Definition at line 99 of file timer.h.