1#ifndef DUNE_COPASI_COMMON_OSTREAM_REDIRECT_HH
2#define DUNE_COPASI_COMMON_OSTREAM_REDIRECT_HH
4#include <dune-copasi-config.hh>
6#include <function2/function2.hpp>
45 using Base = std::stringbuf;
49 fu2::unique_function<
void(std::string_view)>
redirection,
67 fu2::unique_function<
void(std::string_view)>
redirection,
78 std::ostream* _ostream;
79 std::streambuf* _ostream_buffer;
80 fu2::unique_function<
void(std::string_view)> _redirection;
Helper class to redirect std::ostream to a functor.
Definition ostream_redirect.hh:43
static std::unique_ptr< OStreamRedirect > make(std::ostream &ostream, fu2::unique_function< void(std::string_view)> redirection, bool line_buffered=true)
RAII safe constructor of the redirection object While the object is alive, the output of ostream will...
OStreamRedirect & operator=(const OStreamRedirect &other)=delete
~OStreamRedirect() override
OStreamRedirect & operator=(OStreamRedirect &&other) noexcept=delete
OStreamRedirect(OStreamRedirect &&other) noexcept=delete
OStreamRedirect(const OStreamRedirect &other)=delete
Definition axis_names.hh:7
constexpr bool is_bitflags_v
Alias for Bitflag indicator.
Definition bit_flags.hh:24