|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Policy with dynamically adjustable size limit. More...
#include <bound_policies.h>

Public Types | |
| using | policy_tag = bound_policy_tag |
Public Member Functions | |
| constexpr | dynamic_bounded_policy (std::optional< std::size_t > max=std::nullopt) noexcept |
| Construct with optional 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 | is_bounded () const noexcept -> bool |
| Check if this is currently bounded. | |
| 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. | |
| auto | set_unbounded () noexcept -> void |
| Remove size limit (become unbounded) | |
Private Attributes | |
| std::optional< std::size_t > | max_size_ |
Policy with dynamically adjustable size limit.
Similar to bounded_policy but allows runtime changes to the limit and can be switched to unbounded mode.
Definition at line 177 of file bound_policies.h.
Definition at line 179 of file bound_policies.h.
|
inlineexplicitconstexprnoexcept |
Construct with optional max size.
| max | Optional maximum size (nullopt for unbounded) |
Definition at line 185 of file bound_policies.h.
|
inlinenodiscardconstexprnoexcept |
Check if this is currently bounded.
Definition at line 213 of file bound_policies.h.
References max_size_.
|
inlinenodiscardconstexprnoexcept |
Check if queue is at capacity.
| current_size | Current queue size |
Definition at line 194 of file bound_policies.h.
References max_size_.
|
inlinenodiscardconstexprnoexcept |
Get maximum size.
Definition at line 205 of file bound_policies.h.
References max_size_.
|
inlinenodiscardconstexprnoexcept |
Get remaining capacity.
| current_size | Current queue size |
Definition at line 222 of file bound_policies.h.
References max_size_.
|
inlinenoexcept |
Set new maximum size.
| new_max | New maximum size |
Definition at line 236 of file bound_policies.h.
References max_size_.
|
inlinenoexcept |
Remove size limit (become unbounded)
Definition at line 243 of file bound_policies.h.
References max_size_.
|
private |
Definition at line 248 of file bound_policies.h.
Referenced by is_bounded(), is_full(), max_size(), remaining_capacity(), set_max_size(), and set_unbounded().