[takelet] add template TaskeltIn to simplify handler functions (#8064)

This class adds a template sub-class of `Tasklet` which allows
us to directly specify an `Owner` of tasklet along with handler
callback as a member method of `Owner`. This helps simplify the
use of `Tasklet` in core module.
This commit is contained in:
Abtin Keshavarzian
2022-08-24 10:44:48 -07:00
committed by GitHub
parent 5516024905
commit 9699d319af
22 changed files with 100 additions and 109 deletions
+1 -6
View File
@@ -46,7 +46,7 @@ RegisterLogModule("Notifier");
Notifier::Notifier(Instance &aInstance)
: InstanceLocator(aInstance)
, mTask(aInstance, Notifier::EmitEvents)
, mTask(aInstance)
{
for (ExternalCallback &callback : mExternalCallbacks)
{
@@ -118,11 +118,6 @@ void Notifier::SignalIfFirst(Event aEvent)
}
}
void Notifier::EmitEvents(Tasklet &aTasklet)
{
aTasklet.Get<Notifier>().EmitEvents();
}
void Notifier::EmitEvents(void)
{
Events events;