DCSModulesAPI  1.0.0
DCS sub project containing all the control modules as libraries.
Public Member Functions | List of all members
DCS::Utils::AsyncItem< T > Class Template Reference

A class that holds possible future data. More...

#include <DCS_ModuleUtils.h>

Public Member Functions

 AsyncItem (std::promise< T > &p)
 
void wait () const
 Wait for item to be available.
 
get () const
 Get the item stored in the future. More...
 

Detailed Description

template<typename T>
class DCS::Utils::AsyncItem< T >

A class that holds possible future data.

To be used as a return type when expected data T is returned async.

Template Parameters
Tthe type to manipulate.

Member Function Documentation

template<typename T >
T DCS::Utils::AsyncItem< T >::get ( ) const
inline

Get the item stored in the future.

If item is not available, it waits until it is.

Returns
T item

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