Syntax
class OwningList : public LinkedList<Type>
{
class Iterator;
class ConstIterator;
public:
OwningList(void) = default;
~OwningList(void) { Free(); }
void Free(void)
{
while (!Pop().IsNull())
{
}
}
void Clear(void) { Free(); }
OwnedPtr<Type> Pop(void) { return OwnedPtr<Type>(LinkedList<Type>::Pop()); }
OwnedPtr<Type> PopAfter(Type *aPrevEntry) { return OwnedPtr<Type>(LinkedList<Type>::PopAfter(aPrevEntry)); }
template <typename Indicator> OwnedPtr<Type> RemoveMatching(const Indicator &aIndicator)
{
return OwnedPtr<Type>(LinkedList<Type>::RemoveMatching(aIndicator));
}
template <typename Indicator> void RemoveAllMatching(const Indicator &aIndicator, OwningList &aRemovedList)
{
LinkedList<Type>::RemoveAllMatching(aIndicator, aRemovedList);
}
template <typename Indicator> bool RemoveAndFreeAllMatching(const Indicator &aIndicator)
{
OwningList removedList;
RemoveAllMatching(aIndicator, removedList);
return !removedList.IsEmpty();
}
};
![]()
template <typename Type> class OwningList : public LinkedList<Type>![]()
template <typename Indicator> void RemoveAllMatching(const Indicator &aIndicator, OwningList &aRemovedList)