Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
AmendmentCenterInterface.hpp
1#pragma once
2
3#include "data/Types.hpp"
4
5#include <boost/asio/spawn.hpp>
6
7#include <cstdint>
8#include <map>
9#include <string>
10#include <vector>
11
12namespace data {
13
18public:
19 virtual ~AmendmentCenterInterface() = default;
20
27 [[nodiscard]] virtual bool
28 isSupported(AmendmentKey const& key) const = 0;
29
35 [[nodiscard]] virtual std::map<std::string, Amendment> const&
36 getSupported() const = 0;
37
43 [[nodiscard]] virtual std::vector<Amendment> const&
44 getAll() const = 0;
45
53 [[nodiscard]] virtual bool
54 isEnabled(AmendmentKey const& key, uint32_t seq) const = 0;
55
64 [[nodiscard]] virtual bool
65 isEnabled(boost::asio::yield_context yield, AmendmentKey const& key, uint32_t seq) const = 0;
66
75 [[nodiscard]] virtual std::vector<bool>
77 boost::asio::yield_context yield,
78 std::vector<AmendmentKey> const& keys,
79 uint32_t seq
80 ) const = 0;
81
88 [[nodiscard]] virtual Amendment const&
89 getAmendment(AmendmentKey const& key) const = 0;
90
97 [[nodiscard]] virtual Amendment const&
98 operator[](AmendmentKey const& key) const = 0;
99};
100
101} // namespace data
The interface of an amendment center.
Definition AmendmentCenterInterface.hpp:17
virtual Amendment const & operator[](AmendmentKey const &key) const =0
Get an amendment by its key.
virtual std::map< std::string, Amendment > const & getSupported() const =0
Get all supported amendments as a map.
virtual std::vector< bool > isEnabled(boost::asio::yield_context yield, std::vector< AmendmentKey > const &keys, uint32_t seq) const =0
Check whether an amendment was/is enabled for a given sequence.
virtual std::vector< Amendment > const & getAll() const =0
Get all known amendments.
virtual Amendment const & getAmendment(AmendmentKey const &key) const =0
Get an amendment.
virtual bool isEnabled(AmendmentKey const &key, uint32_t seq) const =0
Check whether an amendment was/is enabled for a given sequence.
virtual bool isSupported(AmendmentKey const &key) const =0
Check whether an amendment is supported by Clio.
virtual bool isEnabled(boost::asio::yield_context yield, AmendmentKey const &key, uint32_t seq) const =0
Check whether an amendment was/is enabled for a given sequence.
This namespace implements the data access layer and related components.
Definition AmendmentCenter.cpp:56
A helper for amendment name to feature conversions.
Definition Types.hpp:285
Represents an amendment in the XRPL.
Definition Types.hpp:254