|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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;
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time GetMaxInterval(void) const
Get the MaxInterval of the timer.
void Enable()
Enable the timer.
Time GetMinInterval(void) const
Get the MinInterval of the timer.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint64_t m_ticks
Interval span (i.e., exp2(doublings)).
static Time GetDelayLeft(const EventId &id)
Get the remaining time until this event will execute.
Time m_currentInterval
Current interval.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
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
bool IsRunning(void) const
This method is syntactic sugar for !IsExpired().
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 Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
virtual void Invoke(void)=0
Invoke the expire function.
Simulation virtual time values and global simulation resolution.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
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 m_minInterval
Minimum interval.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void Stop()
Stop the timer.
uint16_t m_redundancy
Redundancy constant.
EventId m_intervalExpiration
The future event scheduled to expire the interval.
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
EventId m_timerExpiration
The future event scheduled to expire the timer.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
TrickleTimer()
Constructor.
ns3::TrickleTimer timer class declaration.
Time m_maxInterval
Maximum interval.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Time GetIntervalLeft(void) const
void ConsistentEvent()
Records a consistent event.