MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ same_structure()

bool MayaFlux::Kakshya::CompositeLayout::same_structure ( const CompositeLayout & other) const
nodiscardnoexcept

Compare declared field names, kinds, and nested layouts.

Parameters
otherLayout to compare recursively.
Returns
True when both layouts describe the same record structure.

Definition at line 71 of file Composite.cpp.

72{
73 if (m_fields.size() != other.m_fields.size())
74 return false;
75
76 for (size_t i = 0; i < m_fields.size(); ++i) {
77 const auto& left = m_fields[i];
78 const auto& right = other.m_fields[i];
79
80 if (left.name != right.name || left.type != right.type
81 || left.size_bytes != right.size_bytes
82 || static_cast<bool>(left.nested_layout) != static_cast<bool>(right.nested_layout))
83 return false;
84
85 if (left.nested_layout && !left.nested_layout->same_structure(*right.nested_layout))
86 return false;
87 }
88 return true;
89}
std::vector< CompositeField > m_fields

References m_fields.

Referenced by MayaFlux::IO::XmlDocument::from_rows(), MayaFlux::IO::XmlWriter::open(), MayaFlux::IO::records_of(), and MayaFlux::IO::XmlWriter::write_rows().

Here is the caller graph for this function: