Clio
develop
The XRP Ledger API server.
Theme:
Default
Round
Robot
Toggle main menu visibility
Loading...
Searching...
No Matches
BookChanges.hpp
1
#pragma once
2
3
#include "data/BackendInterface.hpp"
4
#include "
rpc/BookChangesHelper.hpp
"
5
#include "rpc/common/SpecBackend.hpp"
6
#include "rpc/common/Types.hpp"
7
8
#include <boost/json/conversion.hpp>
9
#include <boost/json/value.hpp>
10
#include <rpcspec/handlers/book_changes/Types.hpp>
11
12
#include <cstdint>
13
#include <memory>
14
#include <string>
15
#include <utility>
16
#include <vector>
17
18
namespace
rpc
{
19
25
class
BookChangesHandler
:
public
rpc::HandlerFor
<rpc::spec::handlers::book_changes::Input> {
26
std::shared_ptr<BackendInterface> sharedPtrBackend_;
27
28
public
:
32
struct
Output
{
33
std::string ledgerHash;
34
uint32_t ledgerIndex{};
35
uint32_t ledgerTime{};
36
std::vector<BookChange> bookChanges;
37
bool
validated =
true
;
38
};
39
40
using
Result =
HandlerReturnType<Output>
;
41
47
BookChangesHandler
(std::shared_ptr<BackendInterface> sharedPtrBackend)
48
: sharedPtrBackend_(std::move(sharedPtrBackend))
49
{
50
}
51
59
[[nodiscard]]
Result
60
process
(Input
const
& input,
Context
const
& ctx)
const
;
61
62
private
:
69
friend
void
70
tag_invoke
(boost::json::value_from_tag, boost::json::value& jv, Output
const
& output);
71
};
72
73
}
// namespace rpc
BookChangesHelper.hpp
rpc::BookChangesHandler::process
Result process(Input const &input, Context const &ctx) const
Process the BookChanges command.
Definition
BookChanges.cpp:24
rpc::BookChangesHandler::BookChangesHandler
BookChangesHandler(std::shared_ptr< BackendInterface > sharedPtrBackend)
Construct a new BookChangesHandler object.
Definition
BookChanges.hpp:47
rpc::BookChangesHandler::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
BookChanges.cpp:53
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
rpc::HandlerFor
spec::HandlerFor< InputT, boost::json::value > HandlerFor
The spec-driven base every typed handler inherits.
Definition
SpecBackend.hpp:24
rpc::BookChangesHandler::Output
A struct to hold the output data of the command.
Definition
BookChanges.hpp:32
rpc::Context
Context of an RPC call.
Definition
Types.hpp:98
rpc::Result
Result type used to return responses or error statuses to the Webserver subsystem.
Definition
Types.hpp:109
src
rpc
handlers
BookChanges.hpp
Generated by
1.17.0