CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
System::Threading::Tasks Namespace Reference

Classes

class  ResultTask
 A Task specialization that returns a result value upon completion. More...
 
class  Task
 Represents an asynchronous operation that can be awaited and composed with other tasks. More...
 
class  TaskScheduler
 Represents an object that handles the low-level work of queuing tasks onto threads. More...
 

Enumerations

enum class  TaskStatus {
  Created = 0 , WaitingForActivation = 1 , WaitingToRun = 2 , Running = 3 ,
  WaitingForChildrenToComplete = 4 , RanToCompletion = 5 , Canceled = 6 , Faulted = 7
}
 

Functions

void DispatchCurrentContext ()
 Dispatches all tasks bound to this thread synchronously. More...
 
TaskPtr Delay (int32_t millisecondsDelay)
 Creates a task that completes after a time delay. More...
 
TaskPtr Delay (int32_t millisecondsDelay, const CancellationToken &cancellationToken)
 
TaskPtr FromException (const Exception &exception)
 
template<typename TResult >
RTaskPtr< TResult > FromException (const Exception &exception)
 
template<typename TResult >
RTaskPtr< TResult > FromResult (TResult result)
 
TaskPtr Run (const Action<> &action)
 
TaskPtr Run (const Action<> &action, const CancellationToken &cancellationToken)
 
template<typename TResult >
RTaskPtr< TResult > Run (const Func< TResult > &function)
 
TaskPtr WhenAll (const ArrayPtr< TaskPtr > &tasks)
 
TaskPtr WhenAll (const SharedPtr< Collections::Generic::IEnumerable< TaskPtr > > &tasks)
 
template<typename T >
RTaskPtr< ArrayPtr< T > > WhenAll (SharedPtr< Collections::Generic::IEnumerable< RTaskPtr< T > > > tasks)
 
template<typename T >
RTaskPtr< ArrayPtr< T > > WhenAll (ArrayPtr< RTaskPtr< T > > tasks)
 

Enumeration Type Documentation

◆ TaskStatus

Enumerator
Created 
WaitingForActivation 
WaitingToRun 
Running 
WaitingForChildrenToComplete 
RanToCompletion 
Canceled 
Faulted 

Function Documentation

◆ Delay() [1/2]

TaskPtr System::Threading::Tasks::Delay ( int32_t  millisecondsDelay)

Creates a task that completes after a time delay.

Parameters
millisecondsDelayThe number of milliseconds to wait before completing the returned task, or -1 to wait indefinitely.
Returns
A task that represents the time delay.
Exceptions
System.ArgumentOutOfRangeExceptionif the millisecondsDelay argument is less than -1.

◆ Delay() [2/2]

TaskPtr System::Threading::Tasks::Delay ( int32_t  millisecondsDelay,
const CancellationToken cancellationToken 
)

◆ DispatchCurrentContext()

void System::Threading::Tasks::DispatchCurrentContext ( )

Dispatches all tasks bound to this thread synchronously.

◆ FromException() [1/2]

TaskPtr System::Threading::Tasks::FromException ( const Exception exception)

◆ FromException() [2/2]

template<typename TResult >
RTaskPtr< TResult > System::Threading::Tasks::FromException ( const Exception exception)

◆ FromResult()

template<typename TResult >
RTaskPtr< TResult > System::Threading::Tasks::FromResult ( TResult  result)

◆ Run() [1/3]

TaskPtr System::Threading::Tasks::Run ( const Action<> &  action)

◆ Run() [2/3]

TaskPtr System::Threading::Tasks::Run ( const Action<> &  action,
const CancellationToken cancellationToken 
)

◆ Run() [3/3]

template<typename TResult >
RTaskPtr< TResult > System::Threading::Tasks::Run ( const Func< TResult > &  function)

◆ WhenAll() [1/4]

template<typename T >
RTaskPtr< ArrayPtr< T > > System::Threading::Tasks::WhenAll ( ArrayPtr< RTaskPtr< T > >  tasks)

◆ WhenAll() [2/4]

TaskPtr System::Threading::Tasks::WhenAll ( const ArrayPtr< TaskPtr > &  tasks)

◆ WhenAll() [3/4]

TaskPtr System::Threading::Tasks::WhenAll ( const SharedPtr< Collections::Generic::IEnumerable< TaskPtr > > &  tasks)

◆ WhenAll() [4/4]

template<typename T >
RTaskPtr< ArrayPtr< T > > System::Threading::Tasks::WhenAll ( SharedPtr< Collections::Generic::IEnumerable< RTaskPtr< T > > >  tasks)