Malloy
Loading...
Searching...
No Matches
malloy::server::routing_context Class Reference

A high-level controller. More...

#include <routing_context.hpp>

Classes

struct  config

Public Types

using session = malloy::detail::controller_run_result<std::shared_ptr<malloy::server::listener>>

Public Member Functions

 routing_context (config cfg)
 routing_context (const routing_context &other)=delete
 routing_context (routing_context &&other) noexcept=default
routing_context & operator= (const routing_context &rhs)=delete
routing_context & operator= (routing_context &&rhs) noexcept=default
bool init_tls (const std::filesystem::path &cert_path, const std::filesystem::path &key_path)
bool init_tls (const std::string &cert, const std::string &key)
constexpr const malloy::server::router & router () const noexcept
constexpr malloy::server::router & router () noexcept

Friends

session start (routing_context &&ctrl)

Detailed Description

A high-level controller.

This is a high-level controller for convenience. It will setup the necessary I/O context and worker threads.

Member Function Documentation

◆ init_tls() [1/2]

bool routing_context::init_tls ( const std::filesystem::path & cert_path,
const std::filesystem::path & key_path )

Initialize the TLS context.

Note
This must be called after init() but before start() if TLS is to be used.
Parameters
cert_pathPath to the certificate file.
key_pathPath to the key file.
Returns
Whether the initialization was successful.
Here is the call graph for this function:

◆ init_tls() [2/2]

bool routing_context::init_tls ( const std::string & cert,
const std::string & key )

Initialize the TLS context.

Note
This must be called after init() but before start() if TLS is to be used.
Parameters
certThe certificate file (contents).
keyThe key file (contents).
Returns
Whether the initialization was successful.
Here is the call graph for this function:

◆ router() [1/2]

const malloy::server::router & malloy::server::routing_context::router ( ) const
inlinenodiscardconstexprnoexcept

Get the top-level router.

Returns
The top-level router.

◆ router() [2/2]

malloy::server::router & malloy::server::routing_context::router ( )
inlinenodiscardconstexprnoexcept

Get the top-level router.

Returns
The top-level router.

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