mirror of
https://github.com/esphome/esphome.git
synced 2024-11-19 11:17:01 +01:00
Add size getter to CallbackManager (#5129)
This commit is contained in:
parent
de626c0f5f
commit
d238155640
@ -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…
Reference in New Issue
Block a user