DBC Framework
DBC parsing and CAN signal decoding framework
Loading...
Searching...
No Matches
dbc_tree_builder.cpp
Go to the documentation of this file.
1
12#include "dbc_tree_builder.h"
13
14std::unique_ptr<TreeNode> DbcTreeBuilder::Build(const DbcDatabase &database) const {
15 std::unique_ptr<TreeNode> root = std::make_unique<TreeNode>();
16
17 for (const FrameInfo &frame : database.frames) {
18 std::unique_ptr<TreeNode> frameNode = std::make_unique<TreeNode>(frame);
19
20 for (const SignalInfo &signal : frame.signals) {
21 std::unique_ptr<TreeNode> signalNode = std::make_unique<TreeNode>(signal);
22 frameNode->AddChild(std::move(signalNode));
23 }
24
25 root->AddChild(std::move(frameNode));
26 }
27
28 return root;
29}
std::unique_ptr< TreeNode > Build(const DbcDatabase &database) const
Build tree representation of parsed DBC data.
Created: 2026-03-13 Author: Deeaitch (Dim. Himro)
Parsed DBC content stored in a simple internal form.
std::vector< FrameInfo > frames
Describes one CAN frame from a DBC file.
Definition frame_info.h:24
Describes one signal inside a DBC frame.
Definition signal_info.h:24