|
Minecraft Community Edition 0.1.0
|
Lightweight high-level thread wrapper. More...
#include <Thread.hpp>
Public Member Functions | |
| template<typename F> | |
| Thread (QEventBus &qBus, F function) | |
| Construct a Thread from a generic callable (lambda, functor, function pointer). | |
| template<typename C> | |
| Thread (QEventBus &qBus, void(C::*function)(), C *object) | |
| Construct a Thread that will call a parameterless member function. | |
| template<typename C, typename... Args> | |
| Thread (QEventBus &qBus, void(C::*function)(), C *object, Args &&... args) | |
| Construct a Thread that will call a member function with arguments. | |
| ~Thread () | |
| Destructor; cleans up stored callable and implementation pointer. | |
| void | launch () |
| Start execution of the stored callable on a new thread. | |
| void | wait () |
| Block until the thread has finished executing. | |
Friends | |
| class | ThreadImpl |
Lightweight high-level thread wrapper.
Stores a pointer to a platform-specific implementation (ThreadImpl) and a type-erased callable adapter (ThreadFunc) representing the entry point. Use the constructors to create a Thread from lambdas, functors, member functions, or member functions with arguments.
|
inline |
|
inline |
Construct a Thread that will call a parameterless member function.
| C | Class type owning the member function. |
| qBus | Reference to the QEventBus used for thread lifecycle events. |
| function | Pointer to the member function to invoke. |
| object | Pointer to the object instance on which to invoke the member function. |
|
inline |
Construct a Thread that will call a member function with arguments.
| C | Class type owning the member function. |
| Args | Types of the arguments to forward when invoking the member function. |
| qBus | Reference to the QEventBus used for thread lifecycle events. |
| function | Pointer to the member function to invoke. |
| object | Pointer to the object instance on which to invoke the member function. |
| args | Arguments to forward to the member function when the thread runs. |