Clio  develop
The XRP Ledger API server.
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
13namespace rpc {
14
22 std::shared_ptr<BackendInterface> sharedPtrBackend_;
23
24public:
31
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
56private:
63 friend void
64 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output const& output);
65};
66} // namespace rpc
HandlerReturnType< Output > Result
The result type of the command: either the Output or an error status.
Definition LedgerRange.hpp:35
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
LedgerRangeHandler(std::shared_ptr< BackendInterface > sharedPtrBackend)
Construct a new LedgerRangeHandler object.
Definition LedgerRange.hpp:42
Result process(Context const &ctx) const
Process the LedgerRange command.
Definition LedgerRange.cpp:16
This namespace contains all the RPC logic and handlers.
Definition AMMHelpers.cpp:17
std::expected< OutputType, Status > HandlerReturnType
Return type for each individual handler.
Definition Types.hpp:63
Stores a range of sequences as a min and max pair.
Definition Types.hpp:246
Context of an RPC call.
Definition Types.hpp:102
A struct to hold the output data of the command.
Definition LedgerRange.hpp:28
data::LedgerRange range
Range of ledgers available in the database.
Definition LedgerRange.hpp:29
Result type used to return responses or error statuses to the Webserver subsystem.
Definition Types.hpp:132