Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
kcenon::thread::policies::unbounded_policy Class Reference

Policy that allows unlimited queue size. More...

#include <bound_policies.h>

Collaboration diagram for kcenon::thread::policies::unbounded_policy:
Collaboration graph

Public Types

using policy_tag = bound_policy_tag
 

Public Member Functions

constexpr unbounded_policy () noexcept=default
 Construct unbounded policy.
 
constexpr auto is_full (std::size_t) 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) const noexcept -> std::size_t
 Get remaining capacity.
 

Static Public Member Functions

static constexpr auto is_bounded () noexcept -> bool
 Check if this is a bounded policy.
 

Detailed Description

Policy that allows unlimited queue size.

This policy does not impose any size limits on the queue. Memory is the only constraint on queue capacity.

Usage

// Queue can grow indefinitely
Policy-based queue template.

Definition at line 38 of file bound_policies.h.

Member Typedef Documentation

◆ policy_tag

Constructor & Destructor Documentation

◆ unbounded_policy()

kcenon::thread::policies::unbounded_policy::unbounded_policy ( )
constexprdefaultnoexcept

Construct unbounded policy.

Member Function Documentation

◆ is_bounded()

static constexpr auto kcenon::thread::policies::unbounded_policy::is_bounded ( ) -> bool
inlinestaticnodiscardconstexprnoexcept

Check if this is a bounded policy.

Returns
false

Definition at line 68 of file bound_policies.h.

68 {
69 return false;
70 }

◆ is_full()

auto kcenon::thread::policies::unbounded_policy::is_full ( std::size_t ) const -> bool
inlinenodiscardconstexprnoexcept

Check if queue is at capacity.

Parameters
current_sizeCurrent queue size
Returns
Always false (never at capacity)

Definition at line 52 of file bound_policies.h.

52 {
53 return false;
54 }

◆ max_size()

auto kcenon::thread::policies::unbounded_policy::max_size ( ) const -> std::optional<std::size_t>
inlinenodiscardconstexprnoexcept

Get maximum size.

Returns
nullopt (no limit)

Definition at line 60 of file bound_policies.h.

60 {
61 return std::nullopt;
62 }

◆ remaining_capacity()

auto kcenon::thread::policies::unbounded_policy::remaining_capacity ( std::size_t ) const -> std::size_t
inlinenodiscardconstexprnoexcept

Get remaining capacity.

Parameters
current_sizeCurrent queue size (ignored)
Returns
Maximum size_t value

Definition at line 77 of file bound_policies.h.

77 {
78 return std::numeric_limits<std::size_t>::max();
79 }

The documentation for this class was generated from the following file: