xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
libxrpl
protocol
LedgerFormats.cpp
1
#include <xrpl/protocol/LedgerFormats.h>
2
3
#include <xrpl/protocol/SField.h>
4
#include <xrpl/protocol/SOTemplate.h>
5
#include <xrpl/protocol/jss.h>
// IWYU pragma: keep
6
7
#include <
vector
>
8
9
namespace
xrpl
{
10
11
std::vector<SOElement>
const
&
12
LedgerFormats::getCommonFields
()
13
{
14
static
auto
const
kCommonFields =
std::vector<SOElement>
{
15
{sfLedgerIndex,
SoeOptional
},
16
{sfLedgerEntryType,
SoeRequired
},
17
{sfFlags,
SoeRequired
},
18
{sfSponsor,
SoeOptional
},
19
};
20
return
kCommonFields;
21
}
22
23
LedgerFormats::LedgerFormats
()
24
{
25
#pragma push_macro("UNWRAP")
26
#undef UNWRAP
27
#pragma push_macro("LEDGER_ENTRY")
28
#undef LEDGER_ENTRY
29
30
#define UNWRAP(...) __VA_ARGS__
31
#define LEDGER_ENTRY(tag, value, name, rpcName, fields) \
32
add(jss::name, tag, UNWRAP fields, getCommonFields());
33
34
#include <xrpl/protocol/detail/ledger_entries.macro>
35
36
#undef LEDGER_ENTRY
37
#pragma pop_macro("LEDGER_ENTRY")
38
#undef UNWRAP
39
#pragma pop_macro("UNWRAP")
40
}
41
42
LedgerFormats
const
&
43
LedgerFormats::getInstance
()
44
{
45
static
LedgerFormats
const
kInstance;
46
return
kInstance;
47
}
48
49
}
// namespace xrpl
xrpl::LedgerFormats
Holds the list of known ledger entry formats.
Definition
LedgerFormats.h:303
xrpl::LedgerFormats::getCommonFields
static std::vector< SOElement > const & getCommonFields()
Definition
LedgerFormats.cpp:12
xrpl::LedgerFormats::LedgerFormats
LedgerFormats()
Create the object.
Definition
LedgerFormats.cpp:23
xrpl::LedgerFormats::getInstance
static LedgerFormats const & getInstance()
Definition
LedgerFormats.cpp:43
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::SoeOptional
@ SoeOptional
Definition
SOTemplate.h:23
xrpl::SoeRequired
@ SoeRequired
Definition
SOTemplate.h:22
vector
Generated by
1.17.0