File tree Expand file tree Collapse file tree 4 files changed +9
-37
lines changed
Expand file tree Collapse file tree 4 files changed +9
-37
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,11 @@ struct async_context : detail::immovable {
5151 class interrupt_type {
5252 public:
5353 /* * @brief Calls the underlying interrupt. */
54- auto operator ()() const -> void;
54+ inline auto operator ()() const -> void;
5555 /* * @brief Assigns a function to the underlying interrupt. */
56- auto operator =(std::function<void ()> func) noexcept -> interrupt_type &;
56+ inline auto operator =(std::function<void ()> func) noexcept -> interrupt_type &;
5757 /* * @brief Tests to see if the interrupt has been assigned to. */
58- explicit operator bool () const noexcept ;
58+ inline explicit operator bool () const noexcept ;
5959
6060 private:
6161 /* * @brief The underlying interrupt function. */
@@ -157,6 +157,7 @@ template <ServiceLike Service> class async_service : public async_context {
157157
158158} // namespace cloudbus::service
159159
160+ #include " impl/async_context_impl.hpp" // IWYU pragma: export
160161#include " impl/async_service_impl.hpp" // IWYU pragma: export
161162
162163#endif // CLOUDBUS_ASYNC_SERVICE_HPP
Original file line number Diff line number Diff line change 1919 * @brief This file defines the asynchronous service.
2020 */
2121#pragma once
22- #ifndef CLOUDBUS_ASYNC_SERVICE_IMPL_HPP
23- #define CLOUDBUS_ASYNC_SERVICE_IMPL_HPP
22+ #ifndef CLOUDBUS_ASYNC_CONTEXT_IMPL_HPP
23+ #define CLOUDBUS_ASYNC_CONTEXT_IMPL_HPP
2424#include " segment/detail/with_lock.hpp"
2525#include " segment/service/async_service.hpp"
2626
@@ -56,4 +56,4 @@ inline async_context::interrupt_type::operator bool() const noexcept
5656 return static_cast <bool >(fn_);
5757}
5858} // namespace cloudbus::service
59- #endif // CLOUDBUS_ASYNC_SERVICE_IMPL_HPP
59+ #endif // CLOUDBUS_ASYNC_CONTEXT_IMPL_HPP
Original file line number Diff line number Diff line change 2626
2727#include < stdexec/execution.hpp>
2828namespace cloudbus ::service {
29-
30- auto async_context::signal (int signum) -> void
31- {
32- assert (signum >= 0 && signum < END && " signum must be a valid signal." );
33- sigmask.fetch_or (1 << signum);
34- if (interrupt)
35- interrupt ();
36- }
37-
38- auto async_context::interrupt_type::operator ()() const -> void
39- {
40- using namespace detail ;
41- auto func = with_lock (std::unique_lock{mtx_}, [&] { return fn_; });
42- func ();
43- }
44-
45- auto async_context::interrupt_type::operator =(
46- std::function<void ()> func) noexcept -> interrupt_type &
47- {
48- std::lock_guard lock{mtx_};
49- fn_ = std::move (func);
50- return *this ;
51- }
52-
53- async_context::interrupt_type::operator bool () const noexcept
54- {
55- std::lock_guard lock{mtx_};
56- return static_cast <bool >(fn_);
57- }
58-
5929template <ServiceLike Service>
6030template <typename Fn>
6131 requires std::is_invocable_r_v<bool , Fn>
Original file line number Diff line number Diff line change 1818 * @brief This file defines an asynchronous tcp service.
1919 */
2020#pragma once
21- #include < system_error>
2221#ifndef CLOUDBUS_ASYNC_TCP_SERVICE_IMPL_HPP
2322#define CLOUDBUS_ASYNC_TCP_SERVICE_IMPL_HPP
2423#include " segment/service/async_tcp_service.hpp"
24+
25+ #include < system_error>
2526namespace cloudbus ::service {
2627template <typename TCPStreamHandler>
2728template <typename T>
You can’t perform that action at this time.
0 commit comments