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

Executes some function periodacally based on the given interval. More...

#include <PeriodicRunner.h>

Inheritance diagram for BeeeOn::PeriodicRunner:
BeeeOn::Loggable

Public Types

typedef std::function< void()> Callback
 

Public Member Functions

void start (const Callback &callback)
 
void stop ()
 
void setInterval (const Poco::Timespan &interval)
 

Additional Inherited Members

- Protected Member Functions inherited from BeeeOn::Loggable
void setupLogger (Poco::Logger *logger=0) const
 
Poco::Logger & logger () const
 
 Loggable (const ClassInfo &info)
 
 Loggable (const std::type_info &info)
 
- Static Protected Member Functions inherited from BeeeOn::Loggable
static Poco::Logger & forMethod (const char *name)
 
static Poco::Logger & forClass (const ClassInfo &info)
 
static Poco::Logger & forClass (const std::type_info &info)
 
template<typename T >
static Poco::Logger & forInstance (const T *i)
 
static void configureSimple (Poco::Logger &logger, const std::string &level)
 
static void logException (Poco::Logger &logger, const Poco::Message::Priority priority, const Poco::Exception &e, const char *file, size_t line)
 

Detailed Description

Executes some function periodacally based on the given interval.

The class simplifies coding of simple periodical tasks like generation of statistics, sampling data, etc.

Member Function Documentation

void PeriodicRunner::setInterval ( const Poco::Timespan &  interval)

Set interval of executions.

void PeriodicRunner::start ( const Callback &  callback)

Starts the runner to executed repeatedly the given callback.

void PeriodicRunner::stop ( )

Stops the runner.


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