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 ripple {
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) \
26 add(jss::name, tag, UNWRAP fields, commonFields);
27
28#include <xrpl/protocol/detail/ledger_entries.macro>
29
30#undef LEDGER_ENTRY
31#pragma pop_macro("LEDGER_ENTRY")
32#undef UNWRAP
33#pragma pop_macro("UNWRAP")
34}
35
36LedgerFormats const&
38{
39 static LedgerFormats instance;
40 return instance;
41}
42
43} // namespace ripple
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