6static void Check(
bool condition) {
7 if (!condition)
throw std::runtime_error(
"Tree navigation test failed");
11 static_assert(!std::is_move_constructible<TreeNode>::value,
"Node addresses must be stable");
15 frame.signals.push_back(signal);
16 frame.signals.push_back(signal);
17 database.
frames.push_back(frame);
18 database.
frames.push_back(frame);
20 Check(root->GetParent() ==
nullptr && root->GetRow() == 0);
21 root->AddChild(
nullptr);
22 Check(root->GetChildCount() == 2 && !root->GetChild(2));
23 for (std::size_t row = 0; row < root->GetChildCount(); ++row) {
26 for (std::size_t position = 0; position < child->
GetChildCount(); ++position) {
31 std::unique_ptr<TreeNode> transferred = std::move(root);
32 Check(transferred->GetChild(0)->GetParent() == transferred.get());
Builds a simple tree from parsed DBC database.
std::unique_ptr< TreeNode > Build(const DbcDatabase &database) const
Build tree representation of parsed DBC data.
Tree node for later use in model/view or other hierarchy consumers.
const TreeNode * GetChild(std::size_t index) const
Get child by index.
const TreeNode * GetParent() const
std::size_t GetChildCount() const
Get child count.
std::size_t GetRow() const
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.
Describes one signal inside a DBC frame.