Apache Ignite C++
Public Types | Public Member Functions | Friends | List of all members
ignite::Future< T > Class Template Reference

Future class template. More...

#include <future.h>

Public Types

typedef T ValueType
 Template value type.
 

Public Member Functions

 Future (const Future< ValueType > &src)
 Copy constructor. More...
 
Futureoperator= (const Future< ValueType > &other)
 Assignment operator. More...
 
void Wait () const
 Wait for value to be set. More...
 
bool WaitFor (int32_t msTimeout) const
 Wait for value to be set for specified time. More...
 
const ValueTypeGetValue () const
 Get the set value. More...
 
void Cancel ()
 Cancel related operation.
 
bool IsReady ()
 Check if the future ready.
 

Friends

class common::Promise< T >
 

Detailed Description

template<typename T>
class ignite::Future< T >

Future class template.

Used to get result of the asynchroniously started computation.

Template Parameters
TFuture value type.

Constructor & Destructor Documentation

◆ Future()

template<typename T >
ignite::Future< T >::Future ( const Future< ValueType > &  src)
inline

Copy constructor.

Parameters
srcInstance to copy.

Member Function Documentation

◆ GetValue()

template<typename T >
const ValueType& ignite::Future< T >::GetValue ( ) const
inline

Get the set value.

Active thread will be blocked until value or error will be set.

Exceptions
IgniteErrorif error has been set.
Returns
Value that has been set on success.

◆ operator=()

template<typename T >
Future& ignite::Future< T >::operator= ( const Future< ValueType > &  other)
inline

Assignment operator.

Parameters
otherOther instance.
Returns
*this.

◆ Wait()

template<typename T >
void ignite::Future< T >::Wait ( ) const
inline

Wait for value to be set.

Active thread will be blocked until value or error will be set.

◆ WaitFor()

template<typename T >
bool ignite::Future< T >::WaitFor ( int32_t  msTimeout) const
inline

Wait for value to be set for specified time.

Active thread will be blocked until value or error will be set or timeout will end.

Parameters
msTimeoutTimeout in milliseconds.
Returns
True if the object has been triggered and false in case of timeout.

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