48 template <SomeHandler HandlerType,
typename ProcessingStrategy = impl::DefaultProcessor<HandlerType>>
50 : pimpl_{std::make_unique<Model<HandlerType, ProcessingStrategy>>(std::forward<HandlerType>(handler))}
64 pimpl_.swap(copy.pimpl_);
80 [[nodiscard]] ReturnType
83 return pimpl_->process(value, ctx);
88 virtual ~Concept() =
default;
91 process(boost::json::value
const& value,
Context const& ctx)
const = 0;
93 [[nodiscard]]
virtual std::unique_ptr<Concept>
97 template <
typename HandlerType,
typename ProcessorType>
98 struct Model : Concept {
100 ProcessorType processor;
102 Model(HandlerType&& handler) : handler{std::move(handler)}
106 [[nodiscard]] ReturnType
107 process(boost::json::value
const& value, Context
const& ctx)
const override
109 return processor(handler, value, ctx);
112 [[nodiscard]] std::unique_ptr<Concept>
113 clone()
const override
115 return std::make_unique<Model>(*
this);
120 std::unique_ptr<Concept> pimpl_;
ReturnType process(boost::json::value const &value, Context const &ctx) const
Process incoming JSON by the stored handler.
Definition AnyHandler.hpp:81