Handler for asynchronous functions.
More...
#include <VAsync.h>
Handler for asynchronous functions.
◆ ActiveAsyncFunctions()
bool VAsync::ActiveAsyncFunctions |
( |
| ) |
|
- Returns
- If there are any asynchronous functions currently being handled, then the function returns true. Good for preventing certain actions from occuring while other threads are active (like state changes).
◆ LaunchAsyncFunction()
void VAsync::LaunchAsyncFunction |
( |
std::future< void > & |
f | ) |
|
- Parameters
-
f | The std::future object that represents the asynchronous function (i.e. from calling std::async). |
◆ ProcessSyncRequests()
void VAsync::ProcessSyncRequests |
( |
| ) |
|
Called in VGame to process all the sync requests from the SyncQueue.
◆ SyncToMainLoop()
void VAsync::SyncToMainLoop |
( |
std::function< void()> |
callback | ) |
|
Function to tell the game's main thread to sync the current function back to the main one. This function MUST be called at the end of an asynchronous function.
- Parameters
-
callback | A callback function used to respond to the notification that the asynchronous function has finished. |
The documentation for this class was generated from the following file:
- D:/Development/Libs/Vigilante-Game-Framework/VFrame/VAsync.h