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:
28 struct Output {
30 };
31
32 using Result = HandlerReturnType<Output>;
33
39 LedgerRangeHandler(std::shared_ptr<BackendInterface> sharedPtrBackend)
40 : sharedPtrBackend_(std::move(sharedPtrBackend))
41 {
42 }
43
50 Result
51 process(Context const& ctx) const;
52
53private:
60 friend void
61 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output const& output);
62};
63} // namespace rpc
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:23
LedgerRangeHandler(std::shared_ptr< BackendInterface > sharedPtrBackend)
Construct a new LedgerRangeHandler object.
Definition LedgerRange.hpp:39
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:18
std::expected< OutputType, Status > HandlerReturnType
Return type for each individual handler.
Definition Types.hpp:62
Stores a range of sequences as a min and max pair.
Definition Types.hpp:243
Context of an RPC call.
Definition Types.hpp:99
A struct to hold the output data of the command.
Definition LedgerRange.hpp:28
Result type used to return responses or error statuses to the Webserver subsystem.
Definition Types.hpp:110