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
13#include <restinio/asio_include.hpp>
14
15#include <restinio/timer_common.hpp>
16
17 namespace restinio
18{
19
20//
21// null_timer_manager_t
22//
23
25 struct null_timer_manager_t final
26{
28 struct timer_guard_t
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 */
asio_include.hpp
restinio
Definition: asio_include.hpp:21
restinio::null_timer_manager_t::factory_t
Definition: null_timer_manager.hpp:49
restinio::null_timer_manager_t::factory_t::create
auto create(asio_ns::io_context &) const
Definition: null_timer_manager.hpp:51
restinio::null_timer_manager_t::timer_guard_t
Timer guard for async operations.
Definition: null_timer_manager.hpp:29
restinio::null_timer_manager_t::timer_guard_t::cancel
constexpr void cancel() const noexcept
Definition: null_timer_manager.hpp:35
restinio::null_timer_manager_t::timer_guard_t::schedule
constexpr void schedule(Args &&...) const noexcept
Definition: null_timer_manager.hpp:32
restinio::null_timer_manager_t
Timer factory implementation using asio timers.
Definition: null_timer_manager.hpp:26
restinio::null_timer_manager_t::stop
constexpr void stop() const noexcept
Definition: null_timer_manager.hpp:45
restinio::null_timer_manager_t::start
constexpr void start() const noexcept
Start/stop timer manager.
Definition: null_timer_manager.hpp:44
restinio::null_timer_manager_t::create_timer_guard
constexpr timer_guard_t create_timer_guard() const noexcept
Definition: null_timer_manager.hpp:40
timer_common.hpp
const
#define const
Definition: zconf.h:230