Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
Antares::Concurrency::FutureSet Class Reference

Utility class to gather futures to wait for. More...

#include <concurrency.h>

Public Member Functions

 FutureSet (const FutureSet &)=delete
 
FutureSetoperator= (const FutureSet &)=delete
 
 FutureSet (FutureSet &&)=delete
 
FutureSetoperator= (FutureSet &&)=delete
 
void add (TaskFuture &&f)
 Adds one future to be monitored by this set.
 
void join ()
 Waits for completion of all added futures.
 

Detailed Description

Utility class to gather futures to wait for.

Member Function Documentation

◆ add()

void Antares::Concurrency::FutureSet::add ( TaskFuture && f)

Adds one future to be monitored by this set.

Note: the provided future will be left in "moved from" state.

◆ join()

void Antares::Concurrency::FutureSet::join ( )

Waits for completion of all added futures.

If one of the future ends on exception, re-throws the first encountered exception. Note that futures cannot be added while some thread is waiting for completion.

Joining also resets the list of tasks to wait for.


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