JSON RPC
JSON-RPC 2.0 library for C++
|
Contains implementation details for the JSON RPC library. More...
#include <functional>
#include <tuple>
#include <type_traits>
#include <utility>
#include <nlohmann/json.hpp>
#include "exception.h"
Go to the source code of this file.
Namespaces | |
namespace | wwa |
namespace | wwa::json_rpc |
Library namespace. | |
namespace | wwa::json_rpc::details |
Contains the implementation details of the JSON RPC library. | |
Typedefs | |
template<std::size_t N, typename Seq > | |
using | wwa::json_rpc::details::offset_sequence_t = typename offset_sequence<N, Seq>::type |
Alias template for creating an offset sequence. | |
template<std::size_t I, typename A > | |
using | wwa::json_rpc::details::tuple_element = std::decay_t<std::tuple_element_t<I, A>> |
Type alias for a tuple element with decay applied. | |
Functions | |
template<typename Extra , typename Args , std::size_t... Indices> | |
constexpr auto | wwa::json_rpc::details::convert_args (const nlohmann::json ¶ms, std::index_sequence< Indices... >) |
Converts JSON parameters to a tuple of arguments based on the specified types. | |
template<typename F , typename Tuple > | |
nlohmann::json | wwa::json_rpc::details::invoke_function (F &&f, Tuple &&tuple) |
Invokes a function with the provided arguments handling void return type. | |
template<typename Extra > | |
constexpr auto | wwa::json_rpc::details::make_extra_tuple (const nlohmann::json &extra) |
Creates a tuple from the provided JSON object based on the type of Extra. | |
template<typename C > requires (std::is_class_v<std::remove_pointer_t<C>> || std::is_null_pointer_v<C>) | |
constexpr auto | wwa::json_rpc::details::make_inst_tuple (C inst) |
Creates a tuple containing the instance if it is a class pointer, or an empty tuple if it is a null pointer. | |
Contains implementation details for the JSON RPC library.
This file includes type traits for extracting function return types and argument types, as well as utilities for creating offset sequences and handling handler parameters. These details are used internally by the JSON RPC library to facilitate various operations.
It includes:
Definition in file details.h.