ThreadSchedule 4.1.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::detail::query_facade_mixin< Derived > Class Template Reference

CRTP mixin that provides functional-style query facade methods. More...

#include <query_facade_mixin.hpp>

Inheritance diagram for threadschedule::detail::query_facade_mixin< Derived >:
[legend]

Public Member Functions

template<typename Predicate>
auto filter (Predicate &&pred) const
auto count () const -> size_t
auto empty () const -> bool
template<typename Fn>
void for_each (Fn &&fn) const
template<typename Predicate, typename Fn>
void apply (Predicate &&pred, Fn &&fn) const
template<typename Fn>
auto map (Fn &&fn) const -> std::vector< std::invoke_result_t< Fn, registered_thread_info_backend const & > >
template<typename Predicate>
auto find_if (Predicate &&pred) const -> std::optional< registered_thread_info_backend >
template<typename Predicate>
auto any (Predicate &&pred) const -> bool
template<typename Predicate>
auto all (Predicate &&pred) const -> bool
template<typename Predicate>
auto none (Predicate &&pred) const -> bool
auto take (size_t n) const
auto skip (size_t n) const

Detailed Description

template<typename Derived>
class threadschedule::detail::query_facade_mixin< Derived >

CRTP mixin that provides functional-style query facade methods.

The derived class must implement a public query() method returning a query_view-like object. All facade methods (filter, map, for_each, find_if, any, all, none, take, skip, count, empty, apply) delegate to it.

Return types are deduced via auto so the mixin can be used as a base class before the concrete query_view type is fully defined (CRTP).

Template Parameters
DerivedCRTP derived type.

Definition at line 31 of file query_facade_mixin.hpp.

Member Function Documentation

◆ all()

template<typename Derived>
template<typename Predicate>
auto threadschedule::detail::query_facade_mixin< Derived >::all ( Predicate && pred) const->bool
inlinenodiscard

Definition at line 96 of file query_facade_mixin.hpp.

◆ any()

template<typename Derived>
template<typename Predicate>
auto threadschedule::detail::query_facade_mixin< Derived >::any ( Predicate && pred) const->bool
inlinenodiscard

Definition at line 89 of file query_facade_mixin.hpp.

◆ apply()

template<typename Derived>
template<typename Predicate, typename Fn>
void threadschedule::detail::query_facade_mixin< Derived >::apply ( Predicate && pred,
Fn && fn ) const
inline

Definition at line 68 of file query_facade_mixin.hpp.

◆ count()

template<typename Derived>
auto threadschedule::detail::query_facade_mixin< Derived >::count ( ) const->size_t
inlinenodiscard

Definition at line 48 of file query_facade_mixin.hpp.

◆ empty()

template<typename Derived>
auto threadschedule::detail::query_facade_mixin< Derived >::empty ( ) const->bool
inlinenodiscard

Definition at line 54 of file query_facade_mixin.hpp.

◆ filter()

template<typename Derived>
template<typename Predicate>
auto threadschedule::detail::query_facade_mixin< Derived >::filter ( Predicate && pred) const
inlinenodiscard

Definition at line 42 of file query_facade_mixin.hpp.

◆ find_if()

template<typename Derived>
template<typename Predicate>
auto threadschedule::detail::query_facade_mixin< Derived >::find_if ( Predicate && pred) const->std::optional< registered_thread_info_backend >
inlinenodiscard

Definition at line 82 of file query_facade_mixin.hpp.

◆ for_each()

template<typename Derived>
template<typename Fn>
void threadschedule::detail::query_facade_mixin< Derived >::for_each ( Fn && fn) const
inline

Definition at line 61 of file query_facade_mixin.hpp.

◆ map()

template<typename Derived>
template<typename Fn>
auto threadschedule::detail::query_facade_mixin< Derived >::map ( Fn && fn) const->std::vector< std::invoke_result_t< Fn, registered_thread_info_backendconst & > >
inlinenodiscard

Definition at line 75 of file query_facade_mixin.hpp.

◆ none()

template<typename Derived>
template<typename Predicate>
auto threadschedule::detail::query_facade_mixin< Derived >::none ( Predicate && pred) const->bool
inlinenodiscard

Definition at line 103 of file query_facade_mixin.hpp.

◆ skip()

template<typename Derived>
auto threadschedule::detail::query_facade_mixin< Derived >::skip ( size_t n) const
inlinenodiscard

Definition at line 115 of file query_facade_mixin.hpp.

◆ take()

template<typename Derived>
auto threadschedule::detail::query_facade_mixin< Derived >::take ( size_t n) const
inlinenodiscard

Definition at line 109 of file query_facade_mixin.hpp.


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