|
Simple-Log
alpha-v0.7
|
A Flush-Policy which acts on a durations. More...
#include <FlushPolicies.hpp>
Public Types | |
| using | Duration_t = std::chrono::milliseconds |
| using | Clock_t = std::chrono::steady_clock |
| using | TimePoint_t = Clock_t::time_point |
Public Member Functions | |
| template<class TRep , class TPeriod > | |
| TimedFlushPolicy (std::chrono::duration< TRep, TPeriod > duration) | |
| Constructs the object with the specified duration threshold. More... | |
| template<Record TRecord> | |
| bool | operator() (const TRecord &record, std::size_t messageByteSize) noexcept |
| Invoke operator. More... | |
| void | flushed () noexcept |
| Restarts the internal duration clock. More... | |
A Flush-Policy which acts on a durations.
Instances of this class will return true if their given duration has been exceeded. This class uses durations based on milliseconds, thus any provided duration will be casted to that.
| using sl::log::TimedFlushPolicy::Clock_t = std::chrono::steady_clock |
| using sl::log::TimedFlushPolicy::Duration_t = std::chrono::milliseconds |
| using sl::log::TimedFlushPolicy::TimePoint_t = Clock_t::time_point |
|
inlineexplicit |
Constructs the object with the specified duration threshold.
| TRep | An arithmetic type representing the number of ticks |
| TPeriod | Period type |
| duration | The duration threshold. |
Any provided duration will be casted to milliseconds, thus finer thresholds will be lost.
|
inlinenoexcept |
Restarts the internal duration clock.
|
inlinenoexcept |
Invoke operator.
| TRecord | Used Record type |
| record | The current handled Record object |
| messageByteSize | The size of the current handled message in bytes |