Doxygen with github
|
Base component class. More...
#include <ksComponent.h>
Public Member Functions | |
virtual const size_t | getInstanceType () const |
Retrieves type ID of the object. | |
virtual bool | isA (const size_t id) const |
Checks whether object is of given type. | |
virtual bool | init (ksApplication *app) |
Initializes component. | |
virtual bool | loop (ksApplication *app) |
Handles component loop logic, called from application loop. | |
virtual bool | postInit (ksApplication *app) |
Method called after component initialization, used to setup references to other components. | |
Public Member Functions inherited from ksf::ksRtti | |
template<typename TType > | |
TType * | as () |
Tries to cast object to the type provided as a template parameter. | |
template<typename TType > | |
const TType * | as () const |
Tries to cast object to the type provided as a template parameter (const version). | |
Static Public Member Functions | |
static const size_t | getClassType () |
Protected Attributes | |
ksComponentState::TYPE | componentState { ksComponentState::NotInitialized } |
Friends | |
class | ksApplication |
Base component class.
A component is a part of the application that can be configured and managed by the application. As it is using ksRtti, it must use KSF_RTTI_DECLARATIONS for proper initialization.
|
inlinevirtual |
Retrieves type ID of the object.
Implements ksf::ksRtti.
Reimplemented in ksf::comps::ksConfigProvider, ksf::comps::ksDevicePortal, ksf::comps::ksDevStatMqttReporter, ksf::comps::ksLed, ksf::comps::ksMqttConfigProvider, ksf::comps::ksMqttConnector, ksf::comps::ksResetButton, ksf::comps::ksWifiConfigurator, and ksf::comps::ksWifiConnector.
Referenced by ksf::ksApplication::addComponent(), ksf::ksApplication::findComponent(), and ksf::ksApplication::findComponents().
|
virtual |
Initializes component.
app | Pointer to the parent ksApplication. |
Reimplemented in ksf::comps::ksDevicePortal, ksf::comps::ksLed, ksf::comps::ksMqttConnector, ksf::comps::ksResetButton, ksf::comps::ksWifiConfigurator, and ksf::comps::ksWifiConnector.
Referenced by ksf::comps::ksMqttConnector::init().
|
inlinevirtual |
Checks whether object is of given type.
id | Type ID to check against. |
Reimplemented from ksf::ksRtti.
Reimplemented in ksf::comps::ksConfigProvider, ksf::comps::ksDevicePortal, ksf::comps::ksDevStatMqttReporter, ksf::comps::ksLed, ksf::comps::ksMqttConfigProvider, ksf::comps::ksMqttConnector, ksf::comps::ksResetButton, ksf::comps::ksWifiConfigurator, and ksf::comps::ksWifiConnector.
|
virtual |
Handles component loop logic, called from application loop.
app | Pointer to the parent ksApplication. |
Reimplemented in ksf::comps::ksDevicePortal, ksf::comps::ksDevStatMqttReporter, ksf::comps::ksLed, ksf::comps::ksMqttConnector, ksf::comps::ksResetButton, ksf::comps::ksWifiConfigurator, and ksf::comps::ksWifiConnector.
|
virtual |
Method called after component initialization, used to setup references to other components.
app | Pointer to the parent ksApplication. |
Reimplemented in ksf::comps::ksDevicePortal, ksf::comps::ksDevStatMqttReporter, ksf::comps::ksMqttConnector, and ksf::comps::ksWifiConfigurator.
|
protected |
Current component state.