|
Chops Net IP
|
Functions and classes for error callback handling and basic logging. More...
#include <cstddef>#include <utility>#include <system_error>#include <ostream>#include <string>#include <chrono>#include "net_ip/basic_io_interface.hpp"#include "net_ip/net_ip_error.hpp"#include "queue/wait_queue.hpp"

Go to the source code of this file.
Classes | |
| struct | chops::net::error_data |
| Data provided through an error function callback. More... | |
Typedefs | |
| using | chops::net::err_wait_q = chops::wait_queue<error_data> |
wait_queue declaration that provides error data. | |
Functions | |
| template<typename IOT > | |
| auto | chops::net::make_error_func_with_wait_queue (err_wait_q &wq) |
Create an error function object that uses a wait_queue for error data. | |
| std::size_t | chops::net::ostream_error_sink_with_wait_queue (err_wait_q &wq, std::ostream &os) |
A sink function that uses a wait_queue for error data and streams the data into an std::ostream. | |
Functions and classes for error callback handling and basic logging.
Copyright (c) 2018-2019 by Cliff Green
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
inline |
A sink function that uses a wait_queue for error data and streams the data into an std::ostream.
A std::cerr or std::cout or std::stringstream or similar object can be used with this function. This function exits when the wait_queue closes.
std::async can be used to invoke this function in a separate thread.
| wq | A reference to a err_wait_q object. |
| os | A reference to a std::ostream, such as std::cerr. |