|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #ifndef TRICKLE_TIMER_H
22 #define TRICKLE_TIMER_H
195 template <
typename FN>
208 template <
typename MEM_PTR,
typename OBJ_PTR>
220 template <
typename... Ts>
266 template <
typename FN>
273 template <
typename MEM_PTR,
typename OBJ_PTR>
281 template <
typename... Ts>
287 NS_FATAL_ERROR (
"You cannot set the arguments of a TrickleTimer before setting its function.");
Time GetMaxInterval(void) const
Get the MaxInterval of the timer.
ns3::EventId declarations.
void Enable()
Enable the timer.
Time GetMinInterval(void) const
Get the MinInterval of the timer.
An identifier for simulation events.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint64_t m_ticks
Interval span (i.e., exp2(doublings)).
void SetArgs(T1 a1)
Set the arguments to be used when invoking the expire function.
ns3::TimerImpl declaration and implementation.
Time m_currentInterval
Current interval.
ns3::RandomVariableStream declaration, and related classes.
uint16_t m_counter
Event counter.
void SetParameters(Time minInterval, uint8_t doublings, uint16_t redundancy)
Set the timer parameters.
void InconsistentEvent()
Records an inconsistent event.
Time GetDelayLeft(void) const
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 Reset()
Reset the timer.
uint8_t GetDoublings(void) const
Get the doublings of the timer.
int64_t AssignStreams(int64_t streamNum)
Assigns the stream number for the uniform random number generator to use.
Ptr< UniformRandomVariable > m_uniRand
Object to generate uniform random numbers.
uint16_t GetRedundancy(void) const
Get the Redundancy constant of the timer.
void IntervalExpire(void)
Internal callback invoked when the interval expires.
~TrickleTimer()
Destructor.
void SetArguments(Ts &&... args)
Set the arguments to be used when invoking the expire function.
Simulation virtual time values and global simulation resolution.
The timer implementation underlying Timer and Watchdog.
void TimerExpire(void)
Internal callback invoked when the timer expires.
TimerImpl * m_impl
The timer implementation, which contains the bound callback function and arguments.
void SetFunction(FN fn)
Set the function to execute when the timer expires.
Time m_minInterval
Minimum interval.
Declaration of classes ns3::Time and ns3::TimeWithUnit, and the TimeValue implementation classes.
void Stop()
Stop the timer.
uint16_t m_redundancy
Redundancy constant.
EventId m_intervalExpiration
The future event scheduled to expire the interval.
EventId m_timerExpiration
The future event scheduled to expire the timer.
TrickleTimer()
Constructor.
Time m_maxInterval
Maximum interval.
Time GetIntervalLeft(void) const
void ConsistentEvent()
Records a consistent event.
A Trickle Timer following RFC 6206.