DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
DiscordCoreAPI::CoRoutine< ReturnType > Class Template Reference

A CoRoutine - representing a potentially asynchronous operation/function. More...

#include <CoRoutine.hpp>

Inherits DiscordCoreAPI::CoRoutineBase.

Public Member Functions

ReturnType cancel ()
 Cancels the currently executing CoRoutine and returns the current result. More...
 
ReturnType get ()
 Gets the resulting value of the CoRoutine. More...
 
CoRoutineStatus getStatus ()
 Collects the status of the CoRoutine. More...
 

Member Function Documentation

◆ cancel()

template<typename ReturnType >
ReturnType DiscordCoreAPI::CoRoutine< ReturnType >::cancel ( )
inline

Cancels the currently executing CoRoutine and returns the current result.

Returns
ReturnType The return value of the CoRoutine.

Definition at line 194 of file CoRoutine.hpp.

◆ get()

template<typename ReturnType >
ReturnType DiscordCoreAPI::CoRoutine< ReturnType >::get ( )
inline

Gets the resulting value of the CoRoutine.

Returns
ReturnType The return value of the CoRoutine.

Definition at line 172 of file CoRoutine.hpp.

◆ getStatus()

template<typename ReturnType >
CoRoutineStatus DiscordCoreAPI::CoRoutine< ReturnType >::getStatus ( )
inline

Collects the status of the CoRoutine.

Returns
DiscordCoreAPI::CoRoutineStatus The status of the CoRoutine.

Definition at line 159 of file CoRoutine.hpp.


The documentation for this class was generated from the following file: