#include #include #include #include // IWYU pragma: keep #include namespace xrpl { std::vector const& LedgerFormats::getCommonFields() { static auto const kCommonFields = std::vector{ {sfLedgerIndex, SoeOptional}, {sfLedgerEntryType, SoeRequired}, {sfFlags, SoeRequired}, }; return kCommonFields; } LedgerFormats::LedgerFormats() { #pragma push_macro("UNWRAP") #undef UNWRAP #pragma push_macro("LEDGER_ENTRY") #undef LEDGER_ENTRY #define UNWRAP(...) __VA_ARGS__ #define LEDGER_ENTRY(tag, value, name, rpcName, fields) \ add(jss::name, tag, UNWRAP fields, getCommonFields()); #include #undef LEDGER_ENTRY #pragma pop_macro("LEDGER_ENTRY") #undef UNWRAP #pragma pop_macro("UNWRAP") } LedgerFormats const& LedgerFormats::getInstance() { static LedgerFormats const kInstance; return kInstance; } } // namespace xrpl