xtd 0.2.0
Loading...
Searching...
No Matches
itask.hpp
Go to the documentation of this file.
1
5#include "../../int32.hpp"
6#include "../../interface.hpp"
7#include "../../time_span.hpp"
8
10namespace xtd {
12 namespace threading {
14 namespace tasks {
20 public:
22
26 [[nodiscard]] virtual auto id() const noexcept -> xtd::size = 0;
28
30
33 virtual auto start() -> void = 0;
34
36 virtual auto wait() -> void = 0;
40 virtual auto wait(xtd::int32 milliseconds_timeout) -> bool = 0;
44 virtual auto wait(xtd::int32 milliseconds_timeout, xtd::threading::cancellation_token& cancellation_token) -> bool = 0;
48 virtual auto wait(const xtd::time_span& timeout) -> bool = 0;
54 };
55 }
56 }
57}
Contains xtd::threading::cancellation_token class.
Propagates notification that operations should be canceled.
Definition cancellation_token.hpp:39
Represents an interface for an asynchronous operation.
Definition itask.hpp:19
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 id() const noexcept -> xtd::size=0
Gets an ID for this task instance.
Contains a constant used to specify an infinite amount of time. This class cannot be inherited.
Definition timeout.hpp:33
Represents a time interval.
Definition time_span.hpp:29
#define interface_
This keyword is use to represent an interface.
Definition interface.hpp:58
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
Contains xtd::int32 type.
Contains xtd::interface interface.
The xtd::threading::tasks namespace provides types that simplify the work of writing concurrent and a...
Definition itask.hpp:14
The xtd::threading namespace provides classes and interfaces that enable multithreaded programming....
Definition abandoned_mutex_exception.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::time_span class.