本文整理汇总了C++中Child::IsStateValidOrRestoring方法的典型用法代码示例。如果您正苦于以下问题:C++ Child::IsStateValidOrRestoring方法的具体用法?C++ Child::IsStateValidOrRestoring怎么用?C++ Child::IsStateValidOrRestoring使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Child
的用法示例。
在下文中一共展示了Child::IsStateValidOrRestoring方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleTimer
void ChildSupervisor::HandleTimer(void)
{
Child * child;
uint8_t numChildren;
VerifyOrExit(mSupervisionInterval != 0);
child = GetNetif().GetMle().GetChildren(&numChildren);
for (uint8_t i = 0; i < numChildren; i++, child++)
{
if (!child->IsStateValidOrRestoring())
{
continue;
}
child->IncrementSecondsSinceLastSupervision();
if ((child->GetSecondsSinceLastSupervision() >= mSupervisionInterval) && (child->IsRxOnWhenIdle() == false))
{
SendMessage(*child);
}
}
mTimer.Start(kOneSecond);
exit:
return;
}
示例2: StateMatchesFilter
// Checks whether a `Child::State` matches a `ChildTable::StateFilter`.
static bool StateMatchesFilter(Child::State aState, ChildTable::StateFilter aFilter)
{
bool rval = false;
Child child;
child.SetState(aState);
switch (aFilter)
{
case ChildTable::kInStateAnyExceptInvalid:
rval = (aState != Child::kStateInvalid);
break;
case ChildTable::kInStateValid:
rval = (aState == Child::kStateValid);
break;
case ChildTable::kInStateValidOrRestoring:
rval = child.IsStateValidOrRestoring();
break;
case ChildTable::kInStateChildIdRequest:
rval = (aState == Child::kStateChildIdRequest);
break;
case ChildTable::kInStateValidOrAttaching:
rval = child.IsStateValidOrAttaching();
break;
case ChildTable::kInStateAnyExceptValidOrRestoring:
rval = !child.IsStateValidOrRestoring();
break;
}
return rval;
}