A type-erased Handler that can contain any (NextGen) RPC handler class.
More...
#include <AnyHandler.hpp>
|
| template<SomeHandler HandlerType, typename ProcessingStrategy = impl::DefaultProcessor<HandlerType>> |
| | AnyHandler (HandlerType &&handler) |
| | Type-erases any handler class.
|
| ReturnType | process (boost::json::value const &value, Context const &ctx) const |
| | Process incoming JSON by the stored handler.
|
A type-erased Handler that can contain any (NextGen) RPC handler class.
This allows to store different handlers in one map/vector etc. Support for copying was added in order to allow storing in a map/unordered_map using the initializer_list constructor.
◆ AnyHandler()
template<SomeHandler HandlerType, typename ProcessingStrategy = impl::DefaultProcessor<HandlerType>>
| rpc::AnyHandler::AnyHandler |
( |
HandlerType && | handler | ) |
|
|
inline |
Type-erases any handler class.
- Template Parameters
-
| HandlerType | The real type of wrapped handler class |
| ProcessingStrategy | A strategy that implements how processing of JSON is to be done |
- Parameters
-
◆ process()
| ReturnType rpc::AnyHandler::process |
( |
boost::json::value const & | value, |
|
|
Context const & | ctx ) const |
|
inlinenodiscard |
Process incoming JSON by the stored handler.
- Parameters
-
| value | The JSON to process |
| ctx | Request context |
- Returns
- JSON result or Status on error
The documentation for this class was generated from the following file: