RESTinio
executor_wrapper.hpp
Go to the documentation of this file.
1 /*
2  restinio
3 */
4 
5 /*!
6  Execution mixin.
7 */
8 
9 #pragma once
10 
11 
12 namespace restinio
13 {
14 
15 namespace impl
16 {
17 
18 //
19 // executor_wrapper_t
20 //
21 
22 //! Wrapper for an executor (strand) used by connections.
23 template < typename Executor >
25 {
26  public:
27  template < typename Init_Executor >
28  executor_wrapper_t( Init_Executor && init_executor )
30  {}
31 
32  virtual ~executor_wrapper_t() = default;
33 
34  //! An executor for callbacks on async operations.
35  Executor & get_executor() noexcept { return m_executor; }
36 
37  private:
38  //! Sync object for connection events.
39  Executor m_executor;
40 };
41 
42 
43 } /* namespace impl */
44 
45 } /* namespace restinio */
Executor m_executor
Sync object for connection events.
virtual ~executor_wrapper_t()=default
Executor & get_executor() noexcept
An executor for callbacks on async operations.
Wrapper for an executor (strand) used by connections.
executor_wrapper_t(Init_Executor &&init_executor)
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, optional_t< Value_Type > >::type opt_value(const Parameter_Container &params, string_view_t key)
Gets the value of a parameter specified by key wrapped in optional_t<Value_Type> if parameter exists ...
Definition: value_or.hpp:64