rotor
Event loop friendly C++ actor micro-framework
 
Loading...
Searching...
No Matches
system_context_asio.h
1#pragma once
2
3//
4// Copyright (c) 2019-2022 Ivan Baidakou (basiliscos) (the dot dmol at gmail dot com)
5//
6// Distributed under the MIT Software License
7//
8
9#include "rotor/arc.hpp"
10#include "rotor/system_context.h"
11#include <boost/asio.hpp>
12
13#if defined(_MSC_VER)
14#pragma warning(push)
15#pragma warning(disable : 4251)
16#endif
17
18namespace rotor {
19namespace asio {
20
21namespace asio = boost::asio;
22
23struct supervisor_asio_t;
24
27
35
37 system_context_asio_t(asio::io_context &io_context_) : io_context{io_context_} {}
38
40 inline asio::io_context &get_io_context() noexcept { return io_context; }
41
42 protected:
43 friend struct supervisor_asio_t;
44
46 asio::io_context &io_context;
47};
48
51
52} // namespace asio
53} // namespace rotor
54
55#if defined(_MSC_VER)
56#pragma warning(pop)
57#endif
typename system_context_asio_t::ptr_t system_context_ptr_t
intrusive pointer type for boost::asio system context
Definition system_context_asio.h:50
intrusive_ptr_t< supervisor_asio_t > supervisor_ptr_t
intrusive pointer for boost::asio supervisor
Definition system_context_asio.h:26
Basic namespace for all rotor functionalities.
Definition rotor.hpp:21
boost::intrusive_ptr< T > intrusive_ptr_t
alias for intrusive pointer
Definition arc.hpp:27
delivers rotor-messages on top of boost asio event loop using strand for serialization
Definition supervisor_asio.h:56
The boost::asio system context, which holds a reference to boost::asio::io_context and root superviso...
Definition system_context_asio.h:32
system_context_asio_t(asio::io_context &io_context_)
construct the context from boost::asio::io_context reference
Definition system_context_asio.h:37
asio::io_context & io_context
a reference to boost::asio::io_context
Definition system_context_asio.h:46
asio::io_context & get_io_context() noexcept
returns a reference to boost::asio::io_context
Definition system_context_asio.h:40
rotor::intrusive_ptr_t< system_context_asio_t > ptr_t
intrusive pointer type for boost::asio system context
Definition system_context_asio.h:34
The system context holds root supervisor_t (intrusive pointer) and may be loop-related details in der...
Definition system_context.h:32