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

Chains multiple FlushPolicy objects together. More...

#include <FlushPolicies.hpp>

Public Types

using Algorithm_t = TAlgorithm
 

Public Member Functions

constexpr FlushPolicyChain (TFlushPolicies ... policies) noexcept(std::is_nothrow_constructible_v< Algorithm_t > &&(std::is_nothrow_move_constructible_v< TFlushPolicies > &&...))
 Constructor. More...
 
constexpr FlushPolicyChain (TAlgorithm algorithm, TFlushPolicies ... policies) noexcept(std::is_nothrow_move_constructible_v< Algorithm_t > &&(std::is_nothrow_move_constructible_v< TFlushPolicies > &&...))
 Constructor overload. More...
 
template<Record TRecord>
bool operator() (const TRecord &record, std::size_t messageByteSize)
 Invoke operator. More...
 
constexpr void flushed ()
 Calls flushed on all FlushPolicy objects. More...
 
constexpr bool empty () const noexcept
 Returns whether the are no FlushPolicy objects attached. More...
 
constexpr std::size_t size () const noexcept
 Obtains the amount of attached FlushPolicy objects. More...
 

Detailed Description

template<class TAlgorithm, class... TFlushPolicies>
class sl::log::FlushPolicyChain< TAlgorithm, TFlushPolicies >

Chains multiple FlushPolicy objects together.

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

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

Member Typedef Documentation

◆ Algorithm_t

template<class TAlgorithm , class... TFlushPolicies>
using sl::log::FlushPolicyChain< TAlgorithm, TFlushPolicies >::Algorithm_t = TAlgorithm

Constructor & Destructor Documentation

◆ FlushPolicyChain() [1/2]

template<class TAlgorithm , class... TFlushPolicies>
constexpr sl::log::FlushPolicyChain< TAlgorithm, TFlushPolicies >::FlushPolicyChain ( TFlushPolicies ...  policies)
inlineexplicitconstexprnoexcept

Constructor.

Parameters
policiesFlushPolicy objects

◆ FlushPolicyChain() [2/2]

template<class TAlgorithm , class... TFlushPolicies>
constexpr sl::log::FlushPolicyChain< TAlgorithm, TFlushPolicies >::FlushPolicyChain ( TAlgorithm  algorithm,
TFlushPolicies ...  policies 
)
inlineexplicitconstexprnoexcept

Constructor overload.

Parameters
algorithmAlgorithm object
policiesFlushPolicy objects

Member Function Documentation

◆ empty()

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

Returns whether the are no FlushPolicy objects attached.

Returns
true if there aren't have any FlushPolicy objects attached.

◆ flushed()

template<class TAlgorithm , class... TFlushPolicies>
constexpr void sl::log::FlushPolicyChain< TAlgorithm, TFlushPolicies >::flushed ( )
inlineconstexpr

Calls flushed on all FlushPolicy objects.

◆ operator()()

template<class TAlgorithm , class... TFlushPolicies>
template<Record TRecord>
bool sl::log::FlushPolicyChain< TAlgorithm, TFlushPolicies >::operator() ( const TRecord &  record,
std::size_t  messageByteSize 
)
inline

Invoke operator.

Template Parameters
TRecordUsed Record type
Parameters
recordThe current handled Record object
messageByteSizeThe size of the current handled message in bytes
Returns
Returns the result of the predicate invocation

Just invokes all internal policies and returns the result of the algorithm

◆ size()

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

Obtains the amount of attached FlushPolicy objects.

Returns
The amount of attached FlushPolicy objects

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