Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
queue_capabilities_interface.h
Go to the documentation of this file.
1/*
2 * BSD 3-Clause License
3 * Copyright (c) 2025, DongCheol Shin
4 */
5
13#pragma once
14
16
17namespace kcenon::thread {
18
51public:
52 virtual ~queue_capabilities_interface() = default;
53
62 [[nodiscard]] virtual auto get_capabilities() const -> queue_capabilities {
63 return queue_capabilities{}; // Defaults match job_queue
64 }
65
72 [[nodiscard]] auto has_exact_size() const -> bool {
73 return get_capabilities().exact_size;
74 }
75
80 [[nodiscard]] auto has_atomic_empty() const -> bool {
81 return get_capabilities().atomic_empty_check;
82 }
83
91 [[nodiscard]] auto is_lock_free() const -> bool {
92 return get_capabilities().lock_free;
93 }
94
102 [[nodiscard]] auto is_wait_free() const -> bool {
103 return get_capabilities().wait_free;
104 }
105
110 [[nodiscard]] auto supports_batch() const -> bool {
111 return get_capabilities().supports_batch;
112 }
113
118 [[nodiscard]] auto supports_blocking_wait() const -> bool {
119 return get_capabilities().supports_blocking_wait;
120 }
121
126 [[nodiscard]] auto supports_stop() const -> bool {
127 return get_capabilities().supports_stop;
128 }
129};
130
131} // namespace kcenon::thread
Mixin interface for queue capability introspection.
virtual auto get_capabilities() const -> queue_capabilities
Get capabilities of this queue implementation.
auto supports_batch() const -> bool
Check if batch operations are supported.
auto has_exact_size() const -> bool
Check if size() returns exact values.
auto is_lock_free() const -> bool
Check if this is a lock-free implementation.
auto supports_blocking_wait() const -> bool
Check if blocking wait is supported.
auto is_wait_free() const -> bool
Check if this is a wait-free implementation.
auto has_atomic_empty() const -> bool
Check if empty() check is atomic.
auto supports_stop() const -> bool
Check if stop signaling is supported.
Core threading foundation of the thread system library.
Definition thread_impl.h:17
Runtime-queryable queue capabilities descriptor.
Runtime-queryable queue capabilities descriptor.