mirror of
https://github.com/esphome/esphome.git
synced 2025-02-18 01:03:12 +01:00
Add size getter to CallbackManager (#5129)
This commit is contained in:
parent
de626c0f5f
commit
d238155640
1 changed files with 1 additions and 0 deletions
|
@ -475,6 +475,7 @@ template<typename... Ts> class CallbackManager<void(Ts...)> {
|
||||||
for (auto &cb : this->callbacks_)
|
for (auto &cb : this->callbacks_)
|
||||||
cb(args...);
|
cb(args...);
|
||||||
}
|
}
|
||||||
|
size_t size() const { return this->callbacks_.size(); }
|
||||||
|
|
||||||
/// Call all callbacks in this manager.
|
/// Call all callbacks in this manager.
|
||||||
void operator()(Ts... args) { call(args...); }
|
void operator()(Ts... args) { call(args...); }
|
||||||
|
|
Loading…
Add table
Reference in a new issue