Introduce call_dump_config() indirection (#2325)

This commit is contained in:
Oxan van Leeuwen
2021-09-20 11:16:31 +02:00
committed by GitHub
parent 2d7f8b3bdf
commit 1e8e471dec
5 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ void Application::loop() {
#endif
}
this->components_[this->dump_config_at_]->dump_config();
this->components_[this->dump_config_at_]->call_dump_config();
this->dump_config_at_++;
}
}
+2 -1
View File
@@ -64,8 +64,9 @@ bool Component::cancel_timeout(const std::string &name) { // NOLINT
}
void Component::call_loop() { this->loop(); }
void Component::call_setup() { this->setup(); }
void Component::call_dump_config() { this->dump_config(); }
uint32_t Component::get_component_state() const { return this->component_state_; }
void Component::call() {
uint32_t state = this->component_state_ & COMPONENT_STATE_MASK;
+4
View File
@@ -148,8 +148,12 @@ class Component {
const char *get_component_source() const;
protected:
friend class Application;
virtual void call_loop();
virtual void call_setup();
virtual void call_dump_config();
/** Set an interval function with a unique name. Empty name means no cancelling possible.
*
* This will call f every interval ms. Can be cancelled via CancelInterval().