|
C++ Actor Framework 0.19
|
Represents a single route for HTTP requests at a server. More...
#include <route.hpp>
Public Member Functions | |
| virtual bool | exec (const request_header &hdr, const_byte_span body, router *parent)=0 |
| Tries to match an HTTP request and processes the request on a match. | |
| virtual void | init () |
| Called by the HTTP server when starting up. | |
Public Member Functions inherited from caf::detail::atomic_ref_counted | |
| atomic_ref_counted (const atomic_ref_counted &) | |
| atomic_ref_counted & | operator= (const atomic_ref_counted &) |
| void | ref () const noexcept |
| Increases reference count by one. | |
| void | deref () const noexcept |
Decreases reference count by one and calls request_deletion when it drops to zero. | |
| bool | unique () const noexcept |
| Queries whether there is exactly one reference. | |
| size_t | get_reference_count () const noexcept |
| Queries the current reference count for this object. | |
Additional Inherited Members | |
Public Types inherited from caf::ref_counted | |
| using | super = detail::atomic_ref_counted |
Protected Attributes inherited from caf::detail::atomic_ref_counted | |
| std::atomic< size_t > | rc_ |
Related Functions inherited from caf::ref_counted | |
| template<class T , class... Ts> | |
| intrusive_cow_ptr< T > | make_copy_on_write (Ts &&... xs) |
Constructs an object of type T in an intrusive_cow_ptr. | |
| template<class T , class... Ts> | |
| intrusive_ptr< T > | make_counted (Ts &&... xs) |
Constructs an object of type T in an intrusive_ptr. | |
Represents a single route for HTTP requests at a server.
|
pure virtual |
Tries to match an HTTP request and processes the request on a match.
The route may send errors to the client or call shutdown on the parent for severe errors.
| hdr | The HTTP request header from the client. |
| body | The payload from the client. |
| parent | Pointer to the object that uses this route. |
true if the route matches the request, false otherwise. Implemented in caf::detail::http_route_base< Ts >, caf::detail::http_route_base< Ts... >, caf::detail::http_simple_route_base, and caf::detail::http_catch_all_route_impl< F >.
|
virtual |
Called by the HTTP server when starting up.
May be used to spin up workers that the path dispatches to. The default implementation does nothing.