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
35
using
Result
=
HandlerReturnType<Output>
;
36
42
LedgerRangeHandler
(std::shared_ptr<BackendInterface> sharedPtrBackend)
43
: sharedPtrBackend_(std::move(sharedPtrBackend))
44
{
45
}
46
53
[[nodiscard]]
Result
54
process
(
Context
const
& ctx)
const
;
55
56
private
:
63
friend
void
64
tag_invoke
(boost::json::value_from_tag, boost::json::value& jv, Output
const
& output);
65
};
66
}
// namespace rpc
rpc::LedgerRangeHandler::Result
HandlerReturnType< Output > Result
The result type of the command: either the Output or an error status.
Definition
LedgerRange.hpp:35
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:42
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:63
data::LedgerRange
Stores a range of sequences as a min and max pair.
Definition
Types.hpp:246
rpc::Context
Context of an RPC call.
Definition
Types.hpp:102
rpc::LedgerRangeHandler::Output
A struct to hold the output data of the command.
Definition
LedgerRange.hpp:28
rpc::LedgerRangeHandler::Output::range
data::LedgerRange range
Range of ledgers available in the database.
Definition
LedgerRange.hpp:29
rpc::Result
Result type used to return responses or error statuses to the Webserver subsystem.
Definition
Types.hpp:132
src
rpc
handlers
LedgerRange.hpp
Generated by
1.17.0