1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 03:12:20 +01:00

Add size getter to CallbackManager (#5129)

This commit is contained in:
Jesse Hills
2023-07-20 12:37:42 +12:00
committed by GitHub
parent de626c0f5f
commit d238155640

View File

@@ -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...); }