null_timer_manager.hpp
Go to the documentation of this file.
/*
restinio
*/
#pragma once
#include <chrono>
#include <restinio/asio_include.hpp>
#include <restinio/timer_common.hpp>
namespace restinio
{
//
// null_timer_manager_t
//
struct null_timer_manager_t final
{
struct timer_guard_t
{
// Schedule timeouts check invocation.
template <typename... Args >
constexpr void schedule( Args &&... ) const noexcept {}
// Cancel timeout guard if any.
constexpr void cancel() const noexcept {}
};
// Create guard for connection.
constexpr timer_guard_t
create_timer_guard() const noexcept { return timer_guard_t{}; }
constexpr void start() const noexcept {}
constexpr void stop() const noexcept {}
struct factory_t final
{
auto
create( asio_ns::io_context & ) const
{
return std::make_shared< null_timer_manager_t >();
}
};
};
} /* 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