WPILibC++ 2024.3.2
wpi::PromiseFactory< void > Class Referencefinal

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

#include <wpi/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
 ~PromiseFactoryBase ()
 
bool IsActive () const
 
wpi::mutexGetResultMutex ()
 
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

Explicit specialization for PromiseFactory<void>.

Member Typedef Documentation

◆ ThenFunction

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

Member Function Documentation

◆ CreateFuture()

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

◆ CreatePromise()

promise< void > wpi::PromiseFactory< void >::CreatePromise ( uint64_t  request)
inline

Creates a promise.

Parameters
requestthe request id returned by CreateRequest()
Returns
the promise

◆ GetInstance()

static PromiseFactory & wpi::PromiseFactory< void >::GetInstance ( )
static

◆ GetResult()

void wpi::PromiseFactory< void >::GetResult ( uint64_t  request)

◆ IsReady()

bool wpi::PromiseFactory< void >::IsReady ( uint64_t  request)
noexcept

◆ MakeReadyFuture()

future< void > wpi::PromiseFactory< void >::MakeReadyFuture ( )

Creates a future and makes it immediately ready.

Returns
the future

◆ SetThen()

void wpi::PromiseFactory< void >::SetThen ( uint64_t  request,
uint64_t  outRequest,
ThenFunction  func 
)

◆ SetValue()

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()

◆ WaitResult()

void wpi::PromiseFactory< void >::WaitResult ( uint64_t  request)

◆ WaitResultUntil()

template<class Clock , class Duration >
bool wpi::PromiseFactory< void >::WaitResultUntil ( uint64_t  request,
const std::chrono::time_point< Clock, Duration > &  timeout_time 
)

Friends And Related Function Documentation

◆ future< void >

friend class future< void >
friend

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