xtd 1.0.0
Loading...
Searching...
No Matches
task_object.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../../object.hpp"
6#include "../../usize.hpp"
7#include <atomic>
8
10namespace xtd {
12 namespace threading {
14 namespace tasks {
28 class task_object : public object {
30 protected:
31 inline static thread_local xtd::usize current_id_ = 0;
32 inline static std::atomic<xtd::usize> last_id_ = 0;
33
34 task_object() = default;
35
36 static auto generate_id() noexcept -> xtd::usize {return last_id_++;}
38 };
39 }
40 }
41}
object()=default
Create a new instance of the ultimate base class object.
Represents an asynchronous operation object.
Definition task_object.hpp:28
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
The xtd::threading::tasks namespace provides types that simplify the work of writing concurrent and a...
Definition basic_task.hpp:32
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::object class.
Contains xtd::usize type.