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