Rename CommonStructuredDataStructEntry to Property

This commit is contained in:
Jan 2022-03-20 17:40:12 +01:00
parent 996528eba5
commit 0a226652f2
5 changed files with 12 additions and 12 deletions

View File

@ -6,18 +6,18 @@
#include "CommonStructuredDataDef.h" #include "CommonStructuredDataDef.h"
#include "Utils/Endianness.h" #include "Utils/Endianness.h"
CommonStructuredDataStructEntry::CommonStructuredDataStructEntry() CommonStructuredDataStructProperty::CommonStructuredDataStructProperty()
: m_offset_in_bits(0u) : m_offset_in_bits(0u)
{ {
} }
CommonStructuredDataStructEntry::CommonStructuredDataStructEntry(std::string name) CommonStructuredDataStructProperty::CommonStructuredDataStructProperty(std::string name)
: m_name(std::move(name)), : m_name(std::move(name)),
m_offset_in_bits(0u) m_offset_in_bits(0u)
{ {
} }
CommonStructuredDataStructEntry::CommonStructuredDataStructEntry(std::string name, const CommonStructuredDataType type, const size_t offsetInBits) CommonStructuredDataStructProperty::CommonStructuredDataStructProperty(std::string name, const CommonStructuredDataType type, const size_t offsetInBits)
: m_name(std::move(name)), : m_name(std::move(name)),
m_type(type), m_type(type),
m_offset_in_bits(offsetInBits) m_offset_in_bits(offsetInBits)
@ -118,7 +118,7 @@ uint32_t CommonStructuredDataStruct::CalculateChecksum(const CommonStructuredDat
void CommonStructuredDataStruct::SortProperties() void CommonStructuredDataStruct::SortProperties()
{ {
std::sort(m_properties.begin(), m_properties.end(), [](const CommonStructuredDataStructEntry& e1, const CommonStructuredDataStructEntry& e2) std::sort(m_properties.begin(), m_properties.end(), [](const CommonStructuredDataStructProperty& e1, const CommonStructuredDataStructProperty& e2)
{ {
return e1.m_offset_in_bits < e2.m_offset_in_bits; return e1.m_offset_in_bits < e2.m_offset_in_bits;
}); });

View File

@ -6,22 +6,22 @@
#include "Utils/ClassUtils.h" #include "Utils/ClassUtils.h"
#include "CommonStructuredDataTypes.h" #include "CommonStructuredDataTypes.h"
struct CommonStructuredDataStructEntry struct CommonStructuredDataStructProperty
{ {
std::string m_name; std::string m_name;
CommonStructuredDataType m_type; CommonStructuredDataType m_type;
size_t m_offset_in_bits; size_t m_offset_in_bits;
CommonStructuredDataStructEntry(); CommonStructuredDataStructProperty();
explicit CommonStructuredDataStructEntry(std::string name); explicit CommonStructuredDataStructProperty(std::string name);
CommonStructuredDataStructEntry(std::string name, CommonStructuredDataType type, size_t offsetInBits); CommonStructuredDataStructProperty(std::string name, CommonStructuredDataType type, size_t offsetInBits);
}; };
class CommonStructuredDataDef; class CommonStructuredDataDef;
struct CommonStructuredDataStruct struct CommonStructuredDataStruct
{ {
std::string m_name; std::string m_name;
std::vector<CommonStructuredDataStructEntry> m_properties; std::vector<CommonStructuredDataStructProperty> m_properties;
size_t m_bit_offset; size_t m_bit_offset;
size_t m_size_in_byte; size_t m_size_in_byte;

View File

@ -281,7 +281,7 @@ namespace sdd::struct_scope_sequences
// Sort the entries of the struct alphabetically // Sort the entries of the struct alphabetically
std::sort(state->m_current_struct->m_properties.begin(), state->m_current_struct->m_properties.end(), std::sort(state->m_current_struct->m_properties.begin(), state->m_current_struct->m_properties.end(),
[](const CommonStructuredDataStructEntry& e1, const CommonStructuredDataStructEntry& e2) [](const CommonStructuredDataStructProperty& e1, const CommonStructuredDataStructProperty& e2)
{ {
return e1.m_name < e2.m_name; return e1.m_name < e2.m_name;
}); });

View File

@ -49,7 +49,7 @@ void StructuredDataDefDumperNew::DumpType(const CommonStructuredDataDef& def, Co
typeName = "unknown"; typeName = "unknown";
} }
void StructuredDataDefDumperNew::DumpProperty(const CommonStructuredDataDef& def, const CommonStructuredDataStructEntry& property, unsigned& currentOffsetInBit) void StructuredDataDefDumperNew::DumpProperty(const CommonStructuredDataDef& def, const CommonStructuredDataStructProperty& property, unsigned& currentOffsetInBit)
{ {
std::string typeName; std::string typeName;
std::vector<std::string> arraySpecifiersInReverseOrder; std::vector<std::string> arraySpecifiersInReverseOrder;

View File

@ -17,7 +17,7 @@ class StructuredDataDefDumperNew : AbstractTextDumper
void DumpEnum(const CommonStructuredDataEnum& _enum); void DumpEnum(const CommonStructuredDataEnum& _enum);
void DumpType(const CommonStructuredDataDef& def, CommonStructuredDataType type, std::string& typeName, std::vector<std::string>& arraySpecifiersInReverseOrder); void DumpType(const CommonStructuredDataDef& def, CommonStructuredDataType type, std::string& typeName, std::vector<std::string>& arraySpecifiersInReverseOrder);
void DumpProperty(const CommonStructuredDataDef& def, const CommonStructuredDataStructEntry& property, unsigned& currentOffsetInBit); void DumpProperty(const CommonStructuredDataDef& def, const CommonStructuredDataStructProperty& property, unsigned& currentOffsetInBit);
void DumpStruct(const CommonStructuredDataDef& def, const CommonStructuredDataStruct& _struct, size_t structIndex); void DumpStruct(const CommonStructuredDataDef& def, const CommonStructuredDataStruct& _struct, size_t structIndex);
public: public: