MCPcopy Create free account
hub / github.com/Kitware/CMake / registerHandler

Method registerHandler

Utilities/cmcppdap/include/dap/session.h:340–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338
339template <typename F, typename RequestType>
340Session::IsRequestHandlerWithoutCallback<F> Session::registerHandler(
341 F&& handler) {
342 using ResponseType = typename RequestType::Response;
343 const TypeInfo* typeinfo = TypeOf<RequestType>::type();
344 registerHandler(typeinfo,
345 [handler](const void* args,
346 const RequestHandlerSuccessCallback& onSuccess,
347 const RequestHandlerErrorCallback& onError) {
348 ResponseOrError<ResponseType> res =
349 handler(*reinterpret_cast<const RequestType*>(args));
350 if (res.error) {
351 onError(TypeOf<ResponseType>::type(), res.error);
352 } else {
353 onSuccess(TypeOf<ResponseType>::type(), &res.response);
354 }
355 });
356}
357
358template <typename F, typename RequestType, typename ResponseType>
359Session::IsRequestHandlerWithCallback<F, ResponseType> Session::registerHandler(

Callers

nothing calls this directly

Calls 1

typeClass · 0.50

Tested by

no test coverage detected