Agents 0.0.2
Edge AI Agents SDK
Loading...
Searching...
No Matches
agents::Task< T > Class Template Reference

Provide a future-based fallback for Task. More...

#include <coroutine_utils.h>

Public Member Functions

 Task (std::function< std::future< T >()> func)
 Constructor.
 
std::future< T > get_future ()
 Get the future.
 

Detailed Description

template<typename T>
class agents::Task< T >

Provide a future-based fallback for Task.

Template Parameters
TThe type of the result of the task
Examples
coroutine_example.cpp, and simple_agent.cpp.

Constructor & Destructor Documentation

◆ Task()

template<typename T>
agents::Task< T >::Task ( std::function< std::future< T >()> func)
inline

Constructor.

Parameters
funcThe function to get the future

Constructor

Member Function Documentation

◆ get_future()

template<typename T>
std::future< T > agents::Task< T >::get_future ( )
inline

Get the future.

Returns
The future