Skip to content

Commit 964fa92

Browse files
committed
Removing/replacing use of Boost deprecated APIs removed between 1.84 and 1.87.
1 parent 3644d73 commit 964fa92

17 files changed

+32
-32
lines changed

src/flow/async/async_fwd.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
* certain advanced features as mentioned above.
3939
*
4040
* - boost.asio provides the core algorithmic abilities of an optionally multi-threaded task-executing loop,
41-
* particularly through classes util::Task_engine (a/k/a `boost::asio::io_service`), util::Strand
42-
* (a/k/a `boost::asio::io_service::strand`), and util::Timer. flow::async Flow module somewhat streamlines
41+
* particularly through classes util::Task_engine (a/k/a `boost::asio::io_context`), util::Strand
42+
* (a/k/a `strand` in `boost::asio`), and util::Timer. flow::async Flow module somewhat streamlines
4343
* this API in such a way as to keep the user's focus on their conceptual async-task-driven algorithm as opposed
4444
* to details of threads, handlers, cores, etc. The async::Op opaque type is central to this streamlined API,
4545
* plus the central class Concurrent_task_loop.
@@ -177,7 +177,7 @@ using Task_asio_err = Function<void (const Error_code&)>;
177177
using Task_asio_err_sz = Function<void (const Error_code&, size_t)>;
178178

179179
/**
180-
* Short-hand for reference-counting pointer to a mutable util::Task_engine (a/k/a `boost::asio::io_service`).
180+
* Short-hand for reference-counting pointer to a mutable util::Task_engine (a/k/a `boost::asio::io_context`).
181181
* This is generally how classes in the Concurrent_task_loop hierarchy refer to their internally used
182182
* `Task_engine`s but also in advanced cases may be communicated to their user.
183183
*

src/flow/async/concurrent_task_loop.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ class Concurrent_task_loop :
622622
const Fine_time_pt& at, Scheduled_task&& task) = 0;
623623

624624
/**
625-
* Returns a pointer to *an* internal util::Task_engine (a/k/a boost.asio `io_service`) for the purpose of
625+
* Returns a pointer to *an* internal util::Task_engine (a/k/a boost.asio `io_context`) for the purpose of
626626
* performing a boost.asio `async_*()` action on some boost.asio I/O object in the immediate near future.
627627
*
628628
* The mechanics of using this are explained in Concurrent_task_loop doc header. Using this in any other

src/flow/async/detail/task_qing_thread.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace flow::async
3030

3131
/**
3232
* Internally used building block of various concrete Concurrent_task_loop subclasses that encapsulates a thread
33-
* that spawns at construction time and a dedicated-or-shared util::Task_engine (a/k/a boost.asio `io_service`)
33+
* that spawns at construction time and a dedicated-or-shared util::Task_engine (a/k/a boost.asio `io_context`)
3434
* `run()`ning in that new thread.
3535
*
3636
* This class:

src/flow/async/segregated_thread_task_loop.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class Segregated_thread_task_loop :
293293
std::vector<Task_qing_thread_ptr> m_qing_threads;
294294

295295
/**
296-
* boost.asio `Task_engine`s (a/k/a `io_service`s) used by each respective element in #m_qing_threads.
296+
* boost.asio `Task_engine`s (a/k/a `io_context`s) used by each respective element in #m_qing_threads.
297297
* It is critical that this not be modified after constructor returns, for the same thread safety reason mentioned
298298
* in the warning in #m_qing_threads doc header.
299299
*/

src/flow/async/single_thread_task_loop.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class Single_thread_task_loop :
241241
virtual util::Scheduled_task_handle schedule_at(const Fine_time_pt& at, Scheduled_task&& task);
242242

243243
/**
244-
* Returns a pointer to *the* internal util::Task_engine (a/k/a boost.asio `io_service`) for the purpose of
244+
* Returns a pointer to *the* internal util::Task_engine (a/k/a boost.asio `io_context`) for the purpose of
245245
* performing a boost.asio `async_*()` action on some boost.asio I/O object in the immediate near future.
246246
*
247247
* @return A mutable util::Task_engine to use soon. It is *allowed* to use it as long as

src/flow/async/x_thread_task_loop.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class Cross_thread_task_loop :
297297
/// N task-execution-capable worker threads whose lifetimes equal those of `*this`, all sharing #m_shared_task_engine.
298298
std::vector<Task_qing_thread_ptr> m_qing_threads;
299299

300-
/// boost.asio `Task_engine` (a/k/a `io_service`) co-used by all #m_qing_threads.
300+
/// boost.asio `Task_engine` (a/k/a `io_context`) co-used by all #m_qing_threads.
301301
Task_engine_ptr m_shared_task_engine;
302302

303303
/// See per_thread_ops(). The `boost::any` payload is always of the type async::Strand_ptr.

src/flow/log/async_file_logger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Async_file_logger::Async_file_logger(Logger* backup_logger_ptr,
8989
/* this->impl_log_flush_and_reopen() will be called on signal (or error).
9090
* Note that that function's contract (from its doc comment) is it must execute in m_async_worker (see
9191
* m_signal_set() init above in the init section of ctor).
92-
* Indeed boost::asio::io_service semantics guarantee it'll run in m_async_worker (not some
92+
* Indeed boost::asio::io_context semantics guarantee it'll run in m_async_worker (not some
9393
* no-man's-land signal handler thread of execution, as one might fear could be the case) for the same reason
9494
* the various post()ed tasks will run in m_async_worker. */
9595
m_signal_set.async_wait([this](const Error_code& sys_err_code, int sig_number)

src/flow/net_flow/asio/node.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace flow::net_flow::asio
3535
* directly in a boost.asio event loop (see reference below for background). It is possible to use the
3636
* vanilla net_flow::Node, etc., with *any* asynchronous event loop (boost.asio or native `epoll` or `select()`...) --
3737
* notably by using a glue socket, as explained in Event_set doc header. However, for those using the boost.asio
38-
* `io_service` as the app's core main loop, this is not as easy as what one might desire. (Side note:
38+
* `io_context` as the app's core main loop, this is not as easy as what one might desire. (Side note:
3939
* I personally strongly recommend using boost.asio event loops instead of rolling one's own or the many alternatives
4040
* I have seen. It is also on its way to ending up in the C++ standard library. Lastly, such a loop is used
4141
* internally to implement `net_flow`, so you know I like it, for what that's worth.)
@@ -46,7 +46,7 @@ namespace flow::net_flow::asio
4646
*
4747
* The usage pattern is simple, assuming you understand tha basics of net_flow::Node, net_flow::Server_socket, and
4848
* net_flow::Peer_socket -- and especially if you are familiar with boost.asio's built-in `tcp::acceptor` and
49-
* `tcp::socket` (and, of course, `boost::asio::io_service` that ties them and many more I/O objects together).
49+
* `tcp::socket` (and, of course, `boost::asio::io_context` that ties them and many more I/O objects together).
5050
*
5151
* - First, simply create an asio::Node using the same form of constructor as you would with net_flow::Node, plus
5252
* an arg that's a pointer to the subsequently used target boost.asio flow::util::Task_engine, which is memorized.
@@ -72,7 +72,7 @@ namespace flow::net_flow::asio
7272
* - For each op inside an "arrow," I mean to include all forms of it
7373
* (`F` includes: `F()`, `sync_F()`, `async_F()`).
7474
* - This pattern is more practical/reasonable for us than the boost.asio pattern of each object memorizing its
75-
* `io_service` reference in its explicit constructor. That is because we fully embrace the
75+
* `io_context` reference in its explicit constructor. That is because we fully embrace the
7676
* factory-of-shared-pointers pattern, and boost.asio doesn't use that pattern. We also provide an explicit
7777
* mutator however.
7878
* - We also allow for a null `Task_engine*` -- except when `async_*()` is actually performed.
@@ -82,7 +82,7 @@ namespace flow::net_flow::asio
8282
* boost.asio built-in I/O objects.)
8383
*
8484
* Having thus obtained asio::Server_socket and asio::Peer_socket objects (and assigned each their desired
85-
* boost.asio `io_service` loop(s) -- essentially as one does with, e.g., `tcp::acceptor` and `tcp::socket`
85+
* boost.asio `io_context` loop(s) -- essentially as one does with, e.g., `tcp::acceptor` and `tcp::socket`
8686
* respectively) -- you many now use the full range of I/O operations. Here is a bird's eye view of all operations
8787
* available in the entire hierarchy. Note that conceptually this is essentially identical to boost.asio `tcp`
8888
* I/O objects, but nomenclature and API decisions are in some cases somewhat different (I contend: with good reason).
@@ -130,25 +130,25 @@ namespace flow::net_flow::asio
130130
* - Asynchronous operations (`asio::*` classes provide these):
131131
* - asio::Server_socket::async_accept() -> asio::Peer_socket: Obtain a fully connected peer socket object,
132132
* waiting as necessary in background for a connection to come in and fully establish,
133-
* then invoking user-provided callback as if by `io_service::post()`.
133+
* then invoking user-provided callback as if by `io_context::post()`.
134134
* - Equivalent: `tcp::acceptor::async_accept()`.
135135
* - Variations: optional timeout can be specified.
136136
* - Variations: `reactor_pattern` mode, where the `accept()` call itself is left to user handler.
137137
* - asio::Node::async_connect() -> net_flow::Peer_socket: Return a fully connected peer socket object,
138138
* waiting as necessary in background to reach the remote server and fully establish connection,
139-
* then invoking user-provided callback as if by `io_service::post()`.
139+
* then invoking user-provided callback as if by `io_context::post()`.
140140
* - Equivalent: `tcp::socket::async_connect()`.
141141
* - Variations: optional timeout can be specified.
142142
* - Variations: see also `*_with_metadata()` as above.
143143
* - asio::Peer_socket::async_send(): Queue up at least 1 of the N given bytes to send to peer ASAP,
144144
* waiting as necessary in background for this to become possible (as explained above),
145-
* then invoking user-provided callback as if by `io_service::post()`.
145+
* then invoking user-provided callback as if by `io_context::post()`.
146146
* - Equivalent: `tcp::socket::async_send()`.
147147
* - Variations: optional timeout can be specified.
148148
* - Variations: `null_buffers` mode, where the `send()` call itself is left to user handler.
149149
* - asio::Peer_socket::async_receive(): Dequeue at least 1 of the desired N bytes from peer,
150150
* waiting as necessary in background for this to arrive from said remote peer,
151-
* then invoking user-provided callback as if by `io_service::post()`.
151+
* then invoking user-provided callback as if by `io_context::post()`.
152152
* - Equivalent: `tcp::socket::async_receive()`.
153153
* - Variations: optional timeout can be specified.
154154
* - Variations: `null_buffers` mode, where the `receive()` call itself is left to user handler.
@@ -169,7 +169,7 @@ namespace flow::net_flow::asio
169169
* - Equivalent: `poll()` with 0 timeout.
170170
* - Event_set::async_wait(): Asynchronous I/O multiplixing, like sync_wait() but waits in background and
171171
* executes user-provided callback from an unspecified thread. (A typical callback might set a `future`
172-
* result; `io_service::post()` a task to some boost.asio event loop; perhaps set a flag that is
172+
* result; `io_context::post()` a task to some boost.asio event loop; perhaps set a flag that is
173173
* periodically checked by some user thread; or send a byte over some quick IPC mechanism like a POSIX
174174
* domain socket or loopback UDP socket -- or even a condition variable.)
175175
* - Equivalents: none in POSIX, that I know of. Windows "overlapped" async I/O sounds vaguely like a distant

src/flow/net_flow/asio/peer_socket.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ namespace flow::net_flow::asio
2828
* A net_flow::Peer_socket that adds integration with boost.asio. See net_flow::Node for a discussion of the topic of
2929
* boost.asio integration. A net_flow::asio::Peer_socket *is* a net_flow::Peer_socket with all that functionality, plus
3030
* APIs (such as async_send(), async_receive()) that accomplish boost.asio-style asynchronous operations with a
31-
* standard `boost::asio::io_service` (a/k/a flow::util::Task_engine).
31+
* standard `boost::asio::io_context` (a/k/a flow::util::Task_engine).
3232
*
3333
* As of this writing, `asio::Peer_socket::Ptr`s are generated by `asio::Node::connect()`,
34-
* `asio::Server_socket::accept()`, and their derivatives. The underlying `io_service` (a/k/a flow::util::Task_engine)
34+
* `asio::Server_socket::accept()`, and their derivatives. The underlying `io_context` (a/k/a flow::util::Task_engine)
3535
* is carried forward from the factory object that generated and returned the `Ptr`. It can be overwritten via
3636
* set_async_task_engine().
3737
*/

src/flow/net_flow/asio/server_socket.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ namespace flow::net_flow::asio
2828
* A net_flow::Server_socket that adds integration with boost.asio. See net_flow::Node for a discussion of the topic of
2929
* boost.asio integration. A net_flow::asio::Server_socket *is* a net_flow::Server_socket with all that functionality,
3030
* plus APIs (mainly async_accept()) that accomplish boost.asio-style asynchronous operations with a
31-
* standard `boost::asio::io_service`.
31+
* standard `boost::asio::io_context`.
3232
*
3333
* As of this writing, `asio::Server_socket::Ptr`s are generated by `net_flow::Node::listen()` and any derivatives.
34-
* The underlying `io_service` (a/k/a flow::util::Task_engine)
34+
* The underlying `io_context` (a/k/a flow::util::Task_engine)
3535
* is carried forward from the `net_flow::asio::Node` factory object that generated and returned the `Ptr`. It can be
3636
* overwritten via set_async_task_engine().
3737
*/

0 commit comments

Comments
 (0)