WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
wpi::PromiseFactory< void > Class Template Referencefinal

Explicit specialization for PromiseFactory<void>. More...

#include <future.h>

Inheritance diagram for wpi::PromiseFactory< void >:
wpi::detail::PromiseFactoryBase

Public Types

using ThenFunction = std::function< void(uint64_t)>
 

Public Member Functions

future< void > CreateFuture (uint64_t request)
 Creates a future. More...
 
future< void > MakeReadyFuture ()
 Creates a future and makes it immediately ready. More...
 
promise< void > CreatePromise (uint64_t request)
 Creates a promise. More...
 
void SetValue (uint64_t request)
 Sets a value directly for a future without creating a promise object. More...
 
void SetThen (uint64_t request, uint64_t outRequest, ThenFunction func)
 
bool IsReady (uint64_t request) noexcept
 
void GetResult (uint64_t request)
 
void WaitResult (uint64_t request)
 
template<class Clock , class Duration >
bool WaitResultUntil (uint64_t request, const std::chrono::time_point< Clock, Duration > &timeout_time)
 
- Public Member Functions inherited from wpi::detail::PromiseFactoryBase
bool IsActive () const
 
wpi::mutex & GetResultMutex ()
 
void Notify ()
 
void Wait (std::unique_lock< wpi::mutex > &lock)
 
template<class Clock , class Duration >
bool WaitUntil (std::unique_lock< wpi::mutex > &lock, const std::chrono::time_point< Clock, Duration > &timeout_time)
 
void IgnoreResult (uint64_t request)
 
uint64_t CreateRequest ()
 
bool EraseRequest (uint64_t request)
 
uint64_t CreateErasedRequest ()
 

Static Public Member Functions

static PromiseFactoryGetInstance ()
 

Friends

class future< void >
 

Detailed Description

template<>
class wpi::PromiseFactory< void >

Explicit specialization for PromiseFactory<void>.

Member Function Documentation

future< void > wpi::PromiseFactory< void >::CreateFuture ( uint64_t  request)
inline

Creates a future.

Parameters
requestthe request id returned by CreateRequest()
Returns
std::pair of the future and the request id
promise< void > wpi::PromiseFactory< void >::CreatePromise ( uint64_t  request)
inline

Creates a promise.

Parameters
requestthe request id returned by CreateRequest()
Returns
the promise
future<void> wpi::PromiseFactory< void >::MakeReadyFuture ( )

Creates a future and makes it immediately ready.

Returns
the future
void wpi::PromiseFactory< void >::SetValue ( uint64_t  request)

Sets a value directly for a future without creating a promise object.

Identical to promise(factory, request).set_value().

Parameters
requestrequest id, as returned by CreateRequest()

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