Clio
develop
The XRP Ledger API server.
Theme:
Default
Round
Robot
Toggle main menu visibility
Loading...
Searching...
No Matches
LedgerRange.hpp
1
#pragma once
2
3
#include "data/BackendInterface.hpp"
4
#include "data/Types.hpp"
5
#include "rpc/common/Types.hpp"
6
7
#include <boost/json.hpp>
8
#include <boost/json/conversion.hpp>
9
#include <boost/json/value.hpp>
10
11
#include <memory>
12
13
namespace
rpc
{
14
21
class
LedgerRangeHandler
{
22
std::shared_ptr<BackendInterface> sharedPtrBackend_;
23
24
public
:
28
struct
Output
{
29
data::LedgerRange
range;
30
};
31
32
using
Result =
HandlerReturnType<Output>
;
33
39
LedgerRangeHandler
(std::shared_ptr<BackendInterface> sharedPtrBackend)
40
: sharedPtrBackend_(std::move(sharedPtrBackend))
41
{
42
}
43
50
[[nodiscard]]
Result
51
process
(
Context
const
& ctx)
const
;
52
53
private
:
60
friend
void
61
tag_invoke
(boost::json::value_from_tag, boost::json::value& jv, Output
const
& output);
62
};
63
}
// namespace rpc
rpc::LedgerRangeHandler::tag_invoke
friend void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Output const &output)
Convert the Output to a JSON object.
Definition
LedgerRange.cpp:24
rpc::LedgerRangeHandler::LedgerRangeHandler
LedgerRangeHandler(std::shared_ptr< BackendInterface > sharedPtrBackend)
Construct a new LedgerRangeHandler object.
Definition
LedgerRange.hpp:39
rpc::LedgerRangeHandler::process
Result process(Context const &ctx) const
Process the LedgerRange command.
Definition
LedgerRange.cpp:16
rpc
This namespace contains all the RPC logic and handlers.
Definition
AMMHelpers.cpp:17
rpc::HandlerReturnType
std::expected< OutputType, Status > HandlerReturnType
Return type for each individual handler.
Definition
Types.hpp:61
data::LedgerRange
Stores a range of sequences as a min and max pair.
Definition
Types.hpp:243
rpc::Context
Context of an RPC call.
Definition
Types.hpp:98
rpc::LedgerRangeHandler::Output
A struct to hold the output data of the command.
Definition
LedgerRange.hpp:28
rpc::Result
Result type used to return responses or error statuses to the Webserver subsystem.
Definition
Types.hpp:109
src
rpc
handlers
LedgerRange.hpp
Generated by
1.17.0