From 9248f60a0917b8bffc5a97c1f1d94f3aee4b5fae Mon Sep 17 00:00:00 2001 From: JCW Date: Fri, 11 Jul 2025 17:19:27 +0100 Subject: [PATCH] Fix formatting --- include/xrpl/protocol/TypedLedgerEntries.h | 46 ++++++++++++++-------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/include/xrpl/protocol/TypedLedgerEntries.h b/include/xrpl/protocol/TypedLedgerEntries.h index a43e36b7ee..c54341222e 100644 --- a/include/xrpl/protocol/TypedLedgerEntries.h +++ b/include/xrpl/protocol/TypedLedgerEntries.h @@ -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:: 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 static std::conditional_t< !std::is_void_v, @@ -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, + * 2. Replace INNER_OBJECT with + * InnerObjectTypePair, * 3. Replace INNER_OBJECT_END with void>; * * The resulting code is: - * using InnerObjectTypesArray = std::tuple, 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, 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 * {