Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
rpc::BaseServerInfoHandler< CountersType, ClockType > Class Template Reference

Contains common functionality for handling the server_info command. More...

#include <ServerInfo.hpp>

Inheritance diagram for rpc::BaseServerInfoHandler< CountersType, ClockType >:
Collaboration diagram for rpc::BaseServerInfoHandler< CountersType, ClockType >:

Classes

struct  AdminSection
 A struct to hold the admin section of the output. More...
struct  ValidatedLedgerSection
 A struct to hold the validated ledger section of the output. More...
struct  CacheSection
 A struct to hold the cache section of the output. More...
struct  InfoSection
 A struct to hold the info section of the output. More...
struct  Output
 A struct to hold the output data of the command. More...

Public Types

using Result = HandlerReturnType<Output>
 The result type of the command: either the Output or an error status.

Public Member Functions

 BaseServerInfoHandler (std::shared_ptr< BackendInterface > backend, std::shared_ptr< feed::SubscriptionManagerInterface > subscriptions, std::shared_ptr< etl::LoadBalancerInterface > balancer, std::shared_ptr< etl::ETLServiceInterface const > etl, CountersType const &counters)
 Construct a new BaseServerInfoHandler object.
Result process (Input const &input, Context const &ctx) const
 Process the ServerInfo command.

Friends

void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, Output const &output)
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, InfoSection const &info)
 Convert the InfoSection to a JSON object.
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, ValidatedLedgerSection const &validated)
 Convert the ValidatedLedgerSection to a JSON object.
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, CacheSection const &cache)
 Convert the CacheSection to a JSON object.

Detailed Description

template<typename CountersType, util::SomeSystemClock ClockType = std::chrono::system_clock>
class rpc::BaseServerInfoHandler< CountersType, ClockType >

Contains common functionality for handling the server_info command.

Template Parameters
CountersTypeThe type of the counters
ClockTypeClock used for the output time and the ledger age

Constructor & Destructor Documentation

◆ BaseServerInfoHandler()

template<typename CountersType, util::SomeSystemClock ClockType = std::chrono::system_clock>
rpc::BaseServerInfoHandler< CountersType, ClockType >::BaseServerInfoHandler ( std::shared_ptr< BackendInterface > backend,
std::shared_ptr< feed::SubscriptionManagerInterface > subscriptions,
std::shared_ptr< etl::LoadBalancerInterface > balancer,
std::shared_ptr< etl::ETLServiceInterface const > etl,
CountersType const & counters )
inline

Construct a new BaseServerInfoHandler object.

Parameters
backendThe backend to use
subscriptionsThe subscription manager to use
balancerThe load balancer to use
etlThe ETL service to use
countersThe counters to use

Member Function Documentation

◆ process()

template<typename CountersType, util::SomeSystemClock ClockType = std::chrono::system_clock>
Result rpc::BaseServerInfoHandler< CountersType, ClockType >::process ( Input const & input,
Context const & ctx ) const
inlinenodiscard

Process the ServerInfo command.

Parameters
inputThe input data for the command
ctxThe context of the request
Returns
The result of the operation

◆ tag_invoke [1/3]

template<typename CountersType, util::SomeSystemClock ClockType = std::chrono::system_clock>
void tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
CacheSection const & cache )
friend

Convert the CacheSection to a JSON object.

Parameters
[out]jvThe JSON object to convert to
cacheThe cache section to convert

◆ tag_invoke [2/3]

template<typename CountersType, util::SomeSystemClock ClockType = std::chrono::system_clock>
void tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
InfoSection const & info )
friend

Convert the InfoSection to a JSON object.

Parameters
[out]jvThe JSON object to convert to
infoThe info section to convert

◆ tag_invoke [3/3]

template<typename CountersType, util::SomeSystemClock ClockType = std::chrono::system_clock>
void tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
ValidatedLedgerSection const & validated )
friend

Convert the ValidatedLedgerSection to a JSON object.

Parameters
[out]jvThe JSON object to convert to
validatedThe validated ledger section to convert

The documentation for this class was generated from the following file: