commons 0.1.5
Header-only C++23 library of common/shared types for the C++ libraries
Loading...
Searching...
No Matches
comms::PrioritizedBuilder< Derived > Class Template Reference

CRTP mixin that makes Derived a Prioritized carrying a mutable priority, with fluent setters returning Derived& for chaining. More...

#include <prioritized.hpp>

Inheritance diagram for comms::PrioritizedBuilder< Derived >:
Collaboration diagram for comms::PrioritizedBuilder< Derived >:

Public Member Functions

int priority () const noexcept override
 This object's priority; lower sorts first. Defaults to DEFAULT_PRIORITY.
 
Derived & priority (const int p) noexcept
 Set the priority. Same-scope overload of the priority() getter above.
 

Additional Inherited Members

- Static Public Attributes inherited from comms::Prioritized
static constexpr int HIGHEST_PRECEDENCE = COMMONS_PRIORITIZED_HIGHEST_PRECEDENCE
 Most-preferred priority (INT_MIN): sorts before everything else.
 
static constexpr int LOWEST_PRECEDENCE = COMMONS_PRIORITIZED_LOWEST_PRECEDENCE
 Least-preferred priority (INT_MAX): sorts after everything else.
 
static constexpr int DEFAULT_PRIORITY = COMMONS_PRIORITIZED_DEFAULT_PRIORITY
 The neutral priority (0) reported when none is set.
 

Detailed Description

template<typename Derived>
class comms::PrioritizedBuilder< Derived >

CRTP mixin that makes Derived a Prioritized carrying a mutable priority, with fluent setters returning Derived& for chaining.

Note
int priority() const (the getter/override) and Derived& priority(int) (the fluent setter) form an overload set in the same class scope, resolved by arity — this is legal, with no name hiding and no using needed, because both are introduced here.

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