|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Policy that limits queue size to a maximum. More...
#include <bound_policies.h>

Public Types | |
| using | policy_tag = bound_policy_tag |
Public Member Functions | |
| constexpr | bounded_policy (std::size_t max) noexcept |
| Construct bounded policy with max size. | |
| constexpr auto | is_full (std::size_t current_size) const noexcept -> bool |
| Check if queue is at capacity. | |
| constexpr auto | max_size () const noexcept -> std::optional< std::size_t > |
| Get maximum size. | |
| constexpr auto | remaining_capacity (std::size_t current_size) const noexcept -> std::size_t |
| Get remaining capacity. | |
| auto | set_max_size (std::size_t new_max) noexcept -> void |
| Set new maximum size. | |
Static Public Member Functions | |
| static constexpr auto | is_bounded () noexcept -> bool |
| Check if this is a bounded policy. | |
Private Attributes | |
| std::size_t | max_size_ |
Policy that limits queue size to a maximum.
This policy enforces a maximum queue size. When the queue is full, enqueue operations may fail or block depending on the overflow policy.
Definition at line 99 of file bound_policies.h.
Definition at line 101 of file bound_policies.h.
|
inlineexplicitconstexprnoexcept |
Construct bounded policy with max size.
| max | Maximum queue size |
Definition at line 107 of file bound_policies.h.
|
inlinestaticnodiscardconstexprnoexcept |
Check if this is a bounded policy.
Definition at line 131 of file bound_policies.h.
|
inlinenodiscardconstexprnoexcept |
Check if queue is at capacity.
| current_size | Current queue size |
Definition at line 115 of file bound_policies.h.
References max_size_.
|
inlinenodiscardconstexprnoexcept |
Get maximum size.
Definition at line 123 of file bound_policies.h.
References max_size_.
|
inlinenodiscardconstexprnoexcept |
Get remaining capacity.
| current_size | Current queue size |
Definition at line 140 of file bound_policies.h.
References max_size_.
|
inlinenoexcept |
Set new maximum size.
| new_max | New maximum size |
Definition at line 154 of file bound_policies.h.
References max_size_.
|
private |
Definition at line 159 of file bound_policies.h.
Referenced by is_full(), max_size(), remaining_capacity(), and set_max_size().