fw4spl
|
Private implementation of fwThread::Worker using boost::asio. More...
Public Member Functions | |
void | init (int &argc, char **argv, bool guiEnabled=true) |
void | stop () |
Waits for the last task to be processed and stops the loop. | |
void | post (TaskType handler) |
Requests invocation of the given task handler and returns immediately. | |
::fwThread::Worker::FutureType | getFuture () |
Returns a std::shared_future associated with the execution of Worker's loop. More... | |
virtual ::fwThread::ThreadIdType | getThreadId () const |
Returns the worker's thread id. | |
virtual void | processTasks () |
Processes all worker pending tasks for the calling thread until there are no more tasks to process. You can call this function occasionally when your program is busy performing a long operation. More... | |
virtual void | processTasks (PeriodType maxtime) |
Processes worker pending tasks for the calling thread for maxtime milliseconds or until there are no more tasks to process. You can call this function occasionally when your program is busy performing a long operation. More... | |
![]() | |
virtual bool | isA (const std::string &type) const override |
template<typename R , typename CALLABLE > | |
std::shared_future< R > | postTask (CALLABLE f) |
Requests invocation of the given callable and returns a shared future. More... | |
template<typename R , typename TASK > | |
std::shared_future< R > | postTask (TASK f) |
virtual const std::string & | getLeafClassname () const override |
return object's classname without its namespace, i.e. BaseObject | |
virtual const std::string & | getClassname () const override |
return full object's classname with its namespace, i.e. fwCore::BaseObject | |
![]() |
Protected Member Functions | |
std::shared_ptr< ::fwThread::Timer > | createTimer () |
Creates and returns a fwThread::Timer running in this Worker. | |
WorkerQt (const WorkerQt &) | |
Copy constructor forbidden. | |
WorkerQt & | operator= (const WorkerQt &) |
Copy operator forbidden. | |
![]() | |
Worker (const Worker &) | |
Copy constructor forbidden. | |
Worker & | operator= (const Worker &) |
Copy operator forbidden. | |
Protected Attributes | |
int | m_argc |
QSharedPointer< QApplication > | m_app |
::fwThread::ThreadIdType | m_threadId |
![]() | |
FutureType | m_future |
Worker's loop future. | |
Additional Inherited Members | |
![]() | |
typedef ::fwCore::HiResClock::HiResClockType | PeriodType |
typedef std::function< void() > | TaskType |
typedef ::boost::any | ExitReturnType |
typedef std::shared_future< ExitReturnType > | FutureType |
![]() | |
static bool | isTypeOf (const std::string &type) |
static const std::string & | leafClassname () |
return object's classname without its namespace, i.e. BaseObject | |
static const std::string & | classname () |
return object's classname without its namespace, i.e. BaseObject | |
![]() | |
static bool | isTypeOf (const std::string &type) |
static const std::string & | leafClassname () |
return object's classname without its namespace, i.e. BaseObject | |
static const std::string & | classname () |
return object's classname without its namespace, i.e. BaseObject | |
![]() | |
static FWTHREAD_API std::shared_ptr< Worker > | defaultFactory () |
Private implementation of fwThread::Worker using boost::asio.
Definition at line 59 of file WorkerQt.cpp.
|
virtual |
Returns a std::shared_future associated with the execution of Worker's loop.
Reimplemented from fwThread::Worker.
Definition at line 213 of file WorkerQt.cpp.
References SLM_ASSERT.
|
virtual |
Processes all worker pending tasks for the calling thread until there are no more tasks to process. You can call this function occasionally when your program is busy performing a long operation.
Implements fwThread::Worker.
Definition at line 261 of file WorkerQt.cpp.
|
virtual |
Processes worker pending tasks for the calling thread for maxtime milliseconds or until there are no more tasks to process. You can call this function occasionally when your program is busy performing a long operation.
maxtime | milliseconds to process worker pending tasks. |
Implements fwThread::Worker.
Definition at line 268 of file WorkerQt.cpp.