20 #ifndef INCLUDE_OLA_UTIL_BACKOFF_H_ 21 #define INCLUDE_OLA_UTIL_BACKOFF_H_ 24 #include <ola/Clock.h> 55 : m_duration(duration) {
76 : m_duration(duration),
102 : m_initial(initial),
108 m_initial *
static_cast<int>(::pow(2, failed_attempts - 1)));
109 if (interval > m_max)
131 return m_policy->BackOffTime(++m_failures);
139 std::auto_ptr<const BackOffPolicy> m_policy;
140 unsigned int m_failures;
143 #endif // INCLUDE_OLA_UTIL_BACKOFF_H_ A time interval, with usecond accuracy.
Definition: Clock.h:138
virtual TimeInterval BackOffTime(unsigned int failed_attempts) const =0
Calculate the backoff time.
TimeInterval BackOffTime(unsigned int) const
Calculate the backoff time.
Definition: Backoff.h:58
Definition: Backoff.h:123
TimeInterval BackOffTime(unsigned int failed_attempts) const
Calculate the backoff time.
Definition: Backoff.h:106
TimeInterval BackOffTime(unsigned int failed_attempts) const
Calculate the backoff time.
Definition: Backoff.h:80
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44