ADTF  3.18.2
cLooper

The looper helper class is a managed endless loop, which can be suspended. More...

Inheritance diagram for cLooper:
[legend]

Classes

struct  Impl
 
struct  ImplBase
 

Public Types

enum class  tLoopState { Destroyed , Suspended , Running }
 Loop state. More...
 

Public Member Functions

 cLooper ()
 CTOR.
 
 cLooper (cLooper &&)
 
 cLooper (const cLooper &)=delete
 
template<typename ... Args>
 cLooper (Args &&... args)
 
template<typename Callable , typename ... Args>
 cLooper (tLoopState eState, Callable &&pFunc, Args &&... args)
 
cLooperoperator= (cLooper &&oOther)
 
tLoopState GetState ()
 
tResult SetState (tLoopState eState, tBool bWaitForAck=tTrue)
 
tVoid ResetLoop (tLoopState eInitialState=tLoopState::Running)
 
tVoid Swap (cLooper &oOther)
 
std::function< void()> GetCallable ()
 

Private Types

typedef std::shared_ptr< ImplBaseshared_base_type
 

Private Member Functions

template<typename Callable >
std::shared_ptr< Impl< Callable > > MakeCallable (Callable &&pFunc)
 

Static Private Member Functions

static tVoid CallableHelper (shared_base_type pImpl)
 

Private Attributes

shared_base_type m_pCallable
 

Detailed Description

The looper helper class is a managed endless loop, which can be suspended.

Control this loop within one thread while you manage it within another.

Definition at line 20 of file looper.h.

Member Enumeration Documentation

◆ tLoopState

enum tLoopState
strong

Loop state.

Enumerator
Destroyed 

loop is finished or only constructed

Suspended 

loop is suspended

Running 

loop is running

Definition at line 26 of file looper.h.