rippled
Loading...
Searching...
No Matches
LedgerFormats.cpp
1#include <xrpl/protocol/LedgerFormats.h>
2#include <xrpl/protocol/SField.h>
3#include <xrpl/protocol/SOTemplate.h>
4#include <xrpl/protocol/jss.h>
5
6#include <initializer_list>
7
8namespace xrpl {
9
11{
12 // Fields shared by all ledger formats:
13 static std::initializer_list<SOElement> const commonFields{
14 {sfLedgerIndex, soeOPTIONAL},
15 {sfLedgerEntryType, soeREQUIRED},
16 {sfFlags, soeREQUIRED},
17 };
18
19#pragma push_macro("UNWRAP")
20#undef UNWRAP
21#pragma push_macro("LEDGER_ENTRY")
22#undef LEDGER_ENTRY
23
24#define UNWRAP(...) __VA_ARGS__
25#define LEDGER_ENTRY(tag, value, name, rpcName, fields) add(jss::name, tag, UNWRAP fields, commonFields);
26
27#include <xrpl/protocol/detail/ledger_entries.macro>
28
29#undef LEDGER_ENTRY
30#pragma pop_macro("LEDGER_ENTRY")
31#undef UNWRAP
32#pragma pop_macro("UNWRAP")
33}
34
35LedgerFormats const&
37{
38 static LedgerFormats instance;
39 return instance;
40}
41
42} // namespace xrpl
Holds the list of known ledger entry formats.
LedgerFormats()
Create the object.
static LedgerFormats const & getInstance()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
@ soeOPTIONAL
Definition SOTemplate.h:17
@ soeREQUIRED
Definition SOTemplate.h:16