Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
typed_job.h
Go to the documentation of this file.
1// BSD 3-Clause License
2// Copyright (c) 2024, 🍀☀🌕🌥 🌊
3// See the LICENSE file in the project root for full license information.
4
12#pragma once
13
15#include "job_types.h"
16
17namespace kcenon::thread
18{
30 template <typename job_type> class typed_job_t : public job
31 {
32 public:
41 typed_job_t(job_type priority, const std::string& name = "typed_job");
42
48 ~typed_job_t(void) override;
49
55 [[nodiscard]] auto priority() const -> job_type { return priority_; }
56
57 private:
61 job_type priority_;
62 };
63
69
70} // namespace kcenon::thread
71
72// Note: Template implementation moved inline or will be provided by explicit instantiation
Represents a unit of work (task) to be executed, typically by a job queue.
Definition job.h:136
Typed job template.
Definition typed_job.h:31
~typed_job_t(void) override
Destroys the typed_job_t object.
Definition typed_job.cpp:17
typed_job_t(job_type priority, const std::string &name="typed_job")
Constructs a new typed_job_t object with the given priority and name.
Definition typed_job.cpp:10
auto priority() const -> job_type
Retrieves the priority level of this job.
Definition typed_job.h:55
job_type priority_
The priority level assigned to this job.
Definition typed_job.h:61
Job type definitions for the typed thread pool.
Base job class for schedulable work units in the thread system.
Core threading foundation of the thread system library.
Definition thread_impl.h:17