AsyncFw::Thread thread with sockets.
More...
#include <AsyncFw/Thread>
|
| | Thread (const std::string &="Thread") |
| | Constructs a thread.
|
| |
| template<typename M> |
| std::enable_if< std::is_void< typenamestd::invoke_result< M >::type >::value, bool >::type | invokeMethod (M method, bool sync=false) const |
| | Runs a method in a managed thread.
|
| |
| template<typename M> |
| bool | appendPollTask (int fd, PollEvents events, M method) |
| | Append poll task.
|
| |
| template<typename M> |
| int | appendTimerTask (int timeout, M method) |
| | Append timer task.
|
| |
|
virtual bool | running () const |
| | Returns true if the managed thread is running.
|
| |
| virtual bool | invokeTask (AbstractTask *) const |
| | Runs a task in a managed thread.
|
| |
| virtual int | appendTimer (int, AbstractTask *) |
| | Append timer.
|
| |
| virtual bool | modifyTimer (int, int) |
| | Modify timer.
|
| |
| virtual void | removeTimer (int) |
| | Remove timer.
|
| |
| virtual bool | appendPollDescriptor (int, PollEvents, AbstractPollTask *) |
| | Append poll descriptor.
|
| |
| virtual bool | modifyPollDescriptor (int, PollEvents) |
| | Modify poll descriptor.
|
| |
| virtual void | removePollDescriptor (int) |
| | Remove poll descriptor.
|
| |
|
void | start () |
| | Create a managed thread and run exec().
|
| |
|
void | requestInterrupt () |
| | Request the interruption of the thread.
|
| |
|
bool | interruptRequested () const |
| | Returns true if an interrupt is requested.
|
| |
|
void | waitInterrupted () const |
| | Wait for thread interrupted. This means that requestInterrupt() has been called and all queue tasks have completed.
|
| |
|
void | quit () |
| | Tells the thread's exec() to exit.
|
| |
|
void | waitFinished () const |
| | Wait for the thread's exec() function finished.
|
| |
|
int | workLoad () const |
| | Returns the number of tasks in the queue, plus one if there are running task.
|
| |
|
std::thread::id | id () const |
| | Returns unique identifier of managed thread.
|
| |
|
std::string | name () const |
| | Returns name of managed thread.
|
| |
|
LockGuard | lockGuard () const |
| | Locks the managed thread and returns a LockGuard variable. The thread is unblocked after this variable is destroyed.
|
| |
|
| enum | PollEvents : uint16_t {
PollNo = 0
, PollIn = POLLIN_
, PollPri = POLLPRI_
, PollOut = POLLOUT_
,
PollErr = POLLERR_
, PollHup = POLLHUP_
, PollNval = POLLNVAL_
} |
| |
|
using | LockGuard = std::lock_guard<std::mutex> |
| | The LockGuard type.
|
| |
|
using | AbstractTask = AbstractFunction<> |
| | The AbstractTask type.
|
| |
|
using | AbstractPollTask = AbstractFunction<AbstractThread::PollEvents> |
| | The AbstractPollTask type.
|
| |
AsyncFw::Thread thread with sockets.
◆ Thread()
| Thread::Thread |
( |
const std::string & | name = "Thread" | ) |
|
Constructs a thread.
- Parameters
-
◆ startedEvent()
| void Thread::startedEvent |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ finishedEvent()
| void Thread::finishedEvent |
( |
| ) |
|
|
overrideprotectedvirtual |
The documentation for this class was generated from the following files: