33 m_intervalExpiration (),
34 m_currentInterval (
Time(0)),
49 m_intervalExpiration (),
50 m_currentInterval (
Time(0)),
55 NS_ASSERT_MSG (doublings < std::numeric_limits<decltype(
m_ticks)>::digits,
"Doublings value is too large");
83 NS_ASSERT_MSG (doublings < std::numeric_limits<decltype(
m_ticks)>::digits,
"Doublings value is too large");
122 uint8_t doublings = 0;
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
Simulation virtual time values and global simulation resolution.
virtual void Invoke(void)=0
Invoke the expire function.
int64_t AssignStreams(int64_t streamNum)
Assigns the stream number for the uniform random number generator to use.
uint16_t GetRedundancy(void) const
Get the Redundancy constant of the timer.
void IntervalExpire(void)
Internal callback invoked when the interval expires.
Time m_minInterval
Minimum interval.
EventId m_timerExpiration
The future event scheduled to expire the timer.
void Stop()
Stop the timer.
Time m_currentInterval
Current interval.
Time m_maxInterval
Maximum interval.
void SetParameters(Time minInterval, uint8_t doublings, uint16_t redundancy)
Set the timer parameters.
Time GetMinInterval(void) const
Get the MinInterval of the timer.
uint64_t m_ticks
Interval span (i.e., exp2(doublings)).
void TimerExpire(void)
Internal callback invoked when the timer expires.
void InconsistentEvent()
Records an inconsistent event.
Time GetIntervalLeft(void) const
void Reset()
Reset the timer.
Time GetDelayLeft(void) const
EventId m_intervalExpiration
The future event scheduled to expire the interval.
void Enable()
Enable the timer.
Time GetMaxInterval(void) const
Get the MaxInterval of the timer.
uint8_t GetDoublings(void) const
Get the doublings of the timer.
Ptr< UniformRandomVariable > m_uniRand
Object to generate uniform random numbers.
~TrickleTimer()
Destructor.
void ConsistentEvent()
Records a consistent event.
TrickleTimer()
Constructor.
uint16_t m_counter
Event counter.
TimerImpl * m_impl
The timer implementation, which contains the bound callback function and arguments.
uint16_t m_redundancy
Redundancy constant.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::TrickleTimer timer class declaration.