Simple-Log  alpha-v0.7
sl::log::ByteCountFlushPolicy Class Reference

A Flush-Policy which acts on accumulated byte count. More...

#include <FlushPolicies.hpp>

Public Member Functions

 ByteCountFlushPolicy (std::size_t byteThreshold) noexcept
 Constructor. More...
 
template<Record TRecord>
bool operator() (const TRecord &record, std::size_t messageByteSize) noexcept
 Invoke operator. More...
 
void flushed () noexcept
 Resets the internal byte counter. More...
 

Detailed Description

A Flush-Policy which acts on accumulated byte count.

Instances of this class will return true if their given byte threshold has been exceeded.

Constructor & Destructor Documentation

◆ ByteCountFlushPolicy()

sl::log::ByteCountFlushPolicy::ByteCountFlushPolicy ( std::size_t  byteThreshold)
inlineexplicitnoexcept

Constructor.

Parameters
byteThresholdThreshold size in bytes

Member Function Documentation

◆ flushed()

void sl::log::ByteCountFlushPolicy::flushed ( )
inlinenoexcept

Resets the internal byte counter.

◆ operator()()

template<Record TRecord>
bool sl::log::ByteCountFlushPolicy::operator() ( const TRecord &  record,
std::size_t  messageByteSize 
)
inlinenoexcept

Invoke operator.

Template Parameters
TRecordUsed Record type
Parameters
recordThe current handled Record object
messageByteSizeThe size of the current handled message in bytes
Returns
Returns true if the byte threshold has been exceeded.

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