[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
@@ -54,7 +54,7 @@ RegisterLogModule("DuaManager");
DuaManager::DuaManager(Instance &aInstance)
: InstanceLocator(aInstance)
, mRegistrationTask(aInstance, DuaManager::HandleRegistrationTask)
, mRegistrationTask(aInstance)
, mDuaNotification(UriPath::kDuaRegistrationNotify, &DuaManager::HandleDuaNotification, this)
, mIsDuaPending(false)
#if OPENTHREAD_CONFIG_DUA_ENABLE
@@ -402,11 +402,6 @@ void DuaManager::HandleTimeTick(void)
UpdateTimeTickerRegistration();
}
void DuaManager::HandleRegistrationTask(Tasklet &aTasklet)
{
aTasklet.Get<DuaManager>().PerformNextRegistration();
}
void DuaManager::UpdateTimeTickerRegistration(void)
{
if (mDelay.mValue == 0)