BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Data Structures | Public Types | Public Member Functions | Protected Member Functions
BeeeOn::LoopRunner Class Reference
Inheritance diagram for BeeeOn::LoopRunner:
BeeeOn::StoppableLoop BeeeOn::Loggable

Data Structures

class  Stopper
 Wrapper around StoppableLoop that allows to stop it from inside a thread. More...
 

Public Types

typedef Poco::SharedPtr
< LoopRunner
Ptr
 
- Public Types inherited from BeeeOn::StoppableLoop
typedef Poco::SharedPtr
< StoppableLoop
Ptr
 

Public Member Functions

void addRunnable (StoppableRunnable::Ptr runnable)
 
void addLoop (StoppableLoop::Ptr loop)
 
void setAutoStart (bool enable)
 
void setStopParallel (bool parallel)
 Set whether stopAll() should run in parallel.
 
void start () override
 
void stop () override
 
void autoStart ()
 
- Public Member Functions inherited from BeeeOn::Loggable
 Loggable (const ClassInfo &info)
 
 Loggable (const std::type_info &info)
 

Protected Member Functions

void stopAll (std::list< Stopper > &list)
 Stop all loop in reverse order. If the property stopParallel is true then the loops are stopped in parallel (multiple threads). More...
 
void stopParallel (std::list< Stopper > &list)
 Stops the given list of loops in parallel. Loops that have been stopped are removed from the list.
 
- Protected Member Functions inherited from BeeeOn::Loggable
void setupLogger (Poco::Logger *logger=0) const
 
Poco::Logger & logger () const
 

Additional Inherited Members

- Static Public 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)
 

Member Function Documentation

void LoopRunner::start ( )
overridevirtual

Starts the loop to process in an internally managed thread.

Implements BeeeOn::StoppableLoop.

void LoopRunner::stop ( )
overridevirtual

Stop the loop and wait until finished.

Implements BeeeOn::StoppableLoop.

void LoopRunner::stopAll ( std::list< Stopper > &  list)
protected

Stop all loop in reverse order. If the property stopParallel is true then the loops are stopped in parallel (multiple threads).

If there is an issue with starting threads, the loops that were not stopped in parallel are stopped sequentially as a fallback.


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