xtd 0.2.0
Loading...
Searching...
No Matches
xtd::threading::tasks::itask Class Referenceabstract
Inheritance diagram for xtd::threading::tasks::itask:
xtd::interface

Definition

Represents an interface for an asynchronous operation.

Library
xtd.core

Public Properties

virtual auto id () const noexcept -> xtd::size=0
 Gets an ID for this task instance.
 

Public Methods

virtual auto start () -> void=0
 Starts the task, scheduling it for execution to the current xtd::threading::tasks::task_scheduler.
 
virtual auto wait () -> void=0
 Waits for the task to complete execution.
 
virtual auto wait (xtd::int32 milliseconds_timeout) -> bool=0
 Waits for the task to complete execution with specified milliseconds timout.
 
virtual auto wait (xtd::int32 milliseconds_timeout, xtd::threading::cancellation_token &cancellation_token) -> bool=0
 Waits for the task to complete execution with specified milliseconds timout and cancellation token.
 
virtual auto wait (const xtd::time_span &timeout) -> bool=0
 Waits for the task to complete execution with specified timout.
 
virtual auto wait (const xtd::time_span &timeout, xtd::threading::cancellation_token &cancellation_token) -> bool=0
 Waits for the task to complete execution with specified timout and cancellation token.
 

Member Function Documentation

◆ id()

virtual auto xtd::threading::tasks::itask::id ( ) const -> xtd::size
nodiscardpure virtualnoexcept

Gets an ID for this task instance.

Returns
The identifier that is assigned by the system to this task instance.

◆ start()

virtual auto xtd::threading::tasks::itask::start ( ) -> void
pure virtual

Starts the task, scheduling it for execution to the current xtd::threading::tasks::task_scheduler.

◆ wait() [1/5]

virtual auto xtd::threading::tasks::itask::wait ( ) -> void
pure virtual

Waits for the task to complete execution.

◆ wait() [2/5]

virtual auto xtd::threading::tasks::itask::wait ( xtd::int32 milliseconds_timeout) -> bool
pure virtual

Waits for the task to complete execution with specified milliseconds timout.

Parameters
milliseconds_timeoutThe number of milliseconds to wait, or xtd::threading::timeout::infinite (-1) to wait indefinitely.
Returns
true if the task completed execution within the allotted time; otherwise, false.

◆ wait() [3/5]

virtual auto xtd::threading::tasks::itask::wait ( xtd::int32 milliseconds_timeout,
xtd::threading::cancellation_token & cancellation_token ) -> bool
pure virtual

Waits for the task to complete execution with specified milliseconds timout and cancellation token.

Parameters
milliseconds_timeoutThe number of milliseconds to wait, or xtd::threading::timeout::infinite (-1) to wait indefinitely.
Returns
true if the task completed execution within the allotted time; otherwise, false.

◆ wait() [4/5]

virtual auto xtd::threading::tasks::itask::wait ( const xtd::time_span & timeout) -> bool
pure virtual

Waits for the task to complete execution with specified timout.

Parameters
timeoutA xtd::time_span that represents the number of milliseconds to wait, or a xtd::threading::timeout::infinite_time_span that represents -1 milliseconds to wait indefinitely.
Returns
true if the task completed execution within the allotted time; otherwise, false.

◆ wait() [5/5]

virtual auto xtd::threading::tasks::itask::wait ( const xtd::time_span & timeout,
xtd::threading::cancellation_token & cancellation_token ) -> bool
pure virtual

Waits for the task to complete execution with specified timout and cancellation token.

Parameters
timeoutA xtd::time_span that represents the number of milliseconds to wait, or a xtd::threading::timeout::infinite_time_span that represents -1 milliseconds to wait indefinitely.
Returns
true if the task completed execution within the allotted time; otherwise, false.

The documentation for this class was generated from the following file:
  • xtd.core/include/xtd/threading/tasks/itask.hpp