Fix formatting

This commit is contained in:
JCW
2025-07-11 17:19:27 +01:00
parent 888b97346e
commit 9248f60a09

View File

@@ -226,7 +226,7 @@ private:
* 3. Put everything into the enum class SFieldNames
*
* Then the enum SFieldNames has all the field names defined in it.
*/
*/
#pragma push_macro("UNTYPED_SFIELD")
#undef UNTYPED_SFIELD
#pragma push_macro("TYPED_SFIELD")
@@ -281,12 +281,16 @@ struct GetFieldType
* have a static Value member and a static ItemField member
*
* How this works is:
* 1. We have a base definition of GetFieldType which basically gives no information.
* 2. Take an untyped field definition from sfields.macro. e.g. UNTYPED_SFIELD(sfMemo, OBJECT, 10)
* 3. Create a new template specialisation for GetFieldType, with the template parameter being the corresponding SFieldNames enum we defined earliler
* 1. We have a base definition of GetFieldType which basically gives no
* information.
* 2. Take an untyped field definition from sfields.macro. e.g.
* UNTYPED_SFIELD(sfMemo, OBJECT, 10)
* 3. Create a new template specialisation for GetFieldType, with the template
* parameter being the corresponding SFieldNames enum we defined earliler
* 4. Set the Value field to the stiSuffix
* 5. If it's an object, Value will be AggregateFieldTypes::OBJECT
* 6. If it's an array, Value will be AggregateFieldTypes::ARRAY, and ItemField will be the value provided in the macro
* 6. If it's an array, Value will be AggregateFieldTypes::ARRAY, and ItemField
* will be the value provided in the macro
* 7. We don't care about the typed fields because we can get the type easily
*/
#pragma push_macro("UNTYPED_SFIELD")
@@ -542,8 +546,9 @@ struct GetFieldValue<
typename GetInnerObjectStruct<ItemFieldName, InnerObjectTypesArray>::
Struct;
// If we know what type the STArray holds (i.e. the field is defined by ARRAY_SFIELD and the item type is not Invalid), we return an STArrayProxy, otherwise,
// we return an untyped STArray
// If we know what type the STArray holds (i.e. the field is defined by
// ARRAY_SFIELD and the item type is not Invalid), we return an
// STArrayProxy, otherwise, we return an untyped STArray
template <typename TFieldType>
static std::conditional_t<
!std::is_void_v<InnerObjectType>,
@@ -590,14 +595,19 @@ struct GetFieldValue<
* INNER_OBJECT_END
*
* 1. Replace INNER_OBJECT_BEGIN with using InnerObjectTypesArray = std::tuple<
* 2. Replace INNER_OBJECT with InnerObjectTypePair<SFieldNames::field_sfSignerEntry, struct InnerObject_sfSignerEntry>,
* 2. Replace INNER_OBJECT with
* InnerObjectTypePair<SFieldNames::field_sfSignerEntry, struct
* InnerObject_sfSignerEntry>,
* 3. Replace INNER_OBJECT_END with void>;
*
* The resulting code is:
* using InnerObjectTypesArray = std::tuple<InnerObjectTypePair<SFieldNames::field_sfSignerEntry, struct InnerObject_sfSignerEntry>, void>;
* which we're defining a tuple with some pairs inside. When we want to look up a type from the field name,
* we iterate through the tuple and then return the pair that the field name is the same as the one we're looking for.
* The type struct InnerObject_sfSignerEntry yet to be defined, but we'll define it later.
* using InnerObjectTypesArray =
* std::tuple<InnerObjectTypePair<SFieldNames::field_sfSignerEntry, struct
* InnerObject_sfSignerEntry>, void>; which we're defining a tuple with some
* pairs inside. When we want to look up a type from the field name, we iterate
* through the tuple and then return the pair that the field name is the same as
* the one we're looking for. The type struct InnerObject_sfSignerEntry yet to
* be defined, but we'll define it later.
*/
#pragma push_macro("INNER_OBJECT")
#pragma push_macro("FIELDS")
@@ -639,9 +649,12 @@ struct GetFieldValue<
*
* INNER_OBJECT_END
*
* 1. We leave INNER_OBJECT_BEGIN and INNER_OBJECT_END empty as we don't need them
* 2. Replace INNER_OBJECT with struct InnerObject_sfSignerEntry with some methods defined
* 3. Replace FIELD with auto fsfSignerEntry() that returns the value of this field
* 1. We leave INNER_OBJECT_BEGIN and INNER_OBJECT_END empty as we don't need
* them
* 2. Replace INNER_OBJECT with struct InnerObject_sfSignerEntry with some
* methods defined
* 3. Replace FIELD with auto fsfSignerEntry() that returns the value of this
* field
*
* In the end, we'll have a struct like the following:
* struct InnerObject_sfSignerEntry
@@ -761,7 +774,8 @@ struct LedgerEntry
/*
* We're defining ledger entries here.
* This is very similar to what happens above, and in the end, we'll have something like:
* This is very similar to what happens above, and in the end, we'll have
* something like:
*
* struct LedgerEntry<ltCheck>
* {