SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::ExpiringValue< T > Class Template Reference

Value container that keeps track of its expiration time. More...

#include <sensesp/system/expiring_value.h>

Public Member Functions

 ExpiringValue ()
 
 ExpiringValue (T value, unsigned long expiration_duration, T expired_value)
 
void update (T value)
 
get () const
 
bool is_expired () const
 

Detailed Description

template<typename T>
class sensesp::ExpiringValue< T >

Value container that keeps track of its expiration time.

The value is considered expired if the time since the last update is greater than the expiration duration. When expired, the value is replaced with an expiration placeholder value.

Template Parameters
T

Definition at line 16 of file expiring_value.h.

Constructor & Destructor Documentation

◆ ExpiringValue() [1/2]

template<typename T >
sensesp::ExpiringValue< T >::ExpiringValue ( )
inline

Definition at line 18 of file expiring_value.h.

◆ ExpiringValue() [2/2]

template<typename T >
sensesp::ExpiringValue< T >::ExpiringValue ( T value,
unsigned long expiration_duration,
T expired_value )
inline

Definition at line 24 of file expiring_value.h.

Member Function Documentation

◆ get()

template<typename T >
T sensesp::ExpiringValue< T >::get ( ) const
inline

Definition at line 35 of file expiring_value.h.

Here is the call graph for this function:

◆ is_expired()

template<typename T >
bool sensesp::ExpiringValue< T >::is_expired ( ) const
inline

Definition at line 43 of file expiring_value.h.

Here is the caller graph for this function:

◆ update()

template<typename T >
void sensesp::ExpiringValue< T >::update ( T value)
inline

Definition at line 30 of file expiring_value.h.


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