ESPHome 2025.8.0b1
Loading...
Searching...
No Matches
esphome::Deduplicator< T > Class Template Reference

Helper class to deduplicate items in a series of values. More...

#include <helpers.h>

Public Member Functions

bool next (T value)
 Feeds the next item in the series to the deduplicator and returns false if this is a duplicate.
 
bool next_unknown ()
 Returns true if the deduplicator's value was previously known.
 
bool has_value () const
 Returns true if this deduplicator has processed any items.
 

Protected Attributes

bool has_value_ {false}
 
bool value_unknown_ {false}
 
last_value_ {}
 

Detailed Description

template<typename T>
class esphome::Deduplicator< T >

Helper class to deduplicate items in a series of values.

Definition at line 628 of file helpers.h.

Member Function Documentation

◆ has_value()

template<typename T >
bool esphome::Deduplicator< T >::has_value ( ) const
inline

Returns true if this deduplicator has processed any items.

Definition at line 647 of file helpers.h.

◆ next()

template<typename T >
bool esphome::Deduplicator< T >::next ( T value)
inline

Feeds the next item in the series to the deduplicator and returns false if this is a duplicate.

Definition at line 631 of file helpers.h.

◆ next_unknown()

template<typename T >
bool esphome::Deduplicator< T >::next_unknown ( )
inline

Returns true if the deduplicator's value was previously known.

Definition at line 641 of file helpers.h.

Field Documentation

◆ has_value_

template<typename T >
bool esphome::Deduplicator< T >::has_value_ {false}
protected

Definition at line 650 of file helpers.h.

◆ last_value_

template<typename T >
T esphome::Deduplicator< T >::last_value_ {}
protected

Definition at line 652 of file helpers.h.

◆ value_unknown_

template<typename T >
bool esphome::Deduplicator< T >::value_unknown_ {false}
protected

Definition at line 651 of file helpers.h.


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