30 lines
811 B
C++
30 lines
811 B
C++
/**
|
|
* @file dbc_tree_builder.cpp
|
|
* @brief
|
|
*
|
|
* Created: 2026-03-13
|
|
* Author: Deeaitch (Dim. Himro)
|
|
*
|
|
* Licensed under the MIT License.
|
|
* See LICENSE file in the project root for full license text.
|
|
*/
|
|
|
|
#include "dbc_tree_builder.h"
|
|
|
|
std::unique_ptr<TreeNode> DbcTreeBuilder::Build(const DbcDatabase &database) const {
|
|
std::unique_ptr<TreeNode> root = std::make_unique<TreeNode>();
|
|
|
|
for (const FrameInfo &frame : database.frames) {
|
|
std::unique_ptr<TreeNode> frameNode = std::make_unique<TreeNode>(frame);
|
|
|
|
for (const SignalInfo &signal : frame.signals) {
|
|
std::unique_ptr<TreeNode> signalNode = std::make_unique<TreeNode>(signal);
|
|
frameNode->AddChild(std::move(signalNode));
|
|
}
|
|
|
|
root->AddChild(std::move(frameNode));
|
|
}
|
|
|
|
return root;
|
|
}
|