MCPcopy Create free account
hub / github.com/3rdparty/libprocess / route

Method route

include/process/process.hpp:286–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284 */
285 template <typename T>
286 void route(
287 const std::string& name,
288 const Option<std::string>& help,
289 Future<http::Response> (T::*method)(const http::Request&),
290 const RouteOptions& options = RouteOptions())
291 {
292 // Note that we use dynamic_cast here so a process can use
293 // multiple inheritance if it sees so fit (e.g., to implement
294 // multiple callback interfaces).
295 HttpRequestHandler handler =
296 lambda::bind(method, dynamic_cast<T*>(this), lambda::_1);
297 route(name, help, handler, options);
298 }
299
300 /**
301 * Any function which takes a `process::http::Request` and an

Callers

nothing calls this directly

Calls 3

RouteOptionsClass · 0.85
bindFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected