ESPHome  1.15.1
Public Member Functions | Protected Attributes
esphome::CallbackManager< void(Ts...)> Class Template Reference

Simple helper class to allow having multiple subscribers to a signal. More...

#include <helpers.h>

Public Member Functions

void add (std::function< void(Ts...)> &&callback)
 Add a callback to the internal callback list. More...
 
void call (Ts... args)
 Call all callbacks in this manager. More...
 

Protected Attributes

std::vector< std::function< void(Ts...)> > callbacks_
 

Detailed Description

template<typename... Ts>
class esphome::CallbackManager< void(Ts...)>

Simple helper class to allow having multiple subscribers to a signal.

Template Parameters
TsThe arguments for the callback, wrapped in void().

Definition at line 201 of file helpers.h.

Member Function Documentation

◆ add()

template<typename... Ts>
void esphome::CallbackManager< void(Ts...)>::add ( std::function< void(Ts...)> &&  callback)
inline

Add a callback to the internal callback list.

Definition at line 204 of file helpers.h.

◆ call()

template<typename... Ts>
void esphome::CallbackManager< void(Ts...)>::call ( Ts...  args)
inline

Call all callbacks in this manager.

Definition at line 207 of file helpers.h.

Field Documentation

◆ callbacks_

template<typename... Ts>
std::vector<std::function<void(Ts...)> > esphome::CallbackManager< void(Ts...)>::callbacks_
protected

Definition at line 213 of file helpers.h.


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