RESTinio
null_timer_manager.hpp
Go to the documentation of this file.
1/*
2 restinio
3*/
4
9#pragma once
10
11#include <chrono>
12
14
16
17namespace restinio
18{
19
20//
21// null_timer_manager_t
22//
23
26{
29 {
30 // Schedule timeouts check invocation.
31 template <typename... Args >
32 constexpr void schedule( Args &&... ) const noexcept {}
33
34 // Cancel timeout guard if any.
35 constexpr void cancel() const noexcept {}
36 };
37
38 // Create guard for connection.
39 constexpr timer_guard_t
40 create_timer_guard() const noexcept { return timer_guard_t{}; }
41
44 constexpr void start() const noexcept {}
45 constexpr void stop() const noexcept {}
47
48 struct factory_t final
49 {
50 auto
51 create( asio_ns::io_context & ) const
52 {
53 return std::make_shared< null_timer_manager_t >();
54 }
55 };
56};
57
58} /* namespace restinio */
auto create(asio_ns::io_context &) const
constexpr void schedule(Args &&...) const noexcept
Timer factory implementation using asio timers.
constexpr void stop() const noexcept
constexpr void start() const noexcept
Start/stop timer manager.
constexpr timer_guard_t create_timer_guard() const noexcept
#define const
Definition: zconf.h:230