![]() |
Heart 1.4.918.d927d9c
Heart is base back end library for your c++ Qt projects.
|
The AsyncRenderLoop is a class for asynchronous rendering. This class is used to create a render loop that is executed in a separate thread. To use this class, you must inherit from it and implement the renderIteration method. example: : More...
#include <asyncrenderloop.h>


Classes | |
| class | MainSharedPtr |
| The MainSharedPtr class is a helper class for creating a shared pointer to the render loop. More... | |
Public Member Functions | |
| AsyncRenderLoop (QThread *thread) | |
| ~AsyncRenderLoop () | |
| virtual void | run () |
| run This method starts the render loop. | |
| virtual void | stop () |
| stop This method stops the render loop. | |
| bool | isRun () const |
| isRun This method returns the state of the render loop. | |
| Public Member Functions inherited from QH::Async | |
| bool | asyncLauncher (const Job &job, bool await=false, bool freaze=true) const |
| asyncLauncher This method invoke a job on the thread (using the asyncHandler method) of this object. | |
Static Public Member Functions | |
| template<typename Type, typename... Args> | |
| static MainSharedPtr< Type > | createMainPtr (Args &&...arguments) |
| createMainPtr This method creates a shared pointer to the render loop. | |
Protected Member Functions | |
| virtual void | renderIteration (int mmsec)=0 |
| renderIteration This method is called in each iteration of the render loop. This method must be implemented in the derived class. | |
| Protected Member Functions inherited from QH::Async | |
| Async (QThread *thread) | |
| Async This is default constructor of the async object. | |
| ~Async () | |
| bool | waitFor (bool *condition, int timeout=WAIT_TIME, bool freaze=true) const |
| waitFor This is base wait function. | |
| bool | waitFor (const Job &condition, int timeout=WAIT_TIME, bool freaze=true) const |
| waitFor This is base wait function. | |
Additional Inherited Members | |
| Public Types inherited from QH::Async | |
| using | Job = std::function<bool()> |
The AsyncRenderLoop is a class for asynchronous rendering. This class is used to create a render loop that is executed in a separate thread. To use this class, you must inherit from it and implement the renderIteration method. example: :
Example:
Definition at line 58 of file asyncrenderloop.h.
| QH::AsyncRenderLoop::AsyncRenderLoop | ( | QThread * | thread | ) |
| QH::AsyncRenderLoop::~AsyncRenderLoop | ( | ) |
|
inlinestatic |
createMainPtr This method creates a shared pointer to the render loop.
| Type | type of the render loop object. |
| Args | arguments for the constructor of the render loop object. |
| arguments | arguments for the constructor of the render loop object. |
Definition at line 151 of file asyncrenderloop.h.
| bool QH::AsyncRenderLoop::isRun | ( | ) | const |
isRun This method returns the state of the render loop.
Definition at line 53 of file asyncrenderloop.cpp.

|
protectedpure virtual |
|
virtual |
run This method starts the render loop.
Definition at line 28 of file asyncrenderloop.cpp.

|
virtual |
stop This method stops the render loop.
Definition at line 44 of file asyncrenderloop.cpp.

