3#include "data/AmendmentCenterInterface.hpp"
4#include "data/BackendInterface.hpp"
5#include "rpc/common/Types.hpp"
7#include <boost/json/conversion.hpp>
8#include <boost/json/value.hpp>
9#include <rpcspec/HandlerFor.hpp>
10#include <rpcspec/handlers/feature/Types.hpp>
23class FeatureHandler :
public rpc::spec::HandlerFor<rpc::spec::handlers::feature::Input> {
24 std::shared_ptr<BackendInterface> sharedPtrBackend_;
25 std::shared_ptr<data::AmendmentCenterInterface const> amendmentCenter_;
38 bool supported =
false;
42 std::map<std::string, Feature> features;
43 std::string ledgerHash;
44 uint32_t ledgerIndex{};
48 bool inlineResult =
false;
51 bool validated =
true;
63 std::shared_ptr<BackendInterface> sharedPtrBackend,
64 std::shared_ptr<data::AmendmentCenterInterface const>
const& amendmentCenter
66 : sharedPtrBackend_(std::move(sharedPtrBackend)), amendmentCenter_(amendmentCenter)
91 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output
const& output);
100 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output::Feature
const& feature);
Result process(Input const &input, Context const &ctx) const
Process the Feature command.
Definition Feature.cpp:29
friend void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Output const &output)
Convert the Output to a JSON object.
Definition Feature.cpp:96
FeatureHandler(std::shared_ptr< BackendInterface > sharedPtrBackend, std::shared_ptr< data::AmendmentCenterInterface const > const &amendmentCenter)
Construct a new FeatureHandler object.
Definition Feature.hpp:62
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:61
Context of an RPC call.
Definition Types.hpp:98
Represents an amendment/feature.
Definition Feature.hpp:35
A struct to hold the output data of the command.
Definition Feature.hpp:31
Result type used to return responses or error statuses to the Webserver subsystem.
Definition Types.hpp:109