rippled
Loading...
Searching...
No Matches
libxrpl
protocol
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
8
namespace
ripple
{
9
10
LedgerFormats::LedgerFormats
()
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
36
LedgerFormats
const
&
37
LedgerFormats::getInstance
()
38
{
39
static
LedgerFormats
instance;
40
return
instance;
41
}
42
43
}
// namespace ripple
ripple::LedgerFormats
Holds the list of known ledger entry formats.
Definition
LedgerFormats.h:196
ripple::LedgerFormats::LedgerFormats
LedgerFormats()
Create the object.
Definition
LedgerFormats.cpp:10
ripple::LedgerFormats::getInstance
static LedgerFormats const & getInstance()
Definition
LedgerFormats.cpp:37
initializer_list
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:6
ripple::soeOPTIONAL
@ soeOPTIONAL
Definition
SOTemplate.h:17
ripple::soeREQUIRED
@ soeREQUIRED
Definition
SOTemplate.h:16
Generated by
1.9.8