Changeset View
Changeset View
Standalone View
Standalone View
src/radix.h
Show First 20 Lines • Show All 246 Lines • ▼ Show 20 Lines | private: | ||||
} | } | ||||
#undef SEEK_LEAF_LOOP | #undef SEEK_LEAF_LOOP | ||||
template <typename Callable> | template <typename Callable> | ||||
void forEachLeaf(RadixElement e, Callable &&func) const { | void forEachLeaf(RadixElement e, Callable &&func) const { | ||||
if (e.isNode()) { | if (e.isNode()) { | ||||
e.getNode()->forEachChild( | e.getNode()->forEachChild( | ||||
[&](auto pElement) { forEachLeaf(pElement->load(), func); }); | [&](const std::atomic<RadixElement> *pElement) { | ||||
forEachLeaf(pElement->load(), func); | |||||
}); | |||||
return; | return; | ||||
} | } | ||||
T *leaf = e.getLeaf(); | T *leaf = e.getLeaf(); | ||||
if (leaf != nullptr) { | if (leaf != nullptr) { | ||||
func(RCUPtr<T>::copy(leaf)); | func(RCUPtr<T>::copy(leaf)); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |