21 #ifndef _NDN_LIMITS_H_
22 #define _NDN_LIMITS_H_
25 #include "ns3/object.h"
26 #include "ns3/traced-value.h"
39 typedef Callback<void> CallbackHandler;
98 return m_maxRate > 0.0;
186 FireAvailableSlotCallback ();
192 CallbackHandler m_handler;
201 #endif // _NDN_LIMITS_H_
Abstract class to manage Interest limits.
virtual double GetLinkDelay() const
Get link delay (in seconds)
virtual void SetLinkDelay(double delay)
Set link delay (in seconds)
virtual bool IsEnabled() const
Check whether limits are enabled or not.
virtual double GetCurrentLimit() const =0
Get value of the current limit.
virtual double GetMaxLimit() const =0
Get maximum limit (interpretation of the limit depends on realization)
virtual bool IsBelowLimit()=0
Realization-specific method called to check availability of the limit.
virtual void UpdateCurrentLimit(double limit)=0
Update a current value of the limit.
Limits()
Default constructor.
virtual double GetMaxDelay() const
Get maximum delay for BDP product for window-based limits.
virtual void ReturnLimit()=0
"Return" limit
virtual void SetLimits(double rate, double delay)
Set limit for the number of outstanding interests.
virtual void BorrowLimit()=0
"Borrow" limit
virtual double GetMaxRate() const
Get maximum rate that needs to be enforced.
virtual double GetCurrentLimitRate() const =0
Get value of the current limit in terms of maximum rate that needs to be enforced.
void RegisterAvailableSlotCallback(CallbackHandler handler)
Set callback which will be called when exhausted limit gets a new slot.
virtual ~Limits()
Virtual destructor.