mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[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:
committed by
GitHub
parent
5516024905
commit
9699d319af
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user