|
Doxygen with github
|
Base class for multicasting events. More...
#include <ksEvent.h>
Inheritance diagram for ksf::evt::ksEvent< Params >:Public Member Functions | |
| bool | isBound () const |
| Returns whether any callback is bound to this event. | |
| void | registerEvent (std::unique_ptr< ksf::evt::ksEventHandle > &outHandle, std::function< void(Params...)> &&function) |
| Registers event (binds to callback list). | |
| void | unbind (std::size_t callbackUID) override |
| Unbinds event callback by specified unique ID. | |
| void | broadcast (Params... params) const |
| Broadcasts event to all bound callbacks. | |
Public Member Functions inherited from ksf::evt::ksEventInterface | |
Additional Inherited Members | |
Protected Member Functions inherited from ksf::evt::ksEventInterface |
Base class for multicasting events.
| Params... | Event parameters. |
|
inline |
Broadcasts event to all bound callbacks.
| args | Event parameters. |
References ksf::evt::ksEvent< Params >::callbacks.
Referenced by ksf::comps::ksDevicePortal::handle_executeCommand(), ksf::comps::ksMqttConnector::loop(), ksf::comps::ksWifiConnector::loop(), ksf::comps::ksMqttConnector::mqttConnectedInternal(), ksf::comps::ksMqttConnector::mqttMessageInternal(), ksf::comps::ksDevicePortal::onRequest_otaChunk(), and ksf::comps::ksDevicePortal::updateFinished().
|
inline |
Returns whether any callback is bound to this event.
References ksf::evt::ksEvent< Params >::callbacks.
Referenced by ksf::comps::ksMqttConnector::mqttMessageInternal().
|
inline |
Registers event (binds to callback list).
| outHandle | Reference to outHandle shared ptr (destruction of ksEventHandle object will unbind the event) |
| function | R-value reference to callback function |
References ksf::evt::ksEvent< Params >::callbacks, and ksf::evt::ksEvent< Params >::lastCallbackUID.
Referenced by ksf::comps::ksDevStatMqttReporter::postInit().
|
inlineoverridevirtual |
Unbinds event callback by specified unique ID.
This ID is automatically assigned by registerEvent function and ksEventHandle uses it to unbind automatically upon destruction.
| callbackUID | Unique id of the callback to unbind. |
Implements ksf::evt::ksEventInterface.
References ksf::evt::ksEvent< Params >::callbacks.