BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Member Functions | Static Public Attributes
BeeeOn::RandomBackOff Class Reference

Back-off policy that generates random delays in range between the given min and max. The random generation can be explicitly seeded for deterministic results (otherwise, it is seeded from the system's entropy pool). The RandomBackOff generates the specified number of random delays or inifinite based on the property count. More...

#include <RandomBackOff.h>

Inheritance diagram for BeeeOn::RandomBackOff:
BeeeOn::BackOff

Public Member Functions

 RandomBackOff (const Poco::Timespan &min, const Poco::Timespan &max, size_t count, uint32_t seed)
 
Poco::Timespan next () override
 Generates up to count of random delays. If the count is set to 0, it is treated as inifinity. More...
 
void reset () override
 Re-seed and clear the number of available iterations to zero.
 

Static Public Attributes

static const uint32_t RANDOM_SEED = 0xffffffff
 
- Static Public Attributes inherited from BeeeOn::BackOff
static const Poco::Timespan STOP = -1
 

Additional Inherited Members

- Public Types inherited from BeeeOn::BackOff
typedef Poco::SharedPtr< BackOffPtr
 

Detailed Description

Back-off policy that generates random delays in range between the given min and max. The random generation can be explicitly seeded for deterministic results (otherwise, it is seeded from the system's entropy pool). The RandomBackOff generates the specified number of random delays or inifinite based on the property count.

Member Function Documentation

Timespan RandomBackOff::next ( )
overridevirtual

Generates up to count of random delays. If the count is set to 0, it is treated as inifinity.

Returns
random delay between min and max or STOP when the configure count of generations was reached

Implements BeeeOn::BackOff.


The documentation for this class was generated from the following files: