swift
Public Member Functions | List of all members
swift::misc::CEventLoop Class Reference

Utility class which blocks until a signal is emitted or timeout reached. More...

Public Member Functions

 CEventLoop ()
 Constructor.
 
 CEventLoop (QObject *guard)
 Constructor. Guard object must exist, and will be checked again when the loop quits.
 
template<typename T , typename F >
void stopWhen (const T *sender, F signal)
 Event loop will stop if the given signal is received.
 
template<typename T , typename F1 , typename F2 >
void stopWhen (const T *sender, F1 signal, F2 &&condition)
 Event loop will stop if the given signal is received and condition returns true.
 
bool exec (int timeoutMs)
 Begin processing events until the timeout or stop condition occurs. More...
 
bool isGuardAlive () const
 True if the guard object still exists.
 

Detailed Description

Utility class which blocks until a signal is emitted or timeout reached.

Definition at line 19 of file eventloop.h.

Member Function Documentation

◆ exec()

bool swift::misc::CEventLoop::exec ( int  timeoutMs)
inline

Begin processing events until the timeout or stop condition occurs.

Returns
True if the signal was received, false if it timed out or the guard object died.

Definition at line 51 of file eventloop.h.


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