ReduxLib C++ 2025.0.0-beta2
Loading...
Searching...
No Matches
redux::canand::CooldownWarning Class Reference

#include <CooldownWarning.h>

Public Types

using size_type = std::vector< units::second_t >::size_type
 

Public Member Functions

 CooldownWarning (units::second_t threshold, size_type cnt)
 
bool feed ()
 

Detailed Description

Class that yells at the user if feed is called too often in too short a succession.

Typically used to help prevent obliterating flash.

Member Typedef Documentation

◆ size_type

using redux::canand::CooldownWarning::size_type = std::vector<units::second_t>::size_type

Alias for std::vector's size_type.

Constructor & Destructor Documentation

◆ CooldownWarning()

redux::canand::CooldownWarning::CooldownWarning ( units::second_t  threshold,
size_type  cnt 
)
inline

Constructor.

Parameters
thresholdMaximum number of seconds that need to pass between the first and last calls
cntNumber of calls that must pass within thresholdSeconds to trigger the warning

Member Function Documentation

◆ feed()

bool redux::canand::CooldownWarning::feed ( )
inline

Feed the CooldownWarning.

Returns
whether the error should trigger

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