Closes #11
This commit is contained in:
1 parent
0067cb4ddd
commit
f17ddb6aad
104 files changed
+1928
-889
No files matched your search
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @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(new TreeNode());
|
||||
|
||||
for (std::size_t frameIndex = 0U; frameIndex < database.frames.size(); ++frameIndex) {
|
||||
const FrameInfo &frame = database.frames[frameIndex];
|
||||
std::unique_ptr<TreeNode> frameNode(new TreeNode(frame));
|
||||
|
||||
for (std::size_t signalIndex = 0U; signalIndex < frame.signals.size(); ++signalIndex) {
|
||||
const SignalInfo &signal = frame.signals[signalIndex];
|
||||
std::unique_ptr<TreeNode> signalNode(new TreeNode(signal));
|
||||
frameNode->AddChild(std::move(signalNode));
|
||||
}
|
||||
|
||||
root->AddChild(std::move(frameNode));
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
Reference in new issue
Block a user