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;
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Simulation virtual time values and global simulation resolution.
Time GetIntervalLeft(void) const
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
~TrickleTimer()
Destructor.
uint64_t m_ticks
Interval span (i.e., exp2(doublings)).
void ConsistentEvent()
Records a consistent event.
ns3::TrickleTimer timer class declaration.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint8_t GetDoublings(void) const
Get the doublings of the timer.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
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.
Time m_minInterval
Minimum interval.
void Reset()
Reset the timer.
TrickleTimer()
Constructor.
void SetParameters(Time minInterval, uint8_t doublings, uint16_t redundancy)
Set the timer parameters.
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.
Ptr< UniformRandomVariable > m_uniRand
Object to generate uniform random numbers.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
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.
void IntervalExpire(void)
Internal callback invoked when the interval expires.
Time m_maxInterval
Maximum interval.
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.
virtual void Invoke(void)=0
Invoke the expire function.
Time m_currentInterval
Current interval.
void Enable()
Enable the timer.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.