Simple-Log  alpha-v0.7
sl::log::FilterChain< TAlgorithm, TFilter > Class Template Reference

Chains multiple filter together. More...

#include <Filters.hpp>

Public Types

using Algorithm_t = std::remove_cvref_t< TAlgorithm >
 

Public Member Functions

constexpr FilterChain (TFilter ...filter) noexcept(std::is_nothrow_constructible_v< Algorithm_t > &&(std::is_nothrow_move_constructible_v< TFilter > &&...))
 Constructor. More...
 
constexpr FilterChain (TAlgorithm algorithm, TFilter ...filter) noexcept(std::is_nothrow_move_constructible_v< Algorithm_t > &&(std::is_nothrow_move_constructible_v< TFilter > &&...))
 Constructor overload. More...
 
template<Record TRecord>
constexpr bool operator() (const TRecord &rec)
 Call-operator. More...
 
constexpr bool empty () const noexcept
 Returns whether the are no sub-filters attached. More...
 
constexpr std::size_t size () const noexcept
 Obtains the amount of attached sub-filters. More...
 

Detailed Description

template<class TAlgorithm, class... TFilter>
class sl::log::FilterChain< TAlgorithm, TFilter >

Chains multiple filter together.

Template Parameters
TAlgorithmThe used algorithm, which will determine how each invoke result will be treated.
TFilterType of provided filter objects

This class simply calls each provided filter successively. The provided algorithm will determine, how each invocation result will be treated.

Member Typedef Documentation

◆ Algorithm_t

template<class TAlgorithm , class... TFilter>
using sl::log::FilterChain< TAlgorithm, TFilter >::Algorithm_t = std::remove_cvref_t<TAlgorithm>

Constructor & Destructor Documentation

◆ FilterChain() [1/2]

template<class TAlgorithm , class... TFilter>
constexpr sl::log::FilterChain< TAlgorithm, TFilter >::FilterChain ( TFilter ...  filter)
inlineexplicitconstexprnoexcept

Constructor.

Parameters
filterFilter objects

◆ FilterChain() [2/2]

template<class TAlgorithm , class... TFilter>
constexpr sl::log::FilterChain< TAlgorithm, TFilter >::FilterChain ( TAlgorithm  algorithm,
TFilter ...  filter 
)
inlineexplicitconstexprnoexcept

Constructor overload.

Parameters
algorithmAlgorithm object
filterFilter objects

Member Function Documentation

◆ empty()

template<class TAlgorithm , class... TFilter>
constexpr bool sl::log::FilterChain< TAlgorithm, TFilter >::empty ( ) const
inlineconstexprnoexcept

Returns whether the are no sub-filters attached.

Returns
true if there aren't have any sub-filters attached.

◆ operator()()

template<class TAlgorithm , class... TFilter>
template<Record TRecord>
constexpr bool sl::log::FilterChain< TAlgorithm, TFilter >::operator() ( const TRecord &  rec)
inlineconstexpr

Call-operator.

Template Parameters
TRecordConcrete type of the used Record object
Parameters
recRecord object
Returns
Returns true, if the Record should be handled. False if skipped.

◆ size()

template<class TAlgorithm , class... TFilter>
constexpr std::size_t sl::log::FilterChain< TAlgorithm, TFilter >::size ( ) const
inlineconstexprnoexcept

Obtains the amount of attached sub-filters.

Returns
The amount of attached sub-filters

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