Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::ARTScanner< HANDLING, NODE > Class Template Reference

ARTScanner scans the entire ART and processes each node. More...

Collaboration diagram for duckdb::ARTScanner< HANDLING, NODE >:

Classes

struct  NodeEntry
 

Public Member Functions

template<class FUNC >
 ARTScanner (ART &art, FUNC &&handler, NODE &root)
 
template<class FUNC >
void Scan (FUNC &&handler)
 

Private Member Functions

template<class FUNC >
void Emplace (FUNC &&handler, NODE &node)
 
template<class FUNC >
void Pop (FUNC &&handler, NODE &node)
 
template<class FUNC , class NODE_TYPE >
void IterateChildren (FUNC &&handler, NODE &node, const NType type)
 

Private Attributes

ARTart
 
stack< NodeEntrys
 

Detailed Description

template<ARTScanHandling HANDLING, class NODE>
class duckdb::ARTScanner< HANDLING, NODE >

ARTScanner scans the entire ART and processes each node.

Constructor & Destructor Documentation

◆ ARTScanner()

template<ARTScanHandling HANDLING, class NODE >
template<class FUNC >
duckdb::ARTScanner< HANDLING, NODE >::ARTScanner ( ART art,
FUNC &&  handler,
NODE root 
)
inlineexplicit
58363 : art(art) {
58364 Emplace(handler, root);
58365 }

Member Function Documentation

◆ Scan()

template<ARTScanHandling HANDLING, class NODE >
template<class FUNC >
void duckdb::ARTScanner< HANDLING, NODE >::Scan ( FUNC &&  handler)
inline
58369 {
58370 while (!s.empty()) {
58371 auto &entry = s.top();
58372 if (entry.exhausted) {
58373 Pop(handler, entry.node);
58374 continue;
58375 }
58376 entry.exhausted = true;
58377
58378 const auto type = entry.node.GetType();
58379 switch (type) {
58380 case NType::LEAF_INLINED:
58381 case NType::LEAF:
58382 case NType::NODE_7_LEAF:
58383 case NType::NODE_15_LEAF:
58384 case NType::NODE_256_LEAF:
58385 break;
58386 case NType::PREFIX: {
58387 Prefix prefix(art, entry.node, true);
58388 Emplace(handler, *prefix.ptr);
58389 break;
58390 }
58391
58392 case NType::NODE_4: {
58393 IterateChildren<FUNC, Node4>(handler, entry.node, type);
58394 break;
58395 }
58396 case NType::NODE_16: {
58397 IterateChildren<FUNC, Node16>(handler, entry.node, type);
58398 break;
58399 }
58400 case NType::NODE_48: {
58401 IterateChildren<FUNC, Node48>(handler, entry.node, type);
58402 break;
58403 }
58404 case NType::NODE_256: {
58405 IterateChildren<FUNC, Node256>(handler, entry.node, type);
58406 break;
58407 }
58408 default:
58409 throw InternalException("invalid node type for ART ARTScanner: %d", type);
58410 }
58411 }
58412 }

◆ Emplace()

template<ARTScanHandling HANDLING, class NODE >
template<class FUNC >
void duckdb::ARTScanner< HANDLING, NODE >::Emplace ( FUNC &&  handler,
NODE node 
)
inlineprivate
58416 {
58417 if (HANDLING == ARTScanHandling::EMPLACE) {
58418 auto result = handler(node);
58419 if (result == ARTHandlingResult::SKIP) {
58420 return;
58421 }
58422 D_ASSERT(result == ARTHandlingResult::CONTINUE);
58423 }
58424 s.emplace(node);
58425 }

◆ Pop()

template<ARTScanHandling HANDLING, class NODE >
template<class FUNC >
void duckdb::ARTScanner< HANDLING, NODE >::Pop ( FUNC &&  handler,
NODE node 
)
inlineprivate
58428 {
58429 if (HANDLING == ARTScanHandling::POP) {
58430 handler(node);
58431 }
58432 s.pop();
58433 }

◆ IterateChildren()

template<ARTScanHandling HANDLING, class NODE >
template<class FUNC , class NODE_TYPE >
void duckdb::ARTScanner< HANDLING, NODE >::IterateChildren ( FUNC &&  handler,
NODE node,
const NType  type 
)
inlineprivate
58436 {
58437 auto &n = Node::Ref<NODE_TYPE>(art, node, type);
58438 NODE_TYPE::Iterator(n, [&](NODE &child) { Emplace(handler, child); });
58439 }

The documentation for this class was generated from the following file: