PLCnext API Documentation  20.0.0.24462
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | List of all members
Arp::System::Nm::Future< T > Class Template Reference

Future object as proxy for return value an asynchronous function call More...

#include <Future.hpp>

Inheritance diagram for Arp::System::Nm::Future< T >:
Inheritance graph

Public Member Functions

 Future ()
 Constructs an invalid Future More...
 
 Future (const Future &other)=default
 
 Future (Future &&other)=default
 
Futureoperator= (const Future &other)=default
 
Futureoperator= (Future &&other)=default
 
const T GetValue () const
 Returns the value set by the assiciated Promise More...
 
- Public Member Functions inherited from Arp::System::Nm::FutureBase
 FutureBase (const FutureBase &other)=default
 
 FutureBase (FutureBase &&other)=default
 
FutureBaseoperator= (const FutureBase &other)=default
 
FutureBaseoperator= (FutureBase &&other)=default
 
const bool IsValid () const
 Returns true, if this Future has an assiciated Promise More...
 
const bool HasValue () const
 Returns true, if a value or an exception has been set More...
 
const bool HasException () const
 Returns true, if an exception has been set More...
 

Additional Inherited Members

- Protected Member Functions inherited from Arp::System::Nm::FutureBase
void CheckForValueAndException () const
 
template<typename ExceptionType >
void SetException (const ExceptionType &e)
 
void Clear (bool isValid)
 

Detailed Description

template<typename T>
class Arp::System::Nm::Future< T >

Future object as proxy for return value an asynchronous function call

Constructor & Destructor Documentation

◆ Future()

template<typename T >
Arp::System::Nm::Future< T >::Future ( )

Constructs an invalid Future

The default contstructor is intended for Futures to be used as class members. Using copy or move constructors or assignments a class member can linked with a Promise.

Member Function Documentation

◆ GetValue()

template<typename T >
const T Arp::System::Nm::Future< T >::GetValue ( void  ) const

Returns the value set by the assiciated Promise

This function may throws an exception if not value has been set. Use HasValue() to check it. If an exception was set by the Promise the exception is rethrown here.


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