$darkmode
oak::ServerImplHandler Class Reference

#include <server.hpp>

Public Member Functions

void operator() (ServerImpl::request const &, ServerImpl::connection_ptr)
 
void log (const ServerImpl::string_type &msg)
 
void add (const std::string &key, Handler h)
 
std::vector< std::string > endpoints () const
 
cloe::Json endpoints_to_json (const std::vector< std::string > &endpoints) const
 

Detailed Description

ServerImplHandler is the main request handler for the server.

It implements an interface defined by boost::network::http::server.

Member Function Documentation

◆ add()

void oak::ServerImplHandler::add ( const std::string &  key,
Handler  h 
)

Add a handler for a specific endpoint.

◆ endpoints()

std::vector<std::string> oak::ServerImplHandler::endpoints ( ) const
inline

Return a list of all registered endpoints.

◆ endpoints_to_json()

cloe::Json oak::ServerImplHandler::endpoints_to_json ( const std::vector< std::string > &  endpoints) const

Return endpoint data in json format.

◆ log()

void oak::ServerImplHandler::log ( const ServerImpl::string_type &  msg)

Log an error from the server.

◆ operator()()

void oak::ServerImplHandler::operator() ( ServerImpl::request const &  request,
ServerImpl::connection_ptr  conn 
)

Handle every request from the server.

Every single request that passes through the server has to go through this handler. If the muxer has an endpoint that matches the request, then it gets passed through. The muxer has a default endpoint, so the nominal case is that every request is passed to some handler from the muxer.


The documentation for this class was generated from the following files: