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::GRAPHVIZTreeRenderer Class Reference
Inheritance diagram for duckdb::GRAPHVIZTreeRenderer:
Collaboration diagram for duckdb::GRAPHVIZTreeRenderer:

Public Member Functions

string ToString (const LogicalOperator &op)
string ToString (const PhysicalOperator &op)
string ToString (const ProfilingNode &op)
string ToString (const Pipeline &op)
void Render (const LogicalOperator &op, std::ostream &ss)
void Render (const PhysicalOperator &op, std::ostream &ss)
void Render (const ProfilingNode &op, std::ostream &ss) override
void Render (const Pipeline &op, std::ostream &ss)
void ToStreamInternal (RenderTree &root, std::ostream &ss) override
Public Member Functions inherited from duckdb::TreeRenderer
void ToStream (RenderTree &root, std::ostream &ss)
virtual bool UsesRawKeyNames ()

Additional Inherited Members

Static Public Member Functions inherited from duckdb::TreeRenderer
static unique_ptr< TreeRenderer > CreateRenderer (ExplainFormat format)

Constructor & Destructor Documentation

◆ GRAPHVIZTreeRenderer()

duckdb::GRAPHVIZTreeRenderer::GRAPHVIZTreeRenderer ( )
inlineexplicit
110464 {
110465 }

◆ ~GRAPHVIZTreeRenderer()

duckdb::GRAPHVIZTreeRenderer::~GRAPHVIZTreeRenderer ( )
inlineoverride
110466 {
110467 }

Member Function Documentation

◆ ToString() [1/4]

string duckdb::GRAPHVIZTreeRenderer::ToString ( const LogicalOperator & op)
110501 {
110502 duckdb::stringstream ss;
110503 Render(op, ss);
110504 return ss.str();
110505}

◆ ToString() [2/4]

string duckdb::GRAPHVIZTreeRenderer::ToString ( const PhysicalOperator & op)
110507 {
110508 duckdb::stringstream ss;
110509 Render(op, ss);
110510 return ss.str();
110511}

◆ ToString() [3/4]

string duckdb::GRAPHVIZTreeRenderer::ToString ( const ProfilingNode & op)
110513 {
110514 duckdb::stringstream ss;
110515 Render(op, ss);
110516 return ss.str();
110517}

◆ ToString() [4/4]

string duckdb::GRAPHVIZTreeRenderer::ToString ( const Pipeline & op)
110519 {
110520 duckdb::stringstream ss;
110521 Render(op, ss);
110522 return ss.str();
110523}

◆ Render() [1/4]

void duckdb::GRAPHVIZTreeRenderer::Render ( const LogicalOperator & op,
std::ostream & ss )
110525 {
110526 auto tree = RenderTree::CreateRenderTree(op);
110527 ToStream(*tree, ss);
110528}

◆ Render() [2/4]

void duckdb::GRAPHVIZTreeRenderer::Render ( const PhysicalOperator & op,
std::ostream & ss )
110530 {
110531 auto tree = RenderTree::CreateRenderTree(op);
110532 ToStream(*tree, ss);
110533}

◆ Render() [3/4]

void duckdb::GRAPHVIZTreeRenderer::Render ( const ProfilingNode & op,
std::ostream & ss )
overridevirtual

Reimplemented from duckdb::TreeRenderer.

110535 {
110536 auto tree = RenderTree::CreateRenderTree(op);
110537 ToStream(*tree, ss);
110538}

◆ Render() [4/4]

void duckdb::GRAPHVIZTreeRenderer::Render ( const Pipeline & op,
std::ostream & ss )
110540 {
110541 auto tree = RenderTree::CreateRenderTree(op);
110542 ToStream(*tree, ss);
110543}

◆ ToStreamInternal()

void duckdb::GRAPHVIZTreeRenderer::ToStreamInternal ( RenderTree & root,
std::ostream & ss )
overridevirtual

Implements duckdb::TreeRenderer.

110545 {
110546 const string digraph_format = R"(
110547digraph G {
110548 node [shape=box, style=rounded, fontname="Courier New", fontsize=10];
110549%s
110550%s
110551}
110552 )";
110553
110554 vector<string> nodes;
110555 vector<string> edges;
110556
110557 const string node_format = R"( node_%d_%d [label="%s"];)";
110558
110559 for (idx_t y = 0; y < root.height; y++) {
110560 for (idx_t x = 0; x < root.width; x++) {
110561 auto node = root.GetNode(x, y);
110562 if (!node) {
110563 continue;
110564 }
110565
110566 // Create Node
110567 vector<string> body;
110568 body.push_back(node->name);
110569 for (auto &item : node->extra_text) {
110570 auto &key = item.first;
110571 auto &value_raw = item.second;
110572
110573 auto value = QueryProfiler::JSONSanitize(value_raw);
110574 body.push_back(StringUtil::Format("%s:\\n%s", key, value));
110575 }
110576 nodes.push_back(StringUtil::Format(node_format, x, y, StringUtil::Join(body, "\\n───\\n")));
110577
110578 // Create Edge(s)
110579 for (auto &coord : node->child_positions) {
110580 edges.push_back(StringUtil::Format(" node_%d_%d -> node_%d_%d;", x, y, coord.x, coord.y));
110581 }
110582 }
110583 }
static string Format(const string fmt_str, ARGS... params)
Format a string using printf semantics.
Definition duckdb.hpp:4002
static DUCKDB_API string Join(const vector< string > &input, const string &separator)
Join multiple strings into one string. Components are concatenated by the given separator.
Definition duckdb.cpp:109497
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

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